mediawiki-skins-MinervaNeue/Gruntfile.js
Nicholas Ray 46ab5b9c36 Prevent our 'no-restricted-properties' from clobbering eslint-config-wikimedia
Our eslintrc extends from 'wikimedia/client' which includes a
'no-restricted-properties' ruleset from the 'not-es5.js' file [1].

However, we were also including our own 'no-restricted-properties'
rules.

ESLint handle this duplication by clobbering instead of merging
so eslint-config-wikimedia's no-restricted-properties where not taking
effect and we were losing out on some guards against using es6.

This commit corrects that and makes both no-restricted-properties
rulesets merge instead of clobber as already done in MobileFrontend [2]

[1] 07320f16ae/language/not-es5.js (L5)
[2] https://github.com/wikimedia/mediawiki-extensions-MobileFrontend/blob/master/.eslintshared.js

Bug: T239269
Change-Id: Ibc2c144be51719d71a4c1d5828486253a5d4bf5d
2020-02-11 17:04:14 -07:00

65 lines
1.4 KiB
JavaScript

/* eslint-env node */
/* eslint-disable no-restricted-properties */
module.exports = function ( grunt ) {
var conf = grunt.file.readJSON( 'skin.json' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-notify' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.initConfig( {
eslint: {
options: {
cache: true,
extensions: [ '.js', '.json' ],
maxWarnings: 0,
reportUnusedDisableDirectives: true
},
all: [
'**/*.{js,json}',
'!docs/**',
'!libs/**',
'!node_modules/**',
'!vendor/**'
]
},
stylelint: {
all: [
'**/*.{css,less}',
// TODO: Nested imports cause stylelint to crash
'!resources/skins.minerva.base.styles/print/styles.less',
'!docs/**',
'!libs/**',
'!node_modules/**',
'!vendor/**'
]
},
banana: Object.assign( {
options: { requireLowerCase: false }
}, conf.MessagesDirs ),
watch: {
lint: {
files: [ '{resources,tests/qunit}/**/*.{js,less}' ],
tasks: [ 'lint' ]
},
scripts: {
files: [ '{resources,tests/qunit}/**/*.js' ],
tasks: [ 'test' ]
},
configFiles: {
files: [ 'Gruntfile.js' ],
options: {
reload: true
}
}
}
} );
grunt.registerTask( 'lint', [ 'eslint', 'stylelint', 'banana' ] );
grunt.registerTask( 'test', [ 'lint' ] );
grunt.registerTask( 'default', [ 'test' ] );
};