Add stylelint for less files

Fixed the following rules:
string-quotes
declaration-property-value-blacklist
number-leading-zero

Change-Id: I7c8021070b69cd60ac010e90b3bc13a033d695e2
This commit is contained in:
Umherirrender 2017-04-18 16:25:19 +02:00
parent 1b6c46d7dd
commit 627c254157
4 changed files with 21 additions and 5 deletions

6
.stylelintrc Normal file
View file

@ -0,0 +1,6 @@
{
"extends": "stylelint-config-wikimedia",
"rules": {
"no-descending-specificity": null
}
}

View file

@ -5,6 +5,7 @@ module.exports = function ( grunt ) {
grunt.loadNpmTasks( 'grunt-eslint' );
grunt.loadNpmTasks( 'grunt-jsonlint' );
grunt.loadNpmTasks( 'grunt-banana-checker' );
grunt.loadNpmTasks( 'grunt-stylelint' );
grunt.initConfig( {
eslint: {
@ -17,11 +18,18 @@ module.exports = function ( grunt ) {
jsonlint: {
all: [
'**/*.json',
'.stylelintrc',
'!node_modules/**'
]
},
stylelint: {
all: [
'**/*.less',
'!node_modules/**'
]
}
} );
grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana' ] );
grunt.registerTask( 'test', [ 'eslint', 'jsonlint', 'banana', 'stylelint' ] );
grunt.registerTask( 'default', 'test' );
};

View file

@ -9,6 +9,8 @@
"grunt-banana-checker": "0.4.0",
"grunt-cli": "0.1.13",
"grunt-eslint": "^19.0.0",
"grunt-jsonlint": "1.0.7"
"grunt-jsonlint": "1.0.7",
"grunt-stylelint": "0.6.0",
"stylelint-config-wikimedia": "0.4.1"
}
}

View file

@ -1,9 +1,9 @@
@import "mediawiki.ui/variables";
@import 'mediawiki.ui/variables';
.ra-read-more {
h2 {
border-bottom: none;
font-size: .8em;
border-bottom: 0;
font-size: 0.8em;
font-weight: normal;
color: @colorGray9;
padding-bottom: 0.5em;