Skip to content

Commit c0c5591

Browse files
authored
Merge branch 'main' into feature/declaration-block-nesting-at-rule-required-list
2 parents 5dca318 + b17f5a4 commit c0c5591

File tree

12 files changed

+413
-239
lines changed

12 files changed

+413
-239
lines changed

.changeset/clear-suns-trade.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"stylelint": patch
3+
---
4+
5+
Fixed: `property-no-deprecated` erroneously autofixing `clip`

.changeset/easy-oranges-punch.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"stylelint": patch
3+
---
4+
5+
Fixed: `selector-pseudo-class-no-unknown` false positives for `:unchecked`

.changeset/modern-days-try.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"stylelint": patch
3+
---
4+
5+
Fixed: `property-no-deprecated` false positives for `-webkit-box-orient: vertical;`

lib/reference/selectors.cjs

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/reference/selectors.mjs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -439,6 +439,7 @@ export const pseudoClasses = uniteSets(
439439
'scope',
440440
'state',
441441
'target',
442+
'unchecked',
442443
'unresolved',
443444
'user-invalid',
444445
'user-valid',

lib/rules/property-no-deprecated/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ The following patterns are _not_ considered problems:
4949

5050
<!-- prettier-ignore -->
5151
```css
52-
a { clip-path: rect(0, 0, 0, 0); }
52+
a { clip-path: rect(0 0 0 0); }
5353
```
5454

5555
<!-- prettier-ignore -->

lib/rules/property-no-deprecated/__tests__/index.mjs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -11,32 +11,32 @@ testRule({
1111

1212
accept: [
1313
{
14-
code: 'a { clip-path: rect(0, 0, 0, 0); }',
14+
code: 'a { clip-path: rect(0 0 0 0); }',
15+
},
16+
{
17+
code: stripIndent`
18+
display: -webkit-box;
19+
-webkit-box-orient: vertical;
20+
-webkit-line-clamp: 2;
21+
`,
22+
description: 'Accept `-webkit-box-orient` if its value is `vertical`',
1523
},
1624
],
1725

1826
reject: [
1927
{
2028
code: 'a { clip: rect(0, 0, 0, 0); }',
21-
fixed: 'a { clip-path: rect(0, 0, 0, 0); }',
22-
fix: {
23-
range: [7, 8],
24-
text: 'p-path',
25-
},
26-
message: messages.expected('clip', 'clip-path'),
29+
unfixable: true,
30+
message: messages.rejected('clip'),
2731
column: 5,
2832
endColumn: 9,
2933
line: 1,
3034
endLine: 1,
3135
},
3236
{
3337
code: 'a { /* comment */ clip: rect(0, 0, 0, 0); }',
34-
fixed: 'a { /* comment */ clip-path: rect(0, 0, 0, 0); }',
35-
fix: {
36-
range: [21, 22],
37-
text: 'p-path',
38-
},
39-
message: messages.expected('clip', 'clip-path'),
38+
unfixable: true,
39+
message: messages.rejected('clip'),
4040
column: 19,
4141
endColumn: 23,
4242
line: 1,

lib/rules/property-no-deprecated/index.cjs

Lines changed: 5 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

lib/rules/property-no-deprecated/index.mjs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const DEPRECATED_PROPS_REMAP = {
4747
'-webkit-box-flex': 'flex-grow',
4848
'-webkit-box-lines': null,
4949
'-webkit-box-ordinal-group': 'order',
50-
'-webkit-box-orient': null,
50+
'-webkit-box-orient': null, // Allowed when the value is `vertical`
5151
'-webkit-box-pack': null,
5252
'-webkit-user-modify': null,
5353
'grid-column-gap': 'column-gap',
@@ -70,7 +70,7 @@ const DEPRECATED_PROPS_REMAP = {
7070
'scroll-snap-type-x': null,
7171
'scroll-snap-type-y': null,
7272
'word-wrap': 'overflow-wrap',
73-
clip: 'clip-path',
73+
clip: null,
7474
};
7575

7676
/** @type {import('stylelint').CoreRules[ruleName]} */
@@ -94,7 +94,7 @@ const rule = (primary, secondaryOptions) => {
9494
root.walkDecls((decl) => {
9595
if (!isStandardSyntaxDeclaration(decl)) return;
9696

97-
const { prop } = decl;
97+
const { prop, value } = decl;
9898

9999
if (optionsMatches(secondaryOptions, 'ignoreProperties', prop)) return;
100100

@@ -103,6 +103,8 @@ const rule = (primary, secondaryOptions) => {
103103

104104
if (typeof mappedProp === 'undefined') return;
105105

106+
if (normalizedProp === '-webkit-box-orient' && value.toLowerCase() === 'vertical') return;
107+
106108
let fix;
107109
let message;
108110
let messageArgs = [];

lib/rules/selector-pseudo-class-no-unknown/__tests__/index.mjs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,9 @@ testRule({
150150
{
151151
code: ':seeking, :stalled, :buffering, :volume-locked, :muted {}',
152152
},
153+
{
154+
code: ':checked, :unchecked, :indeterminate {}',
155+
},
153156
{
154157
code: 'meter:low-value {}',
155158
},

0 commit comments

Comments
 (0)