Add stylelint to repository

This commit is contained in:
Jonathan (JB) Belcher 2016-08-08 15:32:39 -04:00
parent ab721f2d4a
commit 1f49528fea
3 changed files with 71 additions and 0 deletions

59
.stylelintrc Normal file
View File

@ -0,0 +1,59 @@
{
"rules": {
"color-hex-case": "lower",
"color-no-invalid-hex": true,
"function-calc-no-unspaced-operator": true,
"function-comma-space-after": "always-single-line",
"function-comma-space-before": "never",
"function-name-case": "lower",
"function-url-quotes": "always",
"function-whitespace-after": "always",
"number-leading-zero": "always",
"number-no-trailing-zeros": true,
"length-zero-no-unit": true,
"string-no-newline": true,
"string-quotes": "single",
"unit-case": "lower",
"unit-no-unknown": true,
"unit-whitelist": ["px", "%", "deg", "ms", "em", "vh", "vw", "rem"],
"value-list-comma-space-after": "always-single-line",
"value-list-comma-space-before": "never",
"shorthand-property-no-redundant-values": true,
"property-case": "lower",
"declaration-block-no-duplicate-properties": true,
"declaration-block-no-ignored-properties": true,
"declaration-block-trailing-semicolon": "always",
"declaration-block-single-line-max-declarations": 0,
"declaration-block-semicolon-space-before": "never",
"declaration-block-semicolon-space-after": "always-single-line",
"declaration-block-semicolon-newline-before": "never-multi-line",
"declaration-block-semicolon-newline-after": "always-multi-line",
"block-closing-brace-newline-after": "always",
"block-closing-brace-newline-before": "always-multi-line",
"block-no-empty": true,
"block-opening-brace-newline-after": "always-multi-line",
"block-opening-brace-space-before": "always",
"selector-attribute-brackets-space-inside": "never",
"selector-attribute-operator-space-after": "never",
"selector-attribute-operator-space-before": "never",
"selector-combinator-space-after": "always",
"selector-combinator-space-before": "always",
"selector-pseudo-class-case": "lower",
"selector-pseudo-class-parentheses-space-inside": "always",
"selector-pseudo-element-case": "lower",
"selector-pseudo-element-colon-notation": "double",
"selector-pseudo-element-no-unknown": true,
"selector-type-case": "lower",
"selector-no-id": true
}
}

View File

@ -28,6 +28,16 @@ module.exports = function( grunt ) {
]
},
// Sass linting with Stylelint.
stylelint: {
options: {
stylelintrc: '.stylelintrc'
},
all: [
'<%= dirs.css %>/*.scss',
]
},
// Minify .js files.
uglify: {
options: {
@ -228,6 +238,7 @@ module.exports = function( grunt ) {
grunt.loadNpmTasks( 'grunt-contrib-cssmin' );
grunt.loadNpmTasks( 'grunt-contrib-watch' );
grunt.loadNpmTasks( 'grunt-contrib-clean' );
grunt.loadNpmTasks( 'grunt-stylelint' );
// Register tasks
grunt.registerTask( 'default', [

View File

@ -19,6 +19,7 @@
"grunt-contrib-uglify": "~1.0.0",
"grunt-contrib-watch": "~1.0.0",
"grunt-shell": "~1.3.0",
"grunt-stylelint": "^0.6.0",
"grunt-wp-i18n": "~0.5.4",
"node-bourbon": "~4.2.3"
},