Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
78 changes: 0 additions & 78 deletions .stylelintrc.json

This file was deleted.

13 changes: 7 additions & 6 deletions site/src/content/docs/guides/npm.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ We’ve already created the `my-project` folder and initialized npm. Now we’ll

```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:
Expand All @@ -64,7 +64,7 @@ my-project/
├── css/
├── scss/
│ └── styles.scss
├── .stylelintrc.json
├── stylelint.config.mjs
├── index.html
├── package-lock.json
├── package.json
Expand Down Expand Up @@ -132,11 +132,12 @@ With dependencies installed and our project folder ready for us to start coding,
}
```

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',
}
```

Expand Down
79 changes: 79 additions & 0 deletions stylelint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
/** @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,
},
},
],
}
Loading