Skip to content

Commit 62cb934

Browse files
authored
update stylelint plugins (#1460)
1 parent 590bb2d commit 62cb934

File tree

8 files changed

+74
-144
lines changed

8 files changed

+74
-144
lines changed

package-lock.json

+44-122
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

plugins-stylelint/at-risk/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
### Unreleased (patch)
4+
5+
- Remove incorrect `fixable` annotation in `rule.meta`
6+
37
### 2.0.0
48

59
_August 3, 2024_

plugins-stylelint/at-risk/index.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@ const atRiskProperties = {
2626

2727
const meta = {
2828
url: 'https://github.com/csstools/postcss-plugins/blob/main/plugins-stylelint/at-risk',
29-
fixable: true,
3029
};
3130

3231
const ruleFunction = (primaryOption) => {

plugins-stylelint/no-at-nest-rule/CHANGELOG.md

+5
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
### Unreleased (major)
4+
5+
- Updated: minimum Stylelint version to `v16.8.2`
6+
- Updated: use the new `report.fix` API
7+
38
### 3.0.0
49

510
_August 3, 2024_

plugins-stylelint/no-at-nest-rule/index.mjs

+15-18
Original file line numberDiff line numberDiff line change
@@ -13,35 +13,32 @@ const meta = {
1313
fixable: true,
1414
};
1515

16-
const ruleFunction = (primaryOption, secondaryOptionObject, context) => {
16+
const ruleFunction = (primaryOption) => {
1717
return (postcssRoot, postcssResult) => {
1818
if (!primaryOption) {
1919
return;
2020
}
2121

22-
postcssRoot.walkAtRules(/^nest$/i, (atrule) => {
23-
if (context.fix) {
24-
const rule = postcss.rule({
25-
selector: atrule.params,
26-
source: atrule.source,
27-
});
28-
29-
atrule.nodes.forEach((node) => {
30-
rule.append(node);
31-
});
32-
33-
atrule.replaceWith(rule);
34-
35-
return;
36-
}
37-
22+
postcssRoot.walkAtRules(/^nest$/i, (atRule) => {
3823
stylelint.utils.report({
3924
message: messages.rejected(),
40-
node: atrule,
25+
node: atRule,
4126
index: 0,
4227
endIndex: 5,
4328
result: postcssResult,
4429
ruleName,
30+
fix: () => {
31+
const rule = postcss.rule({
32+
selector: atRule.params,
33+
source: atRule.source,
34+
});
35+
36+
atRule.nodes.forEach((node) => {
37+
rule.append(node);
38+
});
39+
40+
atRule.replaceWith(rule);
41+
},
4542
});
4643
});
4744
};

plugins-stylelint/no-at-nest-rule/package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,12 @@
3636
],
3737
"peerDependencies": {
3838
"postcss": "^8.4",
39-
"stylelint": "^16.8.0"
39+
"stylelint": "^16.8.2"
4040
},
4141
"devDependencies": {
4242
"@csstools/pack-test": "^1.0.1",
4343
"postcss": "^8.4",
44-
"stylelint": "^16.8.0",
44+
"stylelint": "^16.8.2",
4545
"stylelint-test-rule-node": "^0.3.0"
4646
},
4747
"scripts": {

plugins-stylelint/no-invalid-at-import-rules-when-bundling/CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
### Unreleased (patch)
4+
5+
- Remove incorrect `fixable` annotation in `rule.meta`
6+
37
### 3.0.0
48

59
_August 3, 2024_

plugins-stylelint/no-invalid-at-import-rules-when-bundling/index.mjs

-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ const ruleName = '@csstools/stylelint-no-invalid-at-import-rules-when-bundling';
55

66
const meta = {
77
url: 'https://github.com/csstools/postcss-plugins/blob/main/plugins-stylelint/no-invalid-at-import-rules-when-bundling',
8-
fixable: true,
98
};
109

1110
const ruleFunction = (primaryOption) => {

0 commit comments

Comments
 (0)