mediawiki-extensions-CodeMi.../Gruntfile.js
Thiemo Kreuz 20debba3b0 Enable eslint for our custom code in the matchbrackets addon
The resulting code style in this file is a little mixed. I tried to
stick to the existing style. Most notably is the indention with
2 spaces instead of 1 tab. But I couldn't disable the spaces inside
round brackets. They make the code so much more readable.

What this patch effectively does is enabling the eslint check for our
custom code in this addon, excluding all old code, and exclusing a few
rules that conflict to heavily with the old code style.

Change-Id: I12f953cb0a6fd35e405b6cc348abfb2c11e70696
2022-03-03 21:07:19 +00:00

37 lines
701 B
JavaScript

'use strict';
module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.initConfig( {
eslint: {
options: {
cache: true,
fix: grunt.option( 'fix' )
},
all: [
'**/*.{js,json}',
'!resources/lib/**',
'!{vendor,node_modules}/**'
]
},
stylelint: {
all: [
'**/*.{css,less}',
'!resources/lib/**',
'!node_modules/**',
'!vendor/**',
'resources/lib/codemirror-fixes.less'
]
},
banana: {
all: 'i18n/'
}
} );
grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};