Remove JSHint and JSCS and install ESLint.

This commit is contained in:
Bardi Harborow 2018-01-13 21:16:09 +11:00 committed by Daniel Glus
parent 8b2a3906ff
commit 8c65b22244
6 changed files with 43 additions and 54 deletions

34
.eslintrc.json Normal file
View File

@ -0,0 +1,34 @@
{
"extends": "wikimedia",
"env": {
"browser": true,
"jquery": true
},
"globals": {
"AFCH": true,
"Hogan": false,
"importScript": false,
"mediaWiki": true,
"mw": true,
"OO": false
},
"rules": {
"camelcase": 0,
"eqeqeq": 0,
"no-console": 0,
"no-global-assign": 0,
"no-implicit-globals": 0,
"no-native-reassign": 0,
"no-new": 0,
"no-undef": 0,
"no-underscore-dangle": 0,
"no-unused-vars": 0,
"no-use-before-define": 0,
"no-useless-concat": 0,
"no-useless-escape": 0,
"one-var": 0,
"spaced-comment": 0,
"valid-jsdoc": 0,
"vars-on-top": 0
}
}

21
.jscsrc
View File

@ -1,21 +0,0 @@
{
"requireCurlyBraces": ["if", "else", "for", "while", "do"],
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "function"],
"requireParenthesesAroundIIFE": true,
"requireSpacesInFunctionExpression": {
"beforeOpeningCurlyBrace": true
},
"requireMultipleVarDecl": true,
"disallowEmptyBlocks": true,
"requireSpacesInsideObjectBrackets": "all",
"disallowSpaceAfterObjectKeys": true,
"requireCommaBeforeLineBreak": true,
"requireSpacesInConditionalExpression": true,
"disallowMultipleLineBreaks": true,
"validateLineBreaks": "LF",
"validateQuoteMarks": "'",
"disallowMixedSpacesAndTabs": "smart",
"disallowTrailingWhitespace": true,
"requireLineFeedAtFileEnd": true,
"requireDotNotation": true
}

View File

@ -1 +0,0 @@
node_modules

View File

@ -1,19 +0,0 @@
{
// Enforcing
"camelcase": true,
"eqeqeq": true,
"latedef": true,
"noarg": true,
"nonew": true,
"undef": true,
"unused": true,
"trailing": true,
// Environment
"browser": true,
"globals": {
"jQuery": false,
"mediaWiki": false
}
}

View File

@ -55,16 +55,12 @@ module.exports = function ( grunt ) {
build: {
files: {
'build/afch.css': [ 'build/**/*.css' ]
     }
    }
}
}
},
jshint: {
src: [ 'src/**/*.js', 'contrib/**/*.js', '__tests__/**/*.js', ]
},
jscs: {
src: [ 'src/**/*.js', 'contrib/**/*.js', '__tests__/**/*.js' ]
eslint: {
target: [ 'src/**/*.js', 'contrib/**/*.js', '__tests__/**/*.js', 'Gruntfile.js' ]
},
exec: {
@ -79,15 +75,14 @@ module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-contrib-concat' );
grunt.loadNpmTasks( 'grunt-contrib-copy' );
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
grunt.loadNpmTasks( 'grunt-contrib-less' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-exec' );
grunt.loadNpmTasks( 'grunt-jscs' );
grunt.registerTask(
'teststyle',
'Tests files for code style and code quality.',
[ 'jshint', 'jscs' ]
[ 'eslint' ]
);
grunt.registerTask(

View File

@ -17,16 +17,17 @@
"dependencies": {
},
"devDependencies": {
"eslint": "^4.15.0",
"eslint-config-wikimedia": "^0.5.0",
"grunt": "^1.0.1",
"grunt-autoprefixer": "^3.0.4",
"grunt-contrib-clean": "^1.1.0",
"grunt-contrib-concat": "^1.0.1",
"grunt-contrib-copy": "^1.0.0",
"grunt-contrib-cssmin": "^2.2.1",
"grunt-contrib-jshint": "^1.1.0",
"grunt-contrib-less": "^1.4.1",
"grunt-eslint": "^20.1.0",
"grunt-exec": "^3.0.0",
"grunt-jscs": "^3.0.1",
"jest-cli": "^12.1.1",
"jquery": "^3.2.1"
}