From 1ab4739e3f3345c72b820a1e6be2165ed3dc938d Mon Sep 17 00:00:00 2001 From: Umherirrender Date: Fri, 15 Feb 2019 20:06:19 +0100 Subject: [PATCH] build: Add stylelint for css file Since I807f729c1b1a9e9b5952685bb18f540f81d70f47 Change-Id: Id9b81f0ef9bfe5de599fe3cbb8dbb569fb8d59e2 --- .stylelintrc.json | 3 +++ Gruntfile.js | 10 +++++++++- package.json | 4 +++- 3 files changed, 15 insertions(+), 2 deletions(-) create mode 100644 .stylelintrc.json diff --git a/.stylelintrc.json b/.stylelintrc.json new file mode 100644 index 00000000..2c907302 --- /dev/null +++ b/.stylelintrc.json @@ -0,0 +1,3 @@ +{ + "extends": "stylelint-config-wikimedia" +} diff --git a/Gruntfile.js b/Gruntfile.js index fb6fe230..ff7623e8 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -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' ); }; diff --git a/package.json b/package.json index 6094537e..ef7f15eb 100644 --- a/package.json +++ b/package.json @@ -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" } }