Skip to content

Commit 83cfd65

Browse files
authored
Fix property-no-unknown false positives for corner-shape (#9099)
1 parent 893b26b commit 83cfd65

8 files changed

Lines changed: 369 additions & 50 deletions

File tree

.changeset/quick-chefs-hunt.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-unknown` false positives for `corner-shape`

lib/reference/properties.mjs

Lines changed: 335 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -802,3 +802,338 @@ export const marginContextProperties = new Set([
802802
'max-width',
803803
'z-index',
804804
]);
805+
806+
// Known from before migrating to CSSTree
807+
// @see https://github.com/stylelint/stylelint/issues/9065
808+
/** @type {ReadonlySet<string>} */
809+
export const previouslyKnownProperties = new Set([
810+
'accelerator',
811+
'additive-symbols',
812+
'alt',
813+
'animation-trigger-behavior',
814+
'animation-trigger-exit-range',
815+
'animation-trigger-exit-range-end',
816+
'animation-trigger-exit-range-start',
817+
'animation-trigger-range',
818+
'animation-trigger-range-end',
819+
'animation-trigger-range-start',
820+
'animation-trigger-timeline',
821+
'app-region',
822+
'ascent-override',
823+
'audio-level',
824+
'base-palette',
825+
'buffered-rendering',
826+
'chains',
827+
'color-profile',
828+
'color-rendering',
829+
'column-progression',
830+
'column-rule-outset',
831+
'descent-override',
832+
'display-align',
833+
'elevation',
834+
'enable-background',
835+
'epub-caption-side',
836+
'epub-hyphens',
837+
'epub-text-combine',
838+
'epub-text-emphasis',
839+
'epub-text-emphasis-color',
840+
'epub-text-emphasis-style',
841+
'epub-text-orientation',
842+
'epub-text-transform',
843+
'epub-word-break',
844+
'epub-writing-mode',
845+
'fallback',
846+
'flow',
847+
'font-display',
848+
'inherits',
849+
'initial-value',
850+
'input-format',
851+
'inset-area',
852+
'item-slack',
853+
'layout-flow',
854+
'layout-grid',
855+
'layout-grid-char',
856+
'layout-grid-line',
857+
'layout-grid-mode',
858+
'layout-grid-type',
859+
'line-gap-override',
860+
'line-increment',
861+
'marker-knockout-left',
862+
'marker-knockout-right',
863+
'marker-offset',
864+
'marker-pattern',
865+
'marker-segment',
866+
'marks',
867+
'mask-position-x',
868+
'mask-position-y',
869+
'mask-source-type',
870+
'max-zoom',
871+
'min-zoom',
872+
'motion',
873+
'motion-offset',
874+
'motion-path',
875+
'motion-rotation',
876+
'nav-down',
877+
'nav-index',
878+
'nav-left',
879+
'nav-right',
880+
'nav-up',
881+
'navigation',
882+
'negative',
883+
'offset-block-end',
884+
'offset-block-start',
885+
'offset-inline-end',
886+
'offset-inline-start',
887+
'offset-rotation',
888+
'orientation',
889+
'override-colors',
890+
'pad',
891+
'page-orientation',
892+
'pen-action',
893+
'perspective-origin-x',
894+
'perspective-origin-y',
895+
'pitch',
896+
'pitch-range',
897+
'play-during',
898+
'position-try-options',
899+
'prefix',
900+
'property-name',
901+
'range',
902+
'richness',
903+
'row-rule-outset',
904+
'rule-outset',
905+
'rule-paint-order',
906+
'running',
907+
'scroll-snap-margin',
908+
'scroll-snap-margin-bottom',
909+
'scroll-snap-margin-left',
910+
'scroll-snap-margin-right',
911+
'scroll-snap-margin-top',
912+
'scroll-start-target',
913+
'scrollbar-arrow-color',
914+
'scrollbar-base-color',
915+
'scrollbar-dark-shadow-color',
916+
'scrollbar-darkshadow-color',
917+
'scrollbar-face-color',
918+
'scrollbar-highlight-color',
919+
'scrollbar-shadow-color',
920+
'scrollbar-track-color',
921+
'scrollbar3d-light-color',
922+
'scrollbar3dlight-color',
923+
'size',
924+
'size-adjust',
925+
'snap-height',
926+
'solid-color',
927+
'solid-opacity',
928+
'speak-header',
929+
'speak-numeral',
930+
'speak-punctuation',
931+
'speech-rate',
932+
'stress',
933+
'suffix',
934+
'supported-color-schemes',
935+
'symbols',
936+
'syntax',
937+
'system',
938+
'text-decoration-blink',
939+
'text-decoration-line-through',
940+
'text-decoration-none',
941+
'text-decoration-overline',
942+
'text-decoration-skip-inset',
943+
'text-decoration-trim',
944+
'text-decoration-underline',
945+
'text-justify-trim',
946+
'text-kashida',
947+
'text-kashida-space',
948+
'text-line-through',
949+
'text-line-through-color',
950+
'text-line-through-mode',
951+
'text-line-through-style',
952+
'text-line-through-width',
953+
'text-overline',
954+
'text-overline-color',
955+
'text-overline-mode',
956+
'text-overline-style',
957+
'text-overline-width',
958+
'text-underline',
959+
'text-underline-color',
960+
'text-underline-mode',
961+
'text-underline-style',
962+
'text-underline-width',
963+
'touch-action-delay',
964+
'transform-origin-x',
965+
'transform-origin-y',
966+
'transform-origin-z',
967+
'types',
968+
'uc-alt-skin',
969+
'uc-skin',
970+
'user-zoom',
971+
'viewport-fill',
972+
'viewport-fill-opacity',
973+
'viewport-fit',
974+
'volume',
975+
]);
976+
977+
// Known from before migrating to CSSTree
978+
// @see https://github.com/stylelint/stylelint/issues/9065
979+
/** @type {ReadonlySet<string>} */
980+
export const previouslyKnownPrefixedProperties = new Set([
981+
'-epub-text-combine',
982+
'-internal-text-autosizing-status',
983+
'-wap-accesskey',
984+
'-webkit-alt',
985+
'-webkit-app-region',
986+
'-webkit-background-composite',
987+
'-moz-background-inline-policy',
988+
'-khtml-binding',
989+
'-webkit-border-after-color',
990+
'-webkit-border-after-style',
991+
'-webkit-border-after',
992+
'-webkit-border-after-width',
993+
'-moz-border-end-color',
994+
'-webkit-border-end-color',
995+
'-moz-border-end',
996+
'-moz-border-end-style',
997+
'-webkit-border-end-style',
998+
'-webkit-border-end',
999+
'-moz-border-end-width',
1000+
'-webkit-border-end-width',
1001+
'-webkit-border-fit',
1002+
'-khtml-border-horizontal-spacing',
1003+
'-webkit-border-horizontal-spacing',
1004+
'-moz-border-start-color',
1005+
'-webkit-border-start-color',
1006+
'-moz-border-start',
1007+
'-moz-border-start-style',
1008+
'-webkit-border-start-style',
1009+
'-webkit-border-start',
1010+
'-moz-border-start-width',
1011+
'-webkit-border-start-width',
1012+
'-khtml-border-vertical-spacing',
1013+
'-webkit-border-vertical-spacing',
1014+
'-khtml-box-flex-group-transition',
1015+
'-webkit-color-correction',
1016+
'-apple-color-filter',
1017+
'-webkit-column-axis',
1018+
'-webkit-column-progression',
1019+
'-webkit-composition-fill-color',
1020+
'-webkit-composition-frame-color',
1021+
'-webkit-cursor-visibility',
1022+
'-apple-dashboard-region',
1023+
'-khtml-dashboard-region',
1024+
'-webkit-dashboard-region',
1025+
'-webkit-flex-align',
1026+
'-webkit-flex-item-align',
1027+
'-webkit-flex-line-pack',
1028+
'-webkit-flex-order',
1029+
'-webkit-flex-pack',
1030+
'-khtml-flow-mode',
1031+
'-konq-flow-mode',
1032+
'-khtml-font-size-delta',
1033+
'-webkit-font-size-delta',
1034+
'-webkit-grid-after',
1035+
'-webkit-grid-before',
1036+
'-ms-grid-column-span',
1037+
'-webkit-grid-columns',
1038+
'-webkit-grid-end',
1039+
'-ms-grid-row-span',
1040+
'-webkit-grid-rows',
1041+
'-webkit-grid-start',
1042+
'-webkit-highlight',
1043+
'-khtml-horizontal-border-spacing',
1044+
'-webkit-hyphenate-limit-after',
1045+
'-webkit-hyphenate-limit-before',
1046+
'-wap-input-format',
1047+
'-wap-input-required',
1048+
'-konq-js-clip',
1049+
'-webkit-line-align',
1050+
'-webkit-line-box-contain',
1051+
'-webkit-line-grid-snap',
1052+
'-o-link',
1053+
'-o-link-source',
1054+
'-webkit-locale',
1055+
'-webkit-logical-height',
1056+
'-webkit-logical-width',
1057+
'-webkit-margin-after-collapse',
1058+
'-webkit-margin-after',
1059+
'-webkit-margin-before-collapse',
1060+
'-webkit-margin-before',
1061+
'-khtml-margin-bottom-collapse',
1062+
'-webkit-margin-bottom-collapse',
1063+
'-khtml-margin-collapse',
1064+
'-webkit-margin-collapse',
1065+
'-moz-margin-end',
1066+
'-webkit-margin-end',
1067+
'-khtml-margin-start',
1068+
'-moz-margin-start',
1069+
'-webkit-margin-start',
1070+
'-khtml-margin-top-collapse',
1071+
'-webkit-margin-top-collapse',
1072+
'-wap-marquee-dir',
1073+
'-khtml-marquee-direction',
1074+
'-webkit-marquee-direction',
1075+
'-khtml-marquee-increment',
1076+
'-webkit-marquee-increment',
1077+
'-khtml-marquee',
1078+
'-wap-marquee-loop',
1079+
'-khtml-marquee-repetition',
1080+
'-webkit-marquee-repetition',
1081+
'-khtml-marquee-speed',
1082+
'-wap-marquee-speed',
1083+
'-webkit-marquee-speed',
1084+
'-khtml-marquee-style',
1085+
'-wap-marquee-style',
1086+
'-webkit-marquee-style',
1087+
'-webkit-marquee',
1088+
'-webkit-mask-box-image-outset',
1089+
'-webkit-mask-box-image-repeat',
1090+
'-webkit-mask-box-image-slice',
1091+
'-webkit-mask-box-image-source',
1092+
'-webkit-mask-box-image-width',
1093+
'-webkit-mask-source-type',
1094+
'-khtml-match-nearest-mail-blockquote-color',
1095+
'-webkit-match-nearest-mail-blockquote-color',
1096+
'-webkit-max-logical-height',
1097+
'-webkit-max-logical-width',
1098+
'-webkit-min-logical-height',
1099+
'-webkit-min-logical-width',
1100+
'-khtml-nbsp-mode',
1101+
'-webkit-nbsp-mode',
1102+
'-webkit-padding-after',
1103+
'-webkit-padding-before',
1104+
'-moz-padding-end',
1105+
'-webkit-padding-end',
1106+
'-khtml-padding-start',
1107+
'-moz-padding-start',
1108+
'-webkit-padding-start',
1109+
'-apple-pay-button-style',
1110+
'-apple-pay-button-type',
1111+
'-webkit-perspective-origin-x',
1112+
'-webkit-perspective-origin-y',
1113+
'-webkit-region-break-after',
1114+
'-webkit-region-break-before',
1115+
'-webkit-region-break-inside',
1116+
'-webkit-region-overflow',
1117+
'-khtml-rtl-ordering',
1118+
'-webkit-rtl-ordering',
1119+
'-webkit-svg-shadow',
1120+
'-o-table-baseline',
1121+
'-ms-text-combine-horizontal',
1122+
'-webkit-text-combine',
1123+
'-khtml-text-decorations-in-effect',
1124+
'-webkit-text-decorations-in-effect',
1125+
'-webkit-text-zoom',
1126+
'-apple-trailing-word',
1127+
'-webkit-transform-origin-x',
1128+
'-webkit-transform-origin-y',
1129+
'-webkit-transform-origin-z',
1130+
'-khtml-user-drag',
1131+
'-khtml-user-modify',
1132+
'-khtml-vertical-border-spacing',
1133+
'-webkit-widget-region',
1134+
'-webkit-wrap-margin',
1135+
'-webkit-wrap-padding',
1136+
'-webkit-wrap-shape-inside',
1137+
'-webkit-wrap-shape-outside',
1138+
'-webkit-wrap',
1139+
]);

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

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -9,16 +9,14 @@ a { height: 100%; }
99
* This property */
1010
```
1111

12-
This rule considers properties defined in the [CSS Specifications and browser specific properties](https://github.com/betit/known-css-properties#source) to be known.
12+
This rule considers at-rules defined in the CSS Specifications, up to and including Editor's Drafts, to be known.
1313

14-
This rule ignores:
15-
16-
- variables (`$sass`, `@less`, `--custom-property`)
17-
- vendor-prefixed properties (e.g., `-moz-align-self`, `-webkit-align-self`)
14+
You can filter the [CSSTree Syntax Reference](https://csstree.github.io/docs/syntax/) to find out what properties are known, and use the [`languageOptions`](../../../docs/user-guide/configure.md#languageoptions) configuration property to extend it.
1815

19-
Use option `checkPrefixed` described below to turn on checking of vendor-prefixed properties.
16+
This rule ignores:
2017

21-
For customizing syntax, see the [`languageOptions`](../../../docs/user-guide/configure.md#languageoptions) section.
18+
- variables, e.g., `$sass`, `@less`, `--custom-property`
19+
- vendor-prefixed properties, e.g., `-moz-overflow-scrolling` (unless `checkPrefixed` is set to `true`)
2220

2321
## Options
2422

@@ -195,22 +193,8 @@ a {
195193
}
196194
```
197195

198-
<!-- prettier-ignore -->
199-
```css
200-
a {
201-
-moz-box-flex: 0;
202-
}
203-
```
204-
205196
The following patterns are considered problems:
206197

207-
<!-- prettier-ignore -->
208-
```css
209-
a {
210-
-moz-align-self: center;
211-
}
212-
```
213-
214198
<!-- prettier-ignore -->
215199
```css
216200
a {

0 commit comments

Comments
 (0)