Add stylelint for css files

Fixed the following rules:
color-hex-case
declaration-colon-space-after
indentation

Change-Id: I417137916607a25bab6a3c85a95b4c489fb8a8a5
This commit is contained in:
Umherirrender 2017-04-17 19:19:52 +02:00
parent eb5c87b55f
commit 400a3ad210
4 changed files with 29 additions and 12 deletions

7
.stylelintrc Normal file
View file

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

View file

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

View file

@ -33,7 +33,7 @@
.CategoryTreeEmptyBullet {
cursor: default;
color: #C0C0C0;
color: #c0c0c0;
}
.CategoryTreeBullet a,
@ -46,7 +46,7 @@
}
.CategoryTreeToggle {
color: #0645AD;
color: #0645ad;
}
.CategoryTreeLabelPage {
@ -77,11 +77,11 @@
display: inline-block;
/* why is the -0.5ex needed? */
margin: -0.5ex 0 0 1ex;
padding:0;
padding: 0;
vertical-align: top;
/* IE6-7 Hack for display: inline-block */
zoom: 1;
*display: inline;
*display: inline; /* stylelint-disable-line declaration-block-no-duplicate-properties */
}
.CategoryTreeSection {

View file

@ -7,9 +7,10 @@
"test": "grunt test"
},
"devDependencies": {
"grunt": "0.4.5",
"grunt-cli": "0.1.13",
"grunt": "1.0.1",
"grunt-banana-checker": "0.4.0",
"grunt-jsonlint": "1.0.7"
"grunt-jsonlint": "1.0.7",
"grunt-stylelint": "0.6.0",
"stylelint-config-wikimedia": "0.4.1"
}
}