mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Popups
synced 2024-11-23 23:24:39 +00:00
Run eslint on compiled assets to ensure code is es5 compatible
It doesn't feel great but it does the trick. Bug: T174570 Change-Id: I76d1b81625a77df0d926c2da714bcab606a28b8d
This commit is contained in:
parent
eb6c893e1e
commit
90fbd093c8
49
.eslintrc.es5.json
Normal file
49
.eslintrc.es5.json
Normal file
|
@ -0,0 +1,49 @@
|
|||
{
|
||||
"parserOptions": {
|
||||
"sourceType": "script",
|
||||
"ecmaVersion": "5"
|
||||
},
|
||||
"env": {
|
||||
"browser": true,
|
||||
"jquery": true,
|
||||
"commonjs": false,
|
||||
"qunit": true
|
||||
},
|
||||
"rules": {
|
||||
"spaced-comment": 0,
|
||||
"space-in-parens": 0,
|
||||
"block-spacing": 0,
|
||||
"object-curly-spacing": 0,
|
||||
"eol-last": 0,
|
||||
"semi": 0,
|
||||
"comma-spacing": 0,
|
||||
"space-before-function-paren": 0,
|
||||
"space-before-blocks": 0,
|
||||
"space-infix-ops": 0,
|
||||
"vars-on-top": 0,
|
||||
"semi-spacing": 0,
|
||||
"key-spacing": 0,
|
||||
"quotes": 0,
|
||||
"no-return-assign": 0,
|
||||
"keyword-spacing": 0,
|
||||
"eqeqeq": 0,
|
||||
"yoda": 0,
|
||||
"computed-property-spacing": 0,
|
||||
"no-unused-expressions": 0,
|
||||
"no-sequences": 0,
|
||||
"array-bracket-spacing": 0,
|
||||
"no-void": 0,
|
||||
"no-unused-vars": 0,
|
||||
"no-undef": 0,
|
||||
"quote-props": 0,
|
||||
"curly": 0,
|
||||
"one-var": 0,
|
||||
"no-console": 0,
|
||||
"no-underscore-dangle": 0,
|
||||
"wrap-iife": 0,
|
||||
"new-parens": 0,
|
||||
"no-fallthrough": 0,
|
||||
"no-implicit-coercion": 0,
|
||||
"no-catch-shadow": 0
|
||||
}
|
||||
}
|
29
Gruntfile.js
29
Gruntfile.js
|
@ -12,15 +12,24 @@ module.exports = function ( grunt ) {
|
|||
grunt.initConfig( {
|
||||
banana: conf.MessagesDirs,
|
||||
eslint: {
|
||||
all: [
|
||||
'src/**',
|
||||
'resources/ext.popups/*.js',
|
||||
'resources/ext.popups/**/*.js',
|
||||
'tests/node-qunit/**/*.js',
|
||||
'!resources/dist/index.js',
|
||||
'!docs/**',
|
||||
'!node_modules/**'
|
||||
]
|
||||
// Lint the built artifacts with ES5 so that no ES6 slips to production
|
||||
build: {
|
||||
options: {
|
||||
configFile: '.eslintrc.es5.json'
|
||||
},
|
||||
src: [
|
||||
'resources/dist/*.js'
|
||||
]
|
||||
},
|
||||
sources: {
|
||||
src: [
|
||||
'src/**',
|
||||
'tests/node-qunit/**/*.js',
|
||||
'!resources/dist/index.js',
|
||||
'!docs/**',
|
||||
'!node_modules/**'
|
||||
]
|
||||
}
|
||||
},
|
||||
jsonlint: {
|
||||
all: [
|
||||
|
@ -56,6 +65,6 @@ module.exports = function ( grunt ) {
|
|||
}
|
||||
} );
|
||||
|
||||
grunt.registerTask( 'lint', [ 'eslint', 'stylelint', 'jsonlint', 'banana' ] );
|
||||
grunt.registerTask( 'lint', [ 'eslint', 'stylelint', 'jsonlint', 'banana', 'eslint:build' ] );
|
||||
grunt.registerTask( 'default', [ 'lint' ] );
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue