@primer/stylelint-config 12.7.1-rc.d8a889b → 12.7.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/stylelint-config",
3
- "version": "12.7.1-rc.d8a889b",
3
+ "version": "12.7.1",
4
4
  "description": "Sharable stylelint config used by GitHub's CSS",
5
5
  "homepage": "http://primer.style/css/tools/linting",
6
6
  "author": "GitHub, Inc.",
@@ -42,7 +42,7 @@
42
42
  "@changesets/cli": "2.26.1",
43
43
  "@github/prettier-config": "0.0.4",
44
44
  "@primer/css": "^20.0.0",
45
- "@primer/primitives": "^7.8.3",
45
+ "@primer/primitives": "^7.11.11",
46
46
  "dedent": "0.7.0",
47
47
  "eslint": "8.39.0",
48
48
  "eslint-plugin-github": "4.3.5",
@@ -31,9 +31,11 @@ module.exports = createVariableRule(
31
31
  '$border-*',
32
32
  'transparent',
33
33
  'currentColor',
34
- // Match variables in any of the following formats: --color-border-*, --color-*-border-*, --color-*-border
34
+ // Match variables in any of the following formats: --color-border-*, --color-*-border-*, --color-*-border, --borderColor-, *borderColor*
35
35
  /var\(--color-(.+-)*border(-.+)*\)/,
36
- /var\(--color-[^)]+\)/
36
+ /var\(--color-[^)]+\)/,
37
+ /var\(--borderColor-[^)]+\)/,
38
+ /var\((.+-)*borderColor(-.+)*\)/
37
39
  ],
38
40
  replacements: {
39
41
  '$border-gray': '$border-color'
@@ -10,8 +10,10 @@ module.exports = createVariableRule(
10
10
  '$box-shadow*',
11
11
  '$*-shadow',
12
12
  'none',
13
- // Match variables in any of the following formats: --color-shadow-*, --color-*-shadow-*, --color-*-shadow
14
- /var\(--color-(.+-)*shadow(-.+)*\)/
13
+ // Match variables in any of the following formats: --color-shadow-*, --color-*-shadow-*, --color-*-shadow, --shadow-*, *shadow*
14
+ /var\(--color-(.+-)*shadow(-.+)*\)/,
15
+ /var\(--shadow(-.+)*\)/,
16
+ /var\((.+-)*shadow(-.+)*\)/
15
17
  ],
16
18
  singular: true
17
19
  }
package/plugins/colors.js CHANGED
@@ -3,9 +3,13 @@ const {createVariableRule} = require('./lib/variable-rules')
3
3
  const bgVars = [
4
4
  '$bg-*',
5
5
  '$tooltip-background-color',
6
- // Match variables in any of the following formats: --color-bg-*, --color-*-bg-*, --color-*-bg
6
+ // Match variables in any of the following formats: --color-bg-*, --color-*-bg-*, --color-*-bg, *bgColor*, *fgColor*, *borderColor*, *iconColor*
7
7
  /var\(--color-(.+-)*bg(-.+)*\)/,
8
- /var\(--color-[^)]+\)/
8
+ /var\(--color-[^)]+\)/,
9
+ /var\((.+-)*bgColor(-.+)*\)/,
10
+ /var\((.+-)*fgColor(-.+)*\)/,
11
+ /var\((.+-)*borderColor(-.+)*\)/,
12
+ /var\((.+-)*iconColor(-.+)*\)/
9
13
  ]
10
14
 
11
15
  module.exports = createVariableRule(
@@ -26,10 +30,12 @@ module.exports = createVariableRule(
26
30
  '$text-*',
27
31
  '$tooltip-text-color',
28
32
  'inherit',
29
- // Match variables in any of the following formats: --color-text-*, --color-*-text-*, --color-*-text
33
+ // Match variables in any of the following formats: --color-text-*, --color-*-text-*, --color-*-text, *fgColor*, *iconColor*
30
34
  /var\(--color-(.+-)*text(-.+)*\)/,
31
35
  /var\(--color-(.+-)*fg(-.+)*\)/,
32
- /var\(--color-[^)]+\)/
36
+ /var\(--color-[^)]+\)/,
37
+ /var\((.+-)*fgColor(-.+)*\)/,
38
+ /var\((.+-)*iconColor(-.+)*\)/
33
39
  ]
34
40
  }
35
41
  },
@@ -219,7 +219,7 @@
219
219
  ],
