build: Add stylelint for less file

Change-Id: I87717cd5f1a2aa55f78174d639fe7ba648837172
This commit is contained in:
Umherirrender 2024-04-02 01:31:42 +02:00
parent f1fffb966b
commit 65b0f8b3b7
4 changed files with 2861 additions and 23 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-banana-checker' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.initConfig( {
eslint: {
@ -22,15 +23,23 @@ module.exports = function ( grunt ) {
all: [ '.' ]
},
banana: conf.MessagesDirs,
stylelint: {
all: [
'**/*.{css,less}',
'!node_modules/**',
'!vendor/**'
]
},
watch: {
files: [
'.eslintrc.json',
'<%= eslint.all %>'
'.{stylelintrc,eslintrc}.json',
'<%= eslint.all %>',
'<%= stylelint.all %>'
],
tasks: 'test'
}
} );
grunt.registerTask( 'test', [ 'eslint', 'banana' ] );
grunt.registerTask( 'test', [ 'eslint', 'banana', 'stylelint' ] );
grunt.registerTask( 'default', 'test' );
};

2864
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -11,6 +11,8 @@
"grunt-banana-checker": "0.11.1",
"grunt-contrib-watch": "1.1.0",
"grunt-eslint": "24.3.0",
"grunt-stylelint": "0.19.0",
"stylelint-config-wikimedia": "0.16.1",
"svgo": "3.2.0"
}
}