diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..1380bd8 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +/vendor +/resources/libraries diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 0000000..a7d2ee6 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,12 @@ +{ + "extends": "wikimedia", + "env": { + "browser": true, + "jquery": true + }, + "rules": { + "no-unused-vars": 0, + "quotes": 0, + "space-before-function-paren": 0 + } +} diff --git a/.jshintignore b/.jshintignore deleted file mode 100644 index 1395b35..0000000 --- a/.jshintignore +++ /dev/null @@ -1,3 +0,0 @@ -node_modules/** -vendor/** -resources/libraries/** diff --git a/Gruntfile.js b/Gruntfile.js index d812e55..551d34f 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -1,17 +1,13 @@ -/*jshint node:true */ +/* eslint-env node */ module.exports = function ( grunt ) { - grunt.loadNpmTasks( 'grunt-contrib-jshint' ); grunt.loadNpmTasks( 'grunt-jsonlint' ); grunt.loadNpmTasks( 'grunt-banana-checker' ); + grunt.loadNpmTasks( 'grunt-eslint' ); grunt.loadNpmTasks( 'grunt-stylelint' ); grunt.initConfig( { - jshint: { - all: [ - '**/*.js', - '!node_modules/**', - '!vendor/**' - ] + eslint: { + all: '.' }, banana: { all: 'i18n/' @@ -35,6 +31,6 @@ module.exports = function ( grunt ) { } } ); - grunt.registerTask( 'test', [ 'jshint', 'jsonlint', 'banana', 'stylelint' ] ); + grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana', 'stylelint' ] ); grunt.registerTask( 'default', 'test' ); }; diff --git a/package.json b/package.json index 45ba1cd..90408a6 100644 --- a/package.json +++ b/package.json @@ -4,9 +4,10 @@ "test": "grunt test" }, "devDependencies": { + "eslint-config-wikimedia": "0.4.0", "grunt": "1.0.1", "grunt-banana-checker": "0.6.0", - "grunt-contrib-jshint": "1.1.0", + "grunt-eslint": "20.0.0", "grunt-jsonlint": "1.1.0", "grunt-stylelint": "0.7.0", "stylelint": "7.8.0",