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

View file

@ -14,13 +14,13 @@
} }
#mw-panel div.portal div.body .CategoryTreeTag { #mw-panel div.portal div.body .CategoryTreeTag {
margin: 0; margin: 0;
font-size: 0.75em; font-size: 0.75em;
line-height: 1.125em; line-height: 1.125em;
} }
#mw-panel div.portal div.body .CategoryTreeItem { #mw-panel div.portal div.body .CategoryTreeItem {
padding: 0.25em 0; padding: 0.25em 0;
} }
.CategoryTreeChildren { .CategoryTreeChildren {
@ -33,7 +33,7 @@
.CategoryTreeEmptyBullet { .CategoryTreeEmptyBullet {
cursor: default; cursor: default;
color: #C0C0C0; color: #c0c0c0;
} }
.CategoryTreeBullet a, .CategoryTreeBullet a,
@ -46,7 +46,7 @@
} }
.CategoryTreeToggle { .CategoryTreeToggle {
color: #0645AD; color: #0645ad;
} }
.CategoryTreeLabelPage { .CategoryTreeLabelPage {
@ -77,11 +77,11 @@
display: inline-block; display: inline-block;
/* why is the -0.5ex needed? */ /* why is the -0.5ex needed? */
margin: -0.5ex 0 0 1ex; margin: -0.5ex 0 0 1ex;
padding:0; padding: 0;
vertical-align: top; vertical-align: top;
/* IE6-7 Hack for display: inline-block */ /* IE6-7 Hack for display: inline-block */
zoom: 1; zoom: 1;
*display: inline; *display: inline; /* stylelint-disable-line declaration-block-no-duplicate-properties */
} }
.CategoryTreeSection { .CategoryTreeSection {

View file

@ -7,9 +7,10 @@
"test": "grunt test" "test": "grunt test"
}, },
"devDependencies": { "devDependencies": {
"grunt": "0.4.5", "grunt": "1.0.1",
"grunt-cli": "0.1.13",
"grunt-banana-checker": "0.4.0", "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"
} }
} }