Skip to content

Commit 31ad68c

Browse files
committed
Fix(stylelint-config): Remove blockless includes order due to collision with Sass
Prior to this change, the Sass engine would emit deprecation warnings on the code ordered according to our rules. The warnings can be suppressed for now using the `--silence-deprecation` flag, but that would stop working with a next major release of Sass.
1 parent d60a333 commit 31ad68c

File tree

2 files changed

+7
-9
lines changed

2 files changed

+7
-9
lines changed

packages/stylelint-config/README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ Configuration extends community maintained config [stylelint-config-standard-scs
2323

2424
This config:
2525

26-
- Extends the [`stylelint-config-recommended` shared config](https://github.com/stylelint/stylelint-config-recommended) and configures its rules for SCSS;
26+
- extends the [`stylelint-config-recommended` shared config](https://github.com/stylelint/stylelint-config-recommended) and configures its rules for SCSS;
2727
- extends the [`stylelint-config-recommended-scss` shared config](https://github.com/stylelint-scss/stylelint-config-recommended-scss) and configures its rules for SCSS;
2828
- extends the [`stylelint-config-standard` shared config](https://github.com/stylelint/stylelint-config-standard) and configures its rules.
2929

@@ -77,13 +77,16 @@ The `order` config enforces a consistent order of content in your declaration bl
7777
1. Sass variables,
7878
2. CSS custom properties,
7979
3. Sass `@extend`,
80-
4. single-line Sass `@include`,
81-
5. declarations,
82-
6. nested rules,
80+
4. declarations,
81+
5. nested rules.
8382

8483
For better flexibility, block at-rules (like `@media`, `@supports`, and also Sass `@if`, `@each`, etc.) can be placed
8584
anywhere in the declaration block.
8685

86+
> [!NOTE]
87+
> Note that this config does not prescribe placement of blockless Sass `@include` at-rule. However, the Sass engine
88+
> may push you to place them at the end of the declaration block due to compatibility with CSS nesting.
89+
8790
Besides, properties in the declarations must be ordered by following categories:
8891

8992
1. `all` properties,

packages/stylelint-config/rules/order.js

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,6 @@ export default {
88
name: 'extend',
99
type: 'at-rule',
1010
},
11-
{
12-
hasBlock: false,
13-
name: 'include',
14-
type: 'at-rule',
15-
},
1611
'declarations',
1712
'rules',
1813
],

0 commit comments

Comments
 (0)