diff options
author | Martijn Cuppens <martijn.cuppens@intracto.com> | 2018-12-30 19:00:09 +0300 |
---|---|---|
committer | XhmikosR <xhmikosr@gmail.com> | 2019-01-05 19:23:42 +0300 |
commit | fc3b915a6973c9a4fa5d06bd4492f20398a26ef6 (patch) | |
tree | 92586a8467740826d64159532b6a61469962660b | |
parent | 8705c5a98d7ef7abf1cd2bbd239ad54e9773b0b3 (diff) |
Implement our Stylelint configs for css and scss.
-rw-r--r-- | README.md | 30 | ||||
-rw-r--r-- | css/index.js | 292 | ||||
-rw-r--r-- | package-lock.json | 169 | ||||
-rw-r--r-- | package.json | 39 | ||||
-rw-r--r-- | scss/index.js | 48 |
5 files changed, 577 insertions, 1 deletions
@@ -1,3 +1,31 @@ # stylelint-config-bootstrap -Stylelint config for Bootstrap +Default stylelint config used by Bootstrap. + +## Installation + +```bash +npm install stylelint-config-bootstrap --save-dev +# Or with yarn: +yarn add stylelint-config-bootstrap --dev +``` + +## Usage + +We provide a config for both CSS and SCSS. You can choose which one you would like to extend in your configuration: + +### CSS + +```json +{ + "extends": "stylelint-config-bootstrap/css" +} +``` + +### SCSS + +```json +{ + "extends": "stylelint-config-bootstrap/scss" +} +``` diff --git a/css/index.js b/css/index.js new file mode 100644 index 0000000..9f97b0d --- /dev/null +++ b/css/index.js @@ -0,0 +1,292 @@ +'use strict'; + +module.exports = { + 'extends': [ + 'stylelint-config-standard' + ], + 'plugins': [ + 'stylelint-order' + ], + 'rules': { + 'at-rule-empty-line-before': null, + 'at-rule-name-space-after': 'always', + 'at-rule-no-unknown': true, + 'at-rule-no-vendor-prefix': true, + 'at-rule-semicolon-space-before': 'never', + 'block-closing-brace-empty-line-before': null, + 'block-closing-brace-newline-after': null, + 'block-opening-brace-space-before': null, + 'color-named': 'never', + 'declaration-block-semicolon-newline-after': 'always-multi-line', + 'declaration-block-semicolon-newline-before': 'never-multi-line', + 'declaration-block-semicolon-space-after': 'always-single-line', + 'declaration-empty-line-before': null, + 'declaration-no-important': true, + 'font-family-name-quotes': 'always-where-recommended', + 'font-weight-notation': [ + 'numeric', + { + 'ignore': [ + 'relative' + ] + } + ], + 'function-url-no-scheme-relative': true, + 'function-url-quotes': 'always', + 'length-zero-no-unit': true, + 'max-empty-lines': 4, + 'max-line-length': null, + 'media-feature-name-no-unknown': [ + true, + { + 'ignoreMediaFeatureNames': [ + 'prefers-reduced-motion' + ] + } + ], + 'media-feature-name-no-vendor-prefix': true, + 'media-feature-parentheses-space-inside': 'never', + 'media-feature-range-operator-space-after': 'always', + 'media-feature-range-operator-space-before': 'never', + 'no-descending-specificity': null, + 'no-duplicate-selectors': true, + 'number-leading-zero': 'never', + 'order/properties-order': [ + 'position', + 'top', + 'right', + 'bottom', + 'left', + 'z-index', + 'box-sizing', + 'display', + 'flex', + 'flex-align', + 'flex-basis', + 'flex-direction', + 'flex-wrap', + 'flex-flow', + 'flex-shrink', + 'flex-grow', + 'flex-order', + 'flex-pack', + 'align-content', + 'align-items', + 'align-self', + 'justify-content', + 'order', + 'float', + 'width', + 'min-width', + 'max-width', + 'height', + 'min-height', + 'max-height', + 'padding', + 'padding-top', + 'padding-right', + 'padding-bottom', + 'padding-left', + 'margin', + 'margin-top', + 'margin-right', + 'margin-bottom', + 'margin-left', + 'overflow', + 'overflow-x', + 'overflow-y', + '-webkit-overflow-scrolling', + '-ms-overflow-x', + '-ms-overflow-y', + '-ms-overflow-style', + 'columns', + 'column-count', + 'column-fill', + 'column-gap', + 'column-rule', + 'column-rule-width', + 'column-rule-style', + 'column-rule-color', + 'column-span', + 'column-width', + 'orphans', + 'widows', + 'clip', + 'clear', + 'font', + 'font-family', + 'font-size', + 'font-style', + 'font-weight', + 'font-variant', + 'font-size-adjust', + 'font-stretch', + 'font-effect', + 'font-emphasize', + 'font-emphasize-position', + 'font-emphasize-style', + 'font-smooth', + 'src', + 'hyphens', + 'line-height', + 'color', + 'text-align', + 'text-align-last', + 'text-emphasis', + 'text-emphasis-color', + 'text-emphasis-style', + 'text-emphasis-position', + 'text-decoration', + 'text-indent', + 'text-justify', + 'text-outline', + '-ms-text-overflow', + 'text-overflow', + 'text-overflow-ellipsis', + 'text-overflow-mode', + 'text-shadow', + 'text-transform', + 'text-wrap', + '-webkit-text-size-adjust', + '-ms-text-size-adjust', + 'letter-spacing', + '-ms-word-break', + 'word-break', + 'word-spacing', + '-ms-word-wrap', + 'word-wrap', + 'overflow-wrap', + 'tab-size', + 'white-space', + 'vertical-align', + 'direction', + 'unicode-bidi', + 'list-style', + 'list-style-position', + 'list-style-type', + 'list-style-image', + 'pointer-events', + '-ms-touch-action', + 'touch-action', + 'cursor', + 'visibility', + 'zoom', + 'table-layout', + 'empty-cells', + 'caption-side', + 'border-spacing', + 'border-collapse', + 'content', + 'quotes', + 'counter-reset', + 'counter-increment', + 'resize', + 'user-select', + 'nav-index', + 'nav-up', + 'nav-right', + 'nav-down', + 'nav-left', + 'background', + 'background-color', + 'background-image', + 'filter', + 'background-repeat', + 'background-attachment', + 'background-position', + 'background-position-x', + 'background-position-y', + 'background-clip', + 'background-origin', + 'background-size', + 'border', + 'border-color', + 'border-style', + 'border-width', + 'border-top', + 'border-top-color', + 'border-top-style', + 'border-top-width', + 'border-right', + 'border-right-color', + 'border-right-style', + 'border-right-width', + 'border-bottom', + 'border-bottom-color', + 'border-bottom-style', + 'border-bottom-width', + 'border-left', + 'border-left-color', + 'border-left-style', + 'border-left-width', + 'border-radius', + 'border-top-left-radius', + 'border-top-right-radius', + 'border-bottom-right-radius', + 'border-bottom-left-radius', + 'border-image', + 'border-image-source', + 'border-image-slice', + 'border-image-width', + 'border-image-outset', + 'border-image-repeat', + 'outline', + 'outline-width', + 'outline-style', + 'outline-color', + 'outline-offset', + 'box-shadow', + 'opacity', + '-ms-interpolation-mode', + 'page-break-after', + 'page-break-before', + 'page-break-inside', + 'transition', + 'transition-delay', + 'transition-timing-function', + 'transition-duration', + 'transition-property', + 'transform', + 'transform-origin', + 'perspective', + 'appearance', + 'animation', + 'animation-name', + 'animation-duration', + 'animation-play-state', + 'animation-timing-function', + 'animation-delay', + 'animation-iteration-count', + 'animation-direction', + 'animation-fill-mode', + 'fill', + 'stroke' + ], + 'property-no-vendor-prefix': true, + 'rule-empty-line-before': null, + 'selector-attribute-quotes': 'always', + 'selector-class-pattern': '^[a-z][a-z0-9\\-]*[a-z0-9]$', + 'selector-list-comma-newline-after': 'always', + 'selector-list-comma-newline-before': 'never-multi-line', + 'selector-list-comma-space-after': 'always-single-line', + 'selector-list-comma-space-before': 'never-single-line', + 'selector-max-attribute': 2, + 'selector-max-class': 4, + 'selector-max-combinators': 4, + 'selector-max-compound-selectors': 4, + 'selector-max-empty-lines': 1, + 'selector-max-id': 0, + 'selector-max-specificity': null, + 'selector-max-type': 2, + 'selector-max-universal': 1, + 'selector-no-qualifying-type': true, + 'selector-no-vendor-prefix': true, + 'shorthand-property-no-redundant-values': true, + 'string-quotes': 'double', + 'value-keyword-case': 'lower', + 'value-list-comma-newline-after': 'never-multi-line', + 'value-list-comma-newline-before': 'never-multi-line', + 'value-list-comma-space-after': 'always', + 'value-no-vendor-prefix': true + } +}; diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..eb7012c --- /dev/null +++ b/package-lock.json @@ -0,0 +1,169 @@ +{ + "name": "stylelint-config-bootstrap", + "version": "0.0.0", + "lockfileVersion": 1, + "requires": true, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "requires": { + "color-convert": "^1.9.0" + } + }, + "chalk": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.1.tgz", + "integrity": "sha512-ObN6h1v2fTJSmUXoS3nMQ92LbDK9be4TV+6G+omQlGJFdcUX5heKi1LZ1YnRMIgwTLEj3E24bT6tYni50rlCfQ==", + "requires": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=" + }, + "cssesc": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-2.0.0.tgz", + "integrity": "sha512-MsCAG1z9lPdoO/IUMLSBWBSVxVtJ1395VGIQ+Fc2gNdkQ1hNDnQdw3YhA71WJCBW1vdwA0cAnk/DnW6bqoEUYg==" + }, + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=" + }, + "indexes-of": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", + "integrity": "sha1-8w9xbI4r00bHtn0985FVZqfAVgc=" + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==" + }, + "postcss": { + "version": "7.0.7", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-7.0.7.tgz", + "integrity": "sha512-HThWSJEPkupqew2fnuQMEI2YcTj/8gMV3n80cMdJsKxfIh5tHf7nM5JigNX6LxVMqo6zkgQNAI88hyFvBk41Pg==", + "requires": { + "chalk": "^2.4.1", + "source-map": "^0.6.1", + "supports-color": "^5.5.0" + } + }, + "postcss-media-query-parser": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/postcss-media-query-parser/-/postcss-media-query-parser-0.2.3.tgz", + "integrity": "sha1-J7Ocb02U+Bsac7j3Y1HGCeXO8kQ=" + }, + "postcss-resolve-nested-selector": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/postcss-resolve-nested-selector/-/postcss-resolve-nested-selector-0.1.1.tgz", + "integrity": "sha1-Kcy8fDfe36wwTp//C/FZaz9qDk4=" + }, + "postcss-selector-parser": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/postcss-selector-parser/-/postcss-selector-parser-5.0.0.tgz", + "integrity": "sha512-w+zLE5Jhg6Liz8+rQOWEAwtwkyqpfnmsinXjXg6cY7YIONZZtgvE0v2O0uhQBs0peNomOJwWRKt6JBfTdTd3OQ==", + "requires": { + "cssesc": "^2.0.0", + "indexes-of": "^1.0.1", + "uniq": "^1.0.1" + } + }, + "postcss-sorting": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/postcss-sorting/-/postcss-sorting-4.0.1.tgz", + "integrity": "sha512-YNRq7ChWFsLsns78zutLBWp6kvfZr/3YYf9q54P/fBpIHhf8gwbKvr5XHAt2l69SS08lfGtB8gG8m/62gsuTgw==", + "requires": { + "lodash": "^4.17.4", + "postcss": "^7.0.0" + } + }, + "postcss-value-parser": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/postcss-value-parser/-/postcss-value-parser-3.3.1.tgz", + "integrity": "sha512-pISE66AbVkp4fDQ7VHBwRNXzAAKJjw4Vw7nWI/+Q3vuly7SNfgYXvm6i5IgFylHGK5sP/xHAbB7N49OS4gWNyQ==" + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==" + }, + "stylelint-config-recommended": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended/-/stylelint-config-recommended-2.1.0.tgz", + "integrity": "sha512-ajMbivOD7JxdsnlS5945KYhvt7L/HwN6YeYF2BH6kE4UCLJR0YvXMf+2j7nQpJyYLZx9uZzU5G1ZOSBiWAc6yA==" + }, + "stylelint-config-recommended-scss": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/stylelint-config-recommended-scss/-/stylelint-config-recommended-scss-3.2.0.tgz", + "integrity": "sha512-M8BFHMRf8KNz5EQPKJd8nMCGmBd2o5coDEObfHVbEkyLDgjIf1V+U5dHjaGgvhm0zToUxshxN+Gc5wpbOOew4g==", + "requires": { + "stylelint-config-recommended": "^2.0.0" + } + }, + "stylelint-config-standard": { + "version": "18.2.0", + "resolved": "https://registry.npmjs.org/stylelint-config-standard/-/stylelint-config-standard-18.2.0.tgz", + "integrity": "sha512-07x0TaSIzvXlbOioUU4ORkCIM07kyIuojkbSVCyFWNVgXMXYHfhnQSCkqu+oHWJf3YADAnPGWzdJ53NxkoJ7RA==", + "requires": { + "stylelint-config-recommended": "^2.1.0" + } + }, + "stylelint-order": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/stylelint-order/-/stylelint-order-2.0.0.tgz", + "integrity": "sha512-rGmvP5zSCxvmBYP8DgzmdMhMMM+degsQCXrzYDmqPmeyU2bWmQTt2mH157Svj0WwHQn1LG9aQHdvKZfpfg2t4A==", + "requires": { + "lodash": "^4.17.10", + "postcss": "^7.0.2", + "postcss-sorting": "^4.0.1" + } + }, + "stylelint-scss": { + "version": "3.4.4", + "resolved": "https://registry.npmjs.org/stylelint-scss/-/stylelint-scss-3.4.4.tgz", + "integrity": "sha512-GquwsRegF2gsVRePaUN93cYf9aJDygr03X/QRiwk9O5lOe7QZHlM4Vzrb8JAu+pZ0xodPRpN6W259yA6ApM3WA==", + "requires": { + "lodash": "^4.17.11", + "postcss-media-query-parser": "^0.2.3", + "postcss-resolve-nested-selector": "^0.1.1", + "postcss-selector-parser": "^5.0.0", + "postcss-value-parser": "^3.3.1" + } + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "requires": { + "has-flag": "^3.0.0" + } + }, + "uniq": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", + "integrity": "sha1-sxxa6CVIRKOoKBVBzisEuGWnNP8=" + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000..cba2bea --- /dev/null +++ b/package.json @@ -0,0 +1,39 @@ +{ + "name": "stylelint-config-bootstrap", + "version": "0.0.0", + "description": "Default stylelint config used by Bootstrap.", + "main": "css/index.js", + "repository": { + "type": "git", + "url": "git+https://github.com/twbs/stylelint-config-bootstrap.git" + }, + "keywords": [ + "bootstrap", + "stylelint", + "config", + "lint" + ], + "author": "The Bootstrap Authors (https://github.com/twbs/stylelint-config-bootstrap/graphs/contributors)", + "license": "MIT", + "bugs": { + "url": "https://github.com/twbs/stylelint-config-bootstrap/issues" + }, + "homepage": "https://github.com/twbs/stylelint-config-bootstrap#readme", + "files": [ + "css/index.js", + "scss/index.js" + ], + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "stylelint": "^9.0.0" + }, + "dependencies": { + "stylelint-config-recommended-scss": "^3.2.0", + "stylelint-config-standard": "^18.2.0", + "stylelint-order": "^2.0.0", + "stylelint-scss": "^3.4.4" + }, + "devDependencies": {} +} diff --git a/scss/index.js b/scss/index.js new file mode 100644 index 0000000..0d62b9e --- /dev/null +++ b/scss/index.js @@ -0,0 +1,48 @@ +'use strict'; + +module.exports = { + 'extends': [ + 'stylelint-config-recommended-scss', + '../css' + ], + 'rules': { + 'at-rule-no-unknown': null, + 'property-blacklist': [ + 'border-radius', + 'border-top-left-radius', + 'border-top-right-radius', + 'border-bottom-right-radius', + 'border-bottom-left-radius', + 'transition' + ], + 'scss/at-function-named-arguments': 'never', + 'scss/at-function-parentheses-space-before': 'never', + 'scss/at-import-no-partial-leading-underscore': true, + 'scss/at-mixin-argumentless-call-parentheses': null, + 'scss/at-mixin-named-arguments': null, + 'scss/at-mixin-parentheses-space-before': 'never', + 'scss/at-rule-no-unknown': true, + 'scss/dollar-variable-colon-space-after': 'at-least-one-space', + 'scss/dollar-variable-colon-space-before': 'never', + 'scss/dollar-variable-default': [ + true, + { + 'ignore': 'local' + } + ], + 'scss/dollar-variable-no-missing-interpolation': true, + 'scss/media-feature-value-dollar-variable': null, + 'scss/no-duplicate-dollar-variables': [ + null, + { + 'ignoreInsideAtRules': [ + 'if', + 'mixin' + ] + } + ], + 'scss/operator-no-newline-after': true, + 'scss/operator-no-newline-before': true, + 'scss/operator-no-unspaced': true + } +}; |