220
220
  "--color-header-divider": [
221
221
  {
222
- "props": ["border", "background"],
222
+ "props": ["border", "background", "color"],
223
223
  "replacement": "--header-borderColor-divider"
224
224
  }
225
225
  ],
@@ -231,7 +231,7 @@
231
231
  ],
232
232
  "--color-header-search-bg": [
233
233
  {
234
- "props": ["background"],
234
+ "props": ["background", "background-color"],
235
235
  "replacement": "--headerSearch-bgColor"
236
236
  }
237
237
  ],
@@ -249,7 +249,7 @@
249
249
  ],
250
250
  "--color-avatar-border": [
251
251
  {
252
- "props": ["border", "background"],
252
+ "props": ["border", "background", "box-shadow"],
253
253
  "replacement": "--avatar-borderColor"
254
254
  }
255
255
  ],
@@ -730,7 +730,7 @@
730
730
  "--color-switch-track-checked-border": [
731
731
  {
732
732
  "props": ["border"],
733
- "replacement": "transparent"
733
+ "replacement": "--borderColor-transparent"
734
734
  }
735
735
  ],
736
736
  "--color-switch-knob-bg": [
@@ -813,8 +813,12 @@
813
813
  ],
814
814
  "--color-canvas-default-transparent": [
815
815
  {
816
- "props": ["background"],
817
- "replacement": "transparent"
816
+ "props": ["background", "color"],
817
+ "replacement": "--bgColor-transparent"
818
+ },
819
+ {
820
+ "props": ["border"],
821
+ "replacement": "--borderColor-transparent"
818
822
  }
819
823
  ],
820
824
  "--color-fg-default": [
@@ -835,6 +839,10 @@
835
839
  {
836
840
  "props": ["background"],
837
841
  "replacement": "--bgColor-neutral-emphasis"
842
+ },
843
+ {
844
+ "props": ["border"],
845
+ "replacement": "--borderColor-neutral-emphasis"
838
846
  }
839
847
  ],
840
848
  "--color-fg-subtle": [
@@ -855,11 +863,7 @@
855
863
  ],
856
864
  "--color-canvas-default": [
857
865
  {
858
- "props": ["background"],
859
- "replacement": "--bgColor-default"
860
- },
861
- {
862
- "props": ["border", "box-shadow"],
866
+ "props": ["background", "border", "box-shadow", "fill", "stroke"],
863
867
  "replacement": "--bgColor-default"
864
868
  }
865
869
  ],
@@ -877,19 +881,19 @@
877
881
  ],
878
882
  "--color-canvas-subtle": [
879
883
  {
880
- "props": ["background"],
884
+ "props": ["background", "fill", "border"],
881
885
  "replacement": "--bgColor-muted"
882
886
  }
883
887
  ],
884
888
  "--color-border-default": [
885
889
  {
886
- "props": ["border", "background", "box-shadow"],
890
+ "props": ["border", "background", "box-shadow", "stroke", "outline", "fill"],
887
891
  "replacement": "--borderColor-default"
888
892
  }
889
893
  ],
890
894
  "--color-border-muted": [
891
895
  {
892
- "props": ["border", "background", "outline"],
896
+ "props": ["border", "background", "outline", "box-shadow", "stroke"],
893
897
  "replacement": "--borderColor-muted"
894
898
  }
895
899
  ],
@@ -901,7 +905,7 @@
901
905
  ],
902
906
  "--color-neutral-emphasis-plus": [
903
907
  {
904
- "props": ["background", "border", "color"],
908
+ "props": ["background", "border", "color", "stroke"],
905
909
  "replacement": "--bgColor-emphasis"
906
910
  }
907
911
  ],
@@ -915,7 +919,7 @@
915
919
  "replacement": "--borderColor-neutral-emphasis"
916
920
  },
917
921
  {
918
- "props": ["color"],
922
+ "props": ["color", "fill"],
919
923
  "replacement": "--fgColor-neutral"
920
924
  }
921
925
  ],
@@ -933,11 +937,15 @@
933
937
  {
934
938
  "props": ["background"],
935
939
  "replacement": "--bgColor-neutral-muted"
940
+ },
941
+ {
942
+ "props": ["border", "box-shadow"],
943
+ "replacement": "--borderColor-neutral-muted"
936
944
  }
937
945
  ],
