mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Echo
synced 2024-11-12 09:26:05 +00:00
6d2e560c1e
Introducing stylelint with configuration rules compliant to Wikimedia CSS Coding Standards 'stylelint-config-wikimedia', nullifying some for now and making majority pass. Change-Id: I2c4acee41c9b56d9b00e2a2c5b7ab0ab5de454ce
65 lines
1.2 KiB
JavaScript
65 lines
1.2 KiB
JavaScript
/*jshint node:true */
|
||
module.exports = function ( grunt ) {
|
||
grunt.loadNpmTasks( 'grunt-contrib-jshint' );
|
||
grunt.loadNpmTasks( 'grunt-contrib-watch' );
|
||
grunt.loadNpmTasks( 'grunt-jsonlint' );
|
||
grunt.loadNpmTasks( 'grunt-banana-checker' );
|
||
grunt.loadNpmTasks( 'grunt-jscs' );
|
||
grunt.loadNpmTasks( 'grunt-stylelint' );
|
||
|
||
grunt.initConfig( {
|
||
jshint: {
|
||
options: {
|
||
jshintrc: true,
|
||
ignores: [
|
||
'tests/externals/**'
|
||
]
|
||
},
|
||
all: [
|
||
'**/*.js',
|
||
'!node_modules/**',
|
||
'!docs/**'
|
||
]
|
||
},
|
||
jscs: {
|
||
src: [
|
||
'<%= jshint.all %>',
|
||
'!tests/externals/**',
|
||
'!docs/**'
|
||
]
|
||
},
|
||
// Lint – Styling
|
||
stylelint: {
|
||
options: {
|
||
syntax: 'less'
|
||
},
|
||
all: [
|
||
'modules/**/*.css',
|
||
'modules/**/*.less'
|
||
]
|
||
},
|
||
banana: {
|
||
all: 'i18n/'
|
||
},
|
||
watch: {
|
||
files: [
|
||
'.{csslintrc,jscsrc,jshintignore,jshintrc}',
|
||
'<%= jshint.all %>',
|
||
'<%= csslint.all %>'
|
||
],
|
||
tasks: 'test'
|
||
},
|
||
jsonlint: {
|
||
all: [
|
||
'**/*.json',
|
||
'!node_modules/**',
|
||
'!docs/**'
|
||
]
|
||
}
|
||
} );
|
||
|
||
grunt.registerTask( 'lint', [ 'jshint', 'jscs', 'stylelint', 'jsonlint', 'banana' ] );
|
||
grunt.registerTask( 'test', 'lint' );
|
||
grunt.registerTask( 'default', 'test' );
|
||
};
|