+++ /dev/null
-{
- "extends": [
- "stylelint-config-twbs-bootstrap"
- ],
- "plugins": [
- "stylelint-order"
- ],
- "reportInvalidScopeDisables": true,
- "reportNeedlessDisables": true,
- "rules": {
- "selector-class-pattern": [
- "^([a-z][a-z0-9]*(-[a-z0-9]+)*:)?([a-z][a-z0-9]*)(-[a-z0-9]+)*$",
- { "message": "Expected class selector \"%s\" to be kebab-case (with optional breakpoint prefix)" }
- ],
- "order/order": [
- [
- { "type": "at-rule", "name": "use" },
- { "type": "at-rule", "name": "forward" },
- "dollar-variables",
- "custom-properties",
- "declarations",
- "rules"
- ]
- ]
- },
- "overrides": [
- {
- "files": "**/*.scss",
- "rules": {
- "declaration-property-value-disallowed-list": {
- "border": "none",
- "outline": "none"
- },
- "function-disallowed-list": [
- "lighten",
- "darken"
- ],
- "property-disallowed-list": [
- "border-radius",
- "border-top-left-radius",
- "border-top-right-radius",
- "border-bottom-right-radius",
- "border-bottom-left-radius",
- "transition"
- ],
- "scss/dollar-variable-default": [
- true,
- {
- "ignore": "local"
- }
- ],
- "scss/selector-no-union-class-name": true
- }
- },
- {
- "files": "scss/**/*.{test,spec}.scss",
- "rules": {
- "scss/dollar-variable-default": null,
- "declaration-no-important": null
- }
- },
- {
- "files": "site/**/*.scss",
- "rules": {
- "scss/dollar-variable-default": null
- }
- },
- {
- "files": "site/**/examples/**/*.css",
- "rules": {
- "comment-empty-line-before": null,
- "property-no-vendor-prefix": null,
- "selector-no-qualifying-type": null,
- "value-no-vendor-prefix": null
- }
- }
- ]
-}
```sh
mkdir {css,scss}
-touch index.html scss/styles.scss postcss.config.js .stylelintrc.json
+touch index.html scss/styles.scss postcss.config.js stylelint.config.mjs
```
When you’re done, your project should look like this:
├── css/
├── scss/
│ └── styles.scss
-├── .stylelintrc.json
+├── stylelint.config.mjs
├── index.html
├── package-lock.json
├── package.json
}
```
-4. **Configure `.stylelintrc.json`.** We’re using `stylelint-config-twbs-bootstrap` to keep our Sass linting consistent with Bootstrap’s own code style.
+4. **Configure `stylelint.config.mjs`.** We’re using `stylelint-config-twbs-bootstrap` to keep our Sass linting consistent with Bootstrap’s own code style.
- ```json
- {
- "extends": "stylelint-config-twbs-bootstrap"
+ ```js
+ /** @type {import('stylelint').Config} */
+ export default {
+ extends: 'stylelint-config-twbs-bootstrap',
}
```
--- /dev/null
+/** @type {import('stylelint').Config} */
+export default {
+ extends: [
+ 'stylelint-config-twbs-bootstrap'
+ ],
+ plugins: [
+ 'stylelint-order'
+ ],
+ reportInvalidScopeDisables: true,
+ reportNeedlessDisables: true,
+ rules: {
+ 'selector-class-pattern': [
+ '^([a-z][a-z0-9]*(-[a-z0-9]+)*:)?([a-z][a-z0-9]*)(-[a-z0-9]+)*$',
+ { message: 'Expected class selector "%s" to be kebab-case (with optional breakpoint prefix)' }
+ ],
+ 'order/order': [
+ [
+ { type: 'at-rule', name: 'use' },
+ { type: 'at-rule', name: 'forward' },
+ 'dollar-variables',
+ 'custom-properties',
+ 'declarations',
+ 'rules'
+ ]
+ ]
+ },
+ overrides: [
+ {
+ files: '**/*.scss',
+ rules: {
+ 'declaration-property-value-disallowed-list': {
+ border: 'none',
+ outline: 'none'
+ },
+ 'function-disallowed-list': [
+ 'lighten',
+ 'darken'
+ ],
+ 'property-disallowed-list': [
+ 'border-radius',
+ 'border-top-left-radius',
+ 'border-top-right-radius',
+ 'border-bottom-right-radius',
+ 'border-bottom-left-radius',
+ 'transition'
+ ],
+ 'scss/dollar-variable-default': [
+ true,
+ {
+ ignore: 'local'
+ }
+ ],
+ 'scss/selector-no-union-class-name': true
+ }
+ },
+ {
+ files: 'scss/**/*.{test,spec}.scss',
+ rules: {
+ 'scss/dollar-variable-default': null,
+ 'declaration-no-important': null
+ }
+ },
+ {
+ files: 'site/**/*.scss',
+ rules: {
+ 'scss/dollar-variable-default': null
+ }
+ },
+ {
+ files: 'site/**/examples/**/*.css',
+ rules: {
+ 'comment-empty-line-before': null,
+ 'property-no-vendor-prefix': null,
+ 'selector-no-qualifying-type': null,
+ 'value-no-vendor-prefix': null
+ }
+ }
+ ]
+}