938
946
  "--color-accent-fg": [
939
947
  {
940
- "props": ["color", "fill"],
948
+ "props": ["color", "fill", "stroke"],
941
949
  "replacement": "--fgColor-accent"
942
950
  },
943
951
  {
@@ -947,6 +955,10 @@
947
955
  {
948
956
  "props": ["background"],
949
957
  "replacement": "--bgColor-accent-emphasis"
958
+ },
959
+ {
960
+ "props": ["outline"],
961
+ "replacement": "--focus-outlineColor"
950
962
  }
951
963
  ],
952
964
  "--color-accent-emphasis": [
@@ -959,8 +971,12 @@
959
971
  "replacement": "--borderColor-accent-emphasis"
960
972
  },
961
973
  {
962
- "props": ["color", "fill"],
974
+ "props": ["color", "fill", "stroke"],
963
975
  "replacement": "--fgColor-accent"
976
+ },
977
+ {
978
+ "props": ["outline"],
979
+ "replacement": "--focus-outlineColor"
964
980
  }
965
981
  ],
966
982
  "--color-accent-muted": [
@@ -977,11 +993,15 @@
977
993
  {
978
994
  "props": ["background"],
979
995
  "replacement": "--bgColor-accent-muted"
996
+ },
997
+ {
998
+ "props": ["border", "box-shadow"],
999
+ "replacement": "--borderColor-accent-muted"
980
1000
  }
981
1001
  ],
982
1002
  "--color-success-fg": [
983
1003
  {
984
- "props": ["color", "fill"],
1004
+ "props": ["color", "fill", "stroke"],
985
1005
  "replacement": "--fgColor-success"
986
1006
  },
987
1007
  {
@@ -1007,6 +1027,10 @@
1007
1027
  {
1008
1028
  "props": ["border", "box-shadow"],
1009
1029
  "replacement": "--borderColor-success-muted"
1030
+ },
1031
+ {
1032
+ "props": ["background"],
1033
+ "replacement": "--bgColor-success-muted"
1010
1034
  }
1011
1035
  ],
1012
1036
  "--color-success-subtle": [
@@ -1035,7 +1059,7 @@
1035
1059
  "replacement": "--borderColor-attention-emphasis"
1036
1060
  },
1037
1061
  {
1038
- "props": ["color"],
1062
+ "props": ["color", "fill"],
1039
1063
  "replacement": "--fgColor-attention"
1040
1064
  }
1041
1065
  ],
@@ -1071,7 +1095,7 @@
1071
1095
  "replacement": "--borderColor-severe-emphasis"
1072
1096
  },
1073
1097
  {
1074
- "props": ["color"],
1098
+ "props": ["color", "fill", "stroke"],
1075
1099
  "replacement": "--fgColor-severe"
1076
1100
  }
1077
1101
  ],
@@ -1103,11 +1127,11 @@
1103
1127
  "replacement": "--bgColor-danger-emphasis"
1104
1128
  },
1105
1129
  {
1106
- "props": ["border", "box-shadow"],
1130
+ "props": ["border", "box-shadow", "outline"],
1107
1131
  "replacement": "--borderColor-danger-emphasis"
1108
1132
  },
1109
1133
  {
1110
- "props": ["color"],
1134
+ "props": ["color", "fill"],
1111
1135
  "replacement": "--fgColor-danger"
1112
1136
  }
1113
1137
  ],
@@ -1115,6 +1139,10 @@
1115
1139
  {
1116
1140
  "props": ["border", "box-shadow"],
1117
1141
  "replacement": "--borderColor-danger-muted"
1142
+ },
1143
+ {
1144
+ "props": ["background"],
1145
+ "replacement": "--bgColor-danger-muted"
1118
1146
  }
1119
1147
  ],
1120
1148
  "--color-danger-subtle": [
@@ -1215,7 +1243,7 @@
1215
1243
  "replacement": "--borderColor-done-emphasis"
1216
1244
  },
1217
1245
  {
1218
- "props": ["color"],
1246
+ "props": ["color", "fill", "stroke"],
1219
1247
  "replacement": "--fgColor-done"
1220
1248
  }
1221
1249
  ],
@@ -1223,6 +1251,10 @@
1223
1251
  {
1224
1252
  "props": ["border", "box-shadow"],
1225
1253
  "replacement": "--borderColor-done-muted"
1254
+ },
1255
+ {
1256
+ "props": ["background"],
1257
+ "replacement": "--bgColor-done-muted"
1226
1258
  }
1227
1259
  ],
1228
1260
  "--color-done-subtle": [
@@ -1297,7 +1329,7 @@
1297
1329
  "replacement": "--avatar-shadow"
1298
1330
  }
1299
1331
  ],
