build: Add stylelint for css file

Since I807f729c1b1a9e9b5952685bb18f540f81d70f47

Change-Id: Id9b81f0ef9bfe5de599fe3cbb8dbb569fb8d59e2
This commit is contained in:
Umherirrender 2019-02-15 20:06:19 +01:00
parent 76c3fb4fed
commit 1ab4739e3f
3 changed files with 15 additions and 2 deletions

3
.stylelintrc.json Normal file
View file

@ -0,0 +1,3 @@
{
"extends": "stylelint-config-wikimedia"
}

View file

@ -12,6 +12,7 @@ module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.initConfig( {
eslint: {
@ -22,6 +23,13 @@ module.exports = function ( grunt ) {
]
},
banana: conf.MessagesDirs,
stylelint: {
all: [
'**/*.css',
'!node_modules/**',
'!vendor/**'
]
},
watch: {
files: [
'.eslintrc.json',
@ -37,6 +45,6 @@ module.exports = function ( grunt ) {
}
} );
grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana' ] );
grunt.registerTask( 'test', [ 'eslint', 'stylelint', 'jsonlint', 'banana' ] );
grunt.registerTask( 'default', 'test' );
};

View file

@ -10,6 +10,8 @@
"grunt-banana-checker": "0.6.0",
"grunt-contrib-watch": "1.1.0",
"grunt-eslint": "21.0.0",
"grunt-jsonlint": "1.1.0"
"grunt-jsonlint": "1.1.0",
"grunt-stylelint": "0.10.1",
"stylelint-config-wikimedia": "0.5.0"
}
}