1300
- "color-btn-text": [
1332
+ "--color-btn-text": [
1301
1333
  {
1302
1334
  "props": ["color"],
1303
1335
  "replacement": "--button-default-fgColor-rest"
@@ -20,6 +20,8 @@ const replacedVars = {}
20
20
  const newVars = {}
21
21
 
22
22
  module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, context) => {
23
+ const {inlineFallback = false} = options
24
+
23
25
  if (!enabled) {
24
26
  return noop
25
27
  }
@@ -67,7 +69,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, contex
67
69
  }
68
70
 
69
71
  if (context.fix && replacement !== null) {
70
- replacement = `${replacement}, var(${variableName})`
72
+ replacement = `${replacement}${inlineFallback ? `, var(${variableName})` : ''}`
71
73
  replacedVars[variableName] = true
72
74
  newVars[replacement] = true
73
75
  if (node.type === 'atrule') {
package/CHANGELOG.md DELETED
@@ -1,290 +0,0 @@
1
- # Changelog
2
-
3
- ## 12.7.1
4
-
5
- ### Patch Changes
6
-
7
- - [#328](https://github.com/primer/stylelint-config/pull/328) [`5ae7400`](https://github.com/primer/stylelint-config/commit/5ae7400340afc2cd21006093ce7b33206a00372e) Thanks [@langermank](https://github.com/langermank)! - Fix failing tests in no-deprecated-colors
8
-
9
- - [#332](https://github.com/primer/stylelint-config/pull/332) [`6485cf0`](https://github.com/primer/stylelint-config/commit/6485cf053f502d71a8ce8c407ad01a939038959c) Thanks [@langermank](https://github.com/langermank)! - Updated deprecated json color file
10
-
11
- - [#333](https://github.com/primer/stylelint-config/pull/333) [`485ce04`](https://github.com/primer/stylelint-config/commit/485ce047d75a635134919678a776ea808604cf4a) Thanks [@langermank](https://github.com/langermank)! - Adding more color replacements for deprecated colors
12
-
13
- - [#322](https://github.com/primer/stylelint-config/pull/322) [`726d7d1`](https://github.com/primer/stylelint-config/commit/726d7d1bf4eac82a032c448cb0be32d5bf66b29a) Thanks [@jonrohan](https://github.com/jonrohan)! - Updating no-deprecated-colors for primitives v8
14
-
15
- - [#334](https://github.com/primer/stylelint-config/pull/334) [`b14c154`](https://github.com/primer/stylelint-config/commit/b14c154174ddd7190e62fe1d26698fc9cfe75c17) Thanks [@langermank](https://github.com/langermank)! - More tests for `no-deprecated-colors`
16
-
17
- ## 12.7.0
18
-
19
- ### Minor Changes
20
-
21
- - [#294](https://github.com/primer/stylelint-config/pull/294) [`8bdb1d0`](https://github.com/primer/stylelint-config/commit/8bdb1d0a679c32a1782e33feb74bd8993aba5d80) Thanks [@keithamus](https://github.com/keithamus)! - allow for vars defined in scope, or within :root/:host selectors in file
22
-
23
- ## 12.6.1
24
-
25
- ### Patch Changes
26
-
27
- - [#274](https://github.com/primer/stylelint-config/pull/274) [`4ba7018`](https://github.com/primer/stylelint-config/commit/4ba701887351664d8b937483d3d761fa5022f16c) Thanks [@jonrohan](https://github.com/jonrohan)! - Fixing issue in utilities plugin that missed certain classes
28
-
29
- ## 12.6.0
30
-
31
- ### Minor Changes
32
-
33
- - [#272](https://github.com/primer/stylelint-config/pull/272) [`9104062`](https://github.com/primer/stylelint-config/commit/91040626d2195cbb63f1e302ae53acdd4ba5b361) Thanks [@langermank](https://github.com/langermank)! - Add no-experimental-vars plugin
34
-
35
- ## 12.5.0
36
-
37
- ### Minor Changes
38
-
39
- - [#262](https://github.com/primer/stylelint-config/pull/262) [`28a4086`](https://github.com/primer/stylelint-config/commit/28a4086e8c781f76494c7e77b9437046a6f686a6) Thanks [@jonrohan](https://github.com/jonrohan)! - Writing a primer/utilities plugin to look for code that duplicates utilities
40
-
41
- ## 12.4.2
42
-
43
- ### Patch Changes
44
-
45
- - [#258](https://github.com/primer/stylelint-config/pull/258) [`fa48eed`](https://github.com/primer/stylelint-config/commit/fa48eed1af84474fa49bdb7ec861d2c6a3210239) Thanks [@jonrohan](https://github.com/jonrohan)! - Fixing dependencies
46
-
47
- * [#260](https://github.com/primer/stylelint-config/pull/260) [`4f42328`](https://github.com/primer/stylelint-config/commit/4f4232826cd3055e0e9dc49ff16925c47db21863) Thanks [@jonrohan](https://github.com/jonrohan)! - Turning off 'function-no-unknown': null,
48
-
49
- ## 12.4.1
50
-
51
- ### Patch Changes
52
-
53
- - [#256](https://github.com/primer/stylelint-config/pull/256) [`37eb1cb`](https://github.com/primer/stylelint-config/commit/37eb1cbd342590f4c43e37779f657a4b19594eca) Thanks [@jonrohan](https://github.com/jonrohan)! - Remove stylelint peer
54
-
55
- ## 12.4.0
56
-
57
- ### Minor Changes
58
-
59
- - [#232](https://github.com/primer/stylelint-config/pull/232) [`27ddfc9`](https://github.com/primer/stylelint-config/commit/27ddfc98f93ed898552bb62aa0926d35497dda72) Thanks [@jonrohan](https://github.com/jonrohan)! - Creating a responsive-widths plugin to keep fixed widths smaller than the minimum viewport size
60
-
61
- * [#253](https://github.com/primer/stylelint-config/pull/253) [`0edeee0`](https://github.com/primer/stylelint-config/commit/0edeee07b1e7ef51bcd0942c65d98131ac384887) Thanks [@jonrohan](https://github.com/jonrohan)! - Changing this peerDependency to be any
62
-
63
- ## 12.3.3
64
-
65
- ### Patch Changes
66
-
67
- - [#218](https://github.com/primer/stylelint-config/pull/218) [`c03be7d`](https://github.com/primer/stylelint-config/commit/c03be7da1126123c079d86e00a2158a913e015f8) Thanks [@jonrohan](https://github.com/jonrohan)! - [Bug fix] Catching values with dots in them
68
-
69
- * [#217](https://github.com/primer/stylelint-config/pull/217) [`5bb2834`](https://github.com/primer/stylelint-config/commit/5bb28342a6194dfdd4fbf5197682367ea54792b7) Thanks [@jsoref](https://github.com/jsoref)! - Spelling fixes
70
-
71
- ## 12.3.2
72
-
73
- ### Patch Changes
74
-
75
- - [#215](https://github.com/primer/stylelint-config/pull/215) [`66b16ae`](https://github.com/primer/stylelint-config/commit/66b16ae2edd81f8c8949f83c96d7011e5d395cc0) Thanks [@jonrohan](https://github.com/jonrohan)! - Making linter pick up separate function groups
76
-
77
- ## 12.3.1
78
-
79
- ### Patch Changes
80
-
81
- - [#213](https://github.com/primer/stylelint-config/pull/213) [`2a27f86`](https://github.com/primer/stylelint-config/commit/2a27f86868b1f4717100a1f0897cdaefb1dd6be7) Thanks [@jonrohan](https://github.com/jonrohan)! - Fixing an issue where the new spacing plugin isn't traversing child sectors.
82
-
83
- ## 12.3.0
84
-
85
- ### Minor Changes
86
-
87
- - [#191](https://github.com/primer/stylelint-config/pull/191) [`71c7985`](https://github.com/primer/stylelint-config/commit/71c79853b679b674c1d27686f8d2168660b24a45) Thanks [@jonrohan](https://github.com/jonrohan)! - Refactoring the primer/spacing plugin to better match results
88
-
89
- ## 12.2.0
90
-
91
- ### Minor Changes
92
-
93
- - [#170](https://github.com/primer/stylelint-config/pull/170) [`b56fcd1`](https://github.com/primer/stylelint-config/commit/b56fcd1bce90d2e3e1621ef7af7545c52c935579) Thanks [@jonrohan](https://github.com/jonrohan)! - Moving config from primer/css's [stylelint.config.cjs](https://github.com/primer/css/blob/c65be7f0c8b0fb6e1ba406b5d35c6073df161a33/stylelint.config.cjs) file to this package.
94
-
95
- * [#168](https://github.com/primer/stylelint-config/pull/168) [`d6ff2b9`](https://github.com/primer/stylelint-config/commit/d6ff2b94ff0d309c1b79e783e6ee1b2f87a375ff) Thanks [@jonrohan](https://github.com/jonrohan)! - Extending stylelint-config-standard and removing defaults
96
-
97
- - [#170](https://github.com/primer/stylelint-config/pull/170) [`b56fcd1`](https://github.com/primer/stylelint-config/commit/b56fcd1bce90d2e3e1621ef7af7545c52c935579) Thanks [@jonrohan](https://github.com/jonrohan)! - Adding config from the [stylelint-scss recommended config](https://github.com/stylelint-scss/stylelint-config-recommended-scss/blob/82d51c399ddaa2f9d282e419399dd2028f47830c/index.js).
98
-
99
- ### Patch Changes
100
-
101
- - [#181](https://github.com/primer/stylelint-config/pull/181) [`23e438a`](https://github.com/primer/stylelint-config/commit/23e438a7a9062550baa696cafbb186dc78b723f5) Thanks [@jonrohan](https://github.com/jonrohan)! - Turning off scss/dollar-variable-default
102
-
103
- ## 12.1.1
104
-
105
- ### Patch Changes
106
-
107
- - [#161](https://github.com/primer/stylelint-config/pull/161) [`48c4afc`](https://github.com/primer/stylelint-config/commit/48c4afc1913863136d62967653697323f8da57b7) Thanks [@dependabot](https://github.com/apps/dependabot)! - Bump @primer/primitives from 6.1.0 to 7.0.1
108
-
109
- ## 12.1.0
110
-
111
- ### Minor Changes
112
-
113
- - [#150](https://github.com/primer/stylelint-config/pull/150) [`4af1647`](https://github.com/primer/stylelint-config/commit/4af16474148d96fba5567068280a9ffe6e7a80ba) Thanks [@jonrohan](https://github.com/jonrohan)! - Making all be first in property order
114
-
115
- * [#151](https://github.com/primer/stylelint-config/pull/151) [`d7c8b2b`](https://github.com/primer/stylelint-config/commit/d7c8b2b908b113fa14c7637dfced34610a3bcfac) Thanks [@jonrohan](https://github.com/jonrohan)! - Adding [string-quotes](https://stylelint.io/user-guide/rules/list/string-quotes) rule to config
116
-
117
- ### Patch Changes
118
-
119
- - [#146](https://github.com/primer/stylelint-config/pull/146) [`214362c`](https://github.com/primer/stylelint-config/commit/214362c0e3c9449a5ff7d3bd047018493043d3c0) Thanks [@dependabot](https://github.com/apps/dependabot)! - Bump @primer/css from 13.2.0 to 16.3.0
120
-
121
- ## 12.0.1
122
-
123
- ### Patch Changes
124
-
125
- - [#132](https://github.com/primer/stylelint-config/pull/132) [`b672367`](https://github.com/primer/stylelint-config/commit/b6723679606bb8d39e75025ae17ace9f1c3e2631) Thanks [@jonrohan](https://github.com/jonrohan)! - Updating no-deprecated-colors plugin for edge cases
126
-
127
- ## 12.0.0
128
-
129
- ### Major Changes
130
-
131
- - [#129](https://github.com/primer/stylelint-config/pull/129) [`653d596`](https://github.com/primer/stylelint-config/commit/653d596072b897b265b093aac4cd5c143e61410e) Thanks [@jonrohan](https://github.com/jonrohan)! - Renaming the package to use org scope. This is a breaking change, you'll need to uninstall `stylelint-config-primer` and reinstall `@primer/stylelint-config`.
132
-
133
- ### Patch Changes
134
-
135
- - [#130](https://github.com/primer/stylelint-config/pull/130) [`f495a56`](https://github.com/primer/stylelint-config/commit/f495a563a9e809252630466088eb94177e6c0be4) Thanks [@jonrohan](https://github.com/jonrohan)! - Updating @primer/primitives to 5.0 release candidate
136
-
137
- ## 11.1.1
138
-
139
- ### Patch Changes
140
-
141
- - [`3a4654b`](https://github.com/primer/stylelint-config/commit/3a4654b1b7920d71e1284ff78a3bedff932e66a3) [#111](https://github.com/primer/stylelint-config/pull/111) Thanks [@jonrohan](https://github.com/jonrohan)! - Fixing the primer/colors and primer/borders rules
142
-
143
- ## 11.1.0
144
-
145
- ### Minor Changes
146
-
147
- - [`e83f61c`](https://github.com/primer/stylelint-config/commit/e83f61cef3bf1df1d9420662594040efdcb86c89) [#99](https://github.com/primer/stylelint-config/pull/99) Thanks [@jonrohan](https://github.com/jonrohan)! - Create a `no-deprecated-colors` rule that looks for deprecated css color variables from primer/primitives.
148
-
149
- ### Patch Changes
150
-
151
- - [`581f40a`](https://github.com/primer/stylelint-config/commit/581f40a4aacb45db5426b82d4a2434e81eb032e2) [#105](https://github.com/primer/stylelint-config/pull/105) Thanks [@jonrohan](https://github.com/jonrohan)! - Adding reporting to the linter to know how many variables are replaced
152
-
153
- ## 10.0.1
154
-
155
- ### Patch Changes
156
-
157
- - [`aa76171`](https://github.com/primer/stylelint-config/commit/aa76171fc5c9c308fcd9d7f7285c8fbdb2c18a7b) [#90](https://github.com/primer/stylelint-config/pull/90) Thanks [@jonrohan](https://github.com/jonrohan)! - Updating the no-undefined-variables lint for the new color-variables mixin.
158
-
159
- ## 10.0.0
160
-
161
- ### Major Changes
162
-
163
- - [`23a1f15`](https://github.com/primer/stylelint-config/commit/23a1f1599673f2a4f9f28c39da61f42871c05697) [#85](https://github.com/primer/stylelint-config/pull/85) Thanks [@koddsson](https://github.com/koddsson)! - Replace deprecated "blacklist" rules for "disallow list" rules.
164
-
165
- See https://stylelint.io/user-guide/rules/at-rule-blacklist and http://stylelint.io/user-guide/rules/declaration-property-value-disallowed-list/
166
-
167
- ### Patch Changes
168
-
169
- - [`40d9bb8`](https://github.com/primer/stylelint-config/commit/40d9bb867194ae4335846953b5d8706dc7dc7d79) [#86](https://github.com/primer/stylelint-config/pull/86) Thanks [@koddsson](https://github.com/koddsson)! - Allow rules to optionally display a URL with their message.
170
-
171
- ## 9.3.3
172
-
173
- ### Patch Changes
174
-
175
- - [`a339c69`](https://github.com/primer/stylelint-config/commit/a339c698b9ba7ccd01b8cb773dad7a3a14dd13a1) [#81](https://github.com/primer/stylelint-config/pull/81) Thanks [@BinaryMuse](https://github.com/BinaryMuse)! - Update globby to v11
176
-
177
- ## 9.3.2
178
-
179
- ### Patch Changes
180
-
181
- - [`d18cfbf`](https://github.com/primer/stylelint-config/commit/d18cfbfefc25be6ae38f73132552d2f3c62c4d02) [#79](https://github.com/primer/stylelint-config/pull/79) Thanks [@BinaryMuse](https://github.com/BinaryMuse)! - Add additional verbose logging to `no-undefined-vars`
182
-
183
- * [`d18cfbf`](https://github.com/primer/stylelint-config/commit/d18cfbfefc25be6ae38f73132552d2f3c62c4d02) [#79](https://github.com/primer/stylelint-config/pull/79) Thanks [@BinaryMuse](https://github.com/BinaryMuse)! - Fix handling of edge-cases in `no-undefined-vars`
184
-
185
- - [`bb07673`](https://github.com/primer/stylelint-config/commit/bb076732aa216fcb56e411b8dd7477efc89f7f8a) [#76](https://github.com/primer/stylelint-config/pull/76) Thanks [@BinaryMuse](https://github.com/BinaryMuse)! - Set the default verbose option for `no-scale-colors` to false
186
-
187
- ## 9.3.1
188
-
189
- ### Patch Changes
190
-
191
- - [`df11e2d`](https://github.com/primer/stylelint-config/commit/df11e2d912913346e0499f7eac901cdfcb83f38c) [#74](https://github.com/primer/stylelint-config/pull/74) Thanks [@BinaryMuse](https://github.com/BinaryMuse)! - Add primer/no-scale-colors to the list of exported plugins
192
-
193
- ## 9.2.1
194
-
195
- ### :bug: Bug fixes
196
-
197
- - Fix slow runtime by caching variable definitions in `primer/no-undefined-vars` rule
198
- - Fix duplicate errors in `primer/no-undefined-vars` rule
199
-
200
- ## 9.2.0
201
-
202
- ### :rocket: Enhancements
203
-
204
- - New `primer/no-undefined-vars` to prohibit usages of undefined CSS variables
205
-
206
- ## 9.1.0
207
-
208
- ### :rocket: Enhancements
209
-
210
- - The `primer/colors`, `primer/borders`, and `primer/box-shadow` rules now allow CSS color variables with the correct functional names (e.g. `var(--color-text-primary)`). #62
211
-
212
- ## 9.0.0
213
-
214
- ### :boom: Breaking Change
215
-
216
- - `primer/variables` is no longer supported; please use the `primer/colors`, `primer/borders`, `primer/box-shadow`, `primer/spacing`, and `primer/typography` rules instead. #50
217
-
218
- ### :rocket: Enhancements
219
-
220
- - The new `primer/colors` rule enforces color variable usage in `color`, `background-color`, and `fill` properties
221
- - The new `primer/borders` rule enforces border variable usage in border CSS props
222
- - The new `primer/box-shadow` rule enforces `$box-shadow*` variables
223
- - The new `primer/spacing` rule enforces `$spacer-*` variables in margin and padding props
224
- - The new `primer/typography` rule enforces typography variable use in `font-family`, `line-height`, and `font-weight` props
225
- - Variable replacements for autofixing are automatically detected in variable data from Primer CSS (see: https://github.com/primer/css/pull/949) #52
226
- - It is now possible to define variable rules using functions that take the variables, as in:
227
- ```js
228
- module.exports = createVariableRule('primer/whatever', ({variables}) => {
229
- /* do something with variables here */
230
- })
231
- ```
232
- - It's also now possible to provide rule _overrides_ in local stylelint configs as functions:
233
- ```js
234
- module.exports = {
235
- extends: '@primer/stylelint-config',
236
- rules: {
237
- 'primer/colors': [true, {
238
- rules: ({variables, rules}) => {
239
- /* do something with variables and/or rules here */
240
- return rules
241
- }]
242
- }
243
- })
244
- ```
245
- - This release adds support for an optional `singular: true` flag to rule configs, which skips the parsing of individual values in the matched properties. We use this in `primer/box-shadow` to prevent multiple warnings for a single value like `box-shadow: inset 0 1px $blue` (before there would be 4 separate ones!).
246
-
247
- ### :bug: Bug fixes
248
-
249
- - Use `requirePrimerFile()` when loading `dist/variables.json` so that we can access the right file when running _within_ the `@primer/css` repo.
250
- - Walk only declarations (`prop: value`) in rules (blocks with selectors, _not_ `@rules`), and skip linting for declarations nested in `@each`, `@for`, `@function`, and `@mixin` blocks, since those can define their own variables and we can't reliably assert their values.
251
- - Allow `$*-shadow` variable patterns in `primer/box-shadow` to match `$btn-active-shadow` and `$form-control-shadow`
252
- - Allow `color: inherit` in `primer/colors`
253
- - Allow `$em-spacer-*` in `padding` and `margin` properties
254
- - Allow (and auto-fix!) negative spacer variables in `margin` properties
255
- - Make `primer/colors` smarter re: `background` property shorthand values (allowing positions and image `url(*)` values)
256
- - Remove `100%` from allowed values for `border-radius`, and suggest `50%` instead
257
- - Prohibit negative spacer values in `padding` properties
258
- - Allow `$h000-size` for marketing 😬
259
-
260
- ## 2.0.0
261
-
262
- :boom: **The following updates are breaking changes**, since code that disables the deprecated rule will now produce linting errors. Please update your `stylelint-disable` statements accordingly.
263
-
264
- - Replaced `selector-no-id: true` with `selector-max-id: 0`
265
- - Replaced `selector-no-type: true` with `selector-max-type: 0`
266
-
267
- The rest of the changes should not introduce new linting errors:
268
-
269
- - Updated: moved [browserslist](https://github.com/ai/browserslist) spec to `package.json`
270
- - Updated: using the [`no-unsupported-browser-features` plugin](https://github.com/ismay/stylelint-no-unsupported-browser-features) instead of the deprecated `no-unsupported-browser-features` rule
271
- - Removed: `media-feature-no-missing-punctuation`
272
- - Updated: replaced `rule-nested-empty-line-before` and `rule-non-nested-empty-line-before` with `rule-empty-line-before`
273
-
274
- ## 1.4.0
275
-
276
- - Updated: Development dependencies are any version `*`
277
- - Removed: `selector-class-pattern` from config. https://github.com/primer/stylelint-config/pull/11
278
-
279
- ## 1.3.0
280
-
281
- - Added: `length-zero-no-unit` to disallow zero values with units eg `0px`
282
-
283
- ## 1.2.0
284
-
285
- - Removed: We don't need `scss/at-extend-no-missing-placeholder` anymore taken care of by `at-rule-blacklist`
286
- - Added: Adding `selector-no-type` to the rules
287
-
288
- ## 1.0.0
289
-
290
- - Creating a sharable config object