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

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/CHANGELOG.md CHANGED
@@ -8,8 +8,12 @@
8
8
 
9
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
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
+
11
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
12
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
+
13
17
  ## 12.7.0
14
18
 
15
19
  ### Minor Changes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/stylelint-config",
3
- "version": "12.7.1-rc.c4a4e27",
3
+ "version": "12.7.1-rc.d8a889b",
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.",
@@ -44,7 +44,7 @@
44
44
  "@primer/css": "^20.0.0",
45
45
  "@primer/primitives": "^7.8.3",
46
46
  "dedent": "0.7.0",
47
- "eslint": "8.22.0",
47
+ "eslint": "8.39.0",
48
48
  "eslint-plugin-github": "4.3.5",
49
49
  "eslint-plugin-jest": "27.0.1",
50
50
  "eslint-plugin-prettier": "4.2.1",
@@ -604,7 +604,7 @@
604
604
  "--color-action-list-item-inline-divider": [
605
605
  {
606
606
  "props": ["border", "background"],
607
- "replacement": "--borderColor-decorative"
607
+ "replacement": "--borderColor-muted"
608
608
  }
609
609
  ],
610
610
  "--color-action-list-item-default-hover-bg": [
@@ -727,7 +727,12 @@
727
727
  "replacement": "--control-checked-fgColor-disabled"
728
728
  }
729
729
  ],
730
- "--color-switch-track-checked-border": [],
730
+ "--color-switch-track-checked-border": [
731
+ {
732
+ "props": ["border"],
733
+ "replacement": "transparent"
734
+ }
735
+ ],
731
736
  "--color-switch-knob-bg": [
732
737
  {
733
738
  "props": ["background"],
@@ -806,28 +811,45 @@
806
811
  "replacement": "--treeViewItem-leadingVisual-bgColor-rest"
807
812
  }
808
813
  ],
809
- "--color-canvas-default-transparent": [],
814
+ "--color-canvas-default-transparent": [
815
+ {
816
+ "props": ["background"],
817
+ "replacement": "transparent"
818
+ }
819
+ ],
810
820
  "--color-fg-default": [
811
821
  {
812
822
  "props": ["color", "fill"],
813
823
  "replacement": "--fgColor-default"
824
+ },
825
+ {
826
+ "props": ["background"],
827
+ "replacement": "--fgColor-default"
814
828
  }
815
829
  ],
816
830
  "--color-fg-muted": [
817
831
  {
818
832
  "props": ["color", "fill"],
819
833
  "replacement": "--fgColor-muted"
834
+ },
835
+ {
836
+ "props": ["background"],
837
+ "replacement": "--bgColor-neutral-emphasis"
820
838
  }
821
839
  ],
822
840
  "--color-fg-subtle": [
823
841
  {
824
842
  "props": ["color", "fill"],
825
843
  "replacement": "--fgColor-muted"
844
+ },
845
+ {
846
+ "props": ["border"],
847
+ "replacement": "--borderColor-neutral-emphasis"
826
848
  }
827
849
  ],
828
850
  "--color-fg-on-emphasis": [
829
851
  {
830
- "props": ["color", "fill"],
852
+ "props": ["color", "fill", "border"],
831
853
  "replacement": "--fgColor-onEmphasis"
832
854
  }
833
855
  ],
@@ -835,6 +857,10 @@
835
857
  {
836
858
  "props": ["background"],
837
859
  "replacement": "--bgColor-default"
860
+ },
861
+ {
862
+ "props": ["border", "box-shadow"],
863
+ "replacement": "--bgColor-default"
838
864
  }
839
865
  ],
840
866
  "--color-canvas-overlay": [
@@ -863,13 +889,13 @@
863
889
  ],
864
890
  "--color-border-muted": [
865
891
  {
866
- "props": ["border", "background"],
892
+ "props": ["border", "background", "outline"],
867
893
  "replacement": "--borderColor-muted"
868
894
  }
869
895
  ],
870
896
  "--color-border-subtle": [
871
897
  {
872
- "props": ["border", "background"],
898
+ "props": ["border", "background", "outline"],
873
899
  "replacement": "--borderColor-muted"
874
900
  }
875
901
  ],
@@ -885,13 +911,17 @@
885
911
  "replacement": "--bgColor-neutral-emphasis"
886
912
  },
887
913
  {
888
- "props": ["border"],
914
+ "props": ["border", "box-shadow"],
889
915
  "replacement": "--borderColor-neutral-emphasis"
916
+ },
917
+ {
918
+ "props": ["color"],
919
+ "replacement": "--fgColor-neutral"
890
920
  }
891
921
  ],
892
922
  "--color-neutral-muted": [
893
923
  {
894
- "props": ["border"],
924
+ "props": ["border", "box-shadow"],
895
925
  "replacement": "--borderColor-neutral-muted"
896
926
  },
897
927
  {
@@ -911,8 +941,12 @@
911
941
  "replacement": "--fgColor-accent"
912
942
  },
913
943
  {
914
- "props": ["border"],
944
+ "props": ["border", "box-shadow"],
915
945
  "replacement": "--borderColor-accent-emphasis"
946
+ },
947
+ {
948
+ "props": ["background"],
949
+ "replacement": "--bgColor-accent-emphasis"
916
950
  }
917
951
  ],
918
952
  "--color-accent-emphasis": [
@@ -921,7 +955,7 @@
921
955
  "replacement": "--bgColor-accent-emphasis"
922
956
  },
923
957
  {
924
- "props": ["border"],
958
+ "props": ["border", "box-shadow"],
925
959
  "replacement": "--borderColor-accent-emphasis"
926
960
  },
927
961
  {
@@ -931,8 +965,12 @@
931
965
  ],
932
966
  "--color-accent-muted": [
933
967
  {
934
- "props": ["border"],
968
+ "props": ["border", "box-shadow"],
935
969
  "replacement": "--borderColor-accent-muted"
970
+ },
971
+ {
972
+ "props": ["background"],
973
+ "replacement": "--bgColor-accent-muted"
936
974
  }
937
975
  ],
938
976
  "--color-accent-subtle": [
@@ -945,6 +983,10 @@
945
983
  {
946
984
  "props": ["color", "fill"],
947
985
  "replacement": "--fgColor-success"
986
+ },
987
+ {
988
+ "props": ["background"],
989
+ "replacement": "--bgColor-success-emphasis"
948
990
  }
949
991
  ],
950
992
  "--color-success-emphasis": [
@@ -953,13 +995,17 @@
953
995
  "replacement": "--bgColor-success-emphasis"
954
996
  },
955
997
  {
956
- "props": ["border"],
998
+ "props": ["border", "box-shadow"],
957
999
  "replacement": "--borderColor-success-emphasis"
1000
+ },
1001
+ {
1002
+ "props": ["color"],
1003
+ "replacement": "--fgColor-success"
958
1004
  }
959
1005
  ],
960
1006
  "--color-success-muted": [
961
1007
  {
962
- "props": ["border"],
1008
+ "props": ["border", "box-shadow"],
963
1009
  "replacement": "--borderColor-success-muted"
964
1010
  }
965
1011
  ],
@@ -973,6 +1019,10 @@
973
1019
  {
974
1020
  "props": ["color", "fill"],
975
1021
  "replacement": "--fgColor-attention"
1022
+ },
1023
+ {
1024
+ "props": ["background"],
1025
+ "replacement": "--bgColor-attention-emphasis"
976
1026
  }
977
1027
  ],
978
1028
  "--color-attention-emphasis": [
@@ -981,13 +1031,17 @@
981
1031
  "replacement": "--bgColor-attention-emphasis"
982
1032
  },
983
1033
  {
984
- "props": ["border"],
1034
+ "props": ["border", "box-shadow"],
985
1035
  "replacement": "--borderColor-attention-emphasis"
1036
+ },
1037
+ {
1038
+ "props": ["color"],
1039
+ "replacement": "--fgColor-attention"
986
1040
  }
987
1041
  ],
988
1042
  "--color-attention-muted": [
989
1043
  {
990
- "props": ["border"],
1044
+ "props": ["border", "box-shadow"],
991
1045
  "replacement": "--borderColor-attention-muted"
992
1046
  }
993
1047
  ],
@@ -1001,6 +1055,10 @@
1001
1055
  {
1002
1056
  "props": ["color", "fill"],
1003
1057
  "replacement": "--fgColor-severe"
1058
+ },
1059
+ {
1060
+ "props": ["background"],
1061
+ "replacement": "--bgColor-severe-emphasis"
1004
1062
  }
1005
1063
  ],
1006
1064
  "--color-severe-emphasis": [
@@ -1009,13 +1067,17 @@
1009
1067
  "replacement": "--bgColor-severe-emphasis"
1010
1068
  },
1011
1069
  {
1012
- "props": ["border"],
1070
+ "props": ["border", "box-shadow"],
1013
1071
  "replacement": "--borderColor-severe-emphasis"
1072
+ },
1073
+ {
1074
+ "props": ["color"],
1075
+ "replacement": "--fgColor-severe"
1014
1076
  }
1015
1077
  ],
1016
1078
  "--color-severe-muted": [
1017
1079
  {
1018
- "props": ["border"],
1080
+ "props": ["border", "box-shadow"],
1019
1081
  "replacement": "--borderColor-severe-muted"
1020
1082
  }
1021
1083
  ],
@@ -1029,6 +1091,10 @@
1029
1091
  {
1030
1092
  "props": ["color", "fill"],
1031
1093
  "replacement": "--fgColor-danger"
1094
+ },
1095
+ {
1096
+ "props": ["background"],
1097
+ "replacement": "--bgColor-danger-emphasis"
1032
1098
  }
1033
1099
  ],
1034
1100
  "--color-danger-emphasis": [
@@ -1037,13 +1103,17 @@
1037
1103
  "replacement": "--bgColor-danger-emphasis"
1038
1104
  },
1039
1105
  {
1040
- "props": ["border"],
1106
+ "props": ["border", "box-shadow"],
1041
1107
  "replacement": "--borderColor-danger-emphasis"
1108
+ },
1109
+ {
1110
+ "props": ["color"],
1111
+ "replacement": "--fgColor-danger"
1042
1112
  }
1043
1113
  ],
1044
1114
  "--color-danger-muted": [
1045
1115
  {
1046
- "props": ["border"],
1116
+ "props": ["border", "box-shadow"],
1047
1117
  "replacement": "--borderColor-danger-muted"
1048
1118
  }
1049
1119
  ],
@@ -1057,6 +1127,10 @@
1057
1127
  {
1058
1128
  "props": ["color", "fill"],
1059
1129
  "replacement": "--fgColor-open"
1130
+ },
1131
+ {
1132
+ "props": ["background"],
1133
+ "replacement": "--bgColor-open-emphasis"
1060
1134
  }
1061
1135
  ],
1062
1136
  "--color-open-emphasis": [
@@ -1065,13 +1139,17 @@
1065
1139
  "replacement": "--bgColor-open-emphasis"
1066
1140
  },
1067
1141
  {
1068
- "props": ["border"],
1142
+ "props": ["border", "box-shadow"],
1069
1143
  "replacement": "--borderColor-open-emphasis"
1144
+ },
1145
+ {
1146
+ "props": ["color"],
1147
+ "replacement": "--fgColor-open"
1070
1148
  }
1071
1149
  ],
1072
1150
  "--color-open-muted": [
1073
1151
  {
1074
- "props": ["border"],
1152
+ "props": ["border", "box-shadow"],
1075
1153
  "replacement": "--borderColor-open-muted"
1076
1154
  }
1077
1155
  ],
@@ -1085,6 +1163,10 @@
1085
1163
  {
1086
1164
  "props": ["color", "fill"],
1087
1165
  "replacement": "--fgColor-closed"
1166
+ },
1167
+ {
1168
+ "props": ["background"],
1169
+ "replacement": "--bgColor-closed-emphasis"
1088
1170
  }
1089
1171
  ],
1090
1172
  "--color-closed-emphasis": [
@@ -1093,13 +1175,17 @@
1093
1175
  "replacement": "--bgColor-closed-emphasis"
1094
1176
  },
1095
1177
  {
1096
- "props": ["border"],
1178
+ "props": ["border", "box-shadow"],
1097
1179
  "replacement": "--borderColor-closed-emphasis"
1180
+ },
1181
+ {
1182
+ "props": ["color"],
1183
+ "replacement": "--fgColor-closed"
1098
1184
  }
1099
1185
  ],
1100
1186
  "--color-closed-muted": [
1101
1187
  {
1102
- "props": ["border"],
1188
+ "props": ["border", "box-shadow"],
1103
1189
  "replacement": "--borderColor-closed-muted"
1104
1190
  }
1105
1191
  ],
@@ -1113,6 +1199,10 @@
1113
1199
  {
1114
1200
  "props": ["color", "fill"],
1115
1201
  "replacement": "--fgColor-done"
1202
+ },
1203
+ {
1204
+ "props": ["background"],
1205
+ "replacement": "--bgColor-done-emphasis"
1116
1206
  }
1117
1207
  ],
1118
1208
  "--color-done-emphasis": [
@@ -1121,13 +1211,17 @@
1121
1211
  "replacement": "--bgColor-done-emphasis"
1122
1212
  },
1123
1213
  {
1124
- "props": ["border"],
1214
+ "props": ["border", "box-shadow"],
1125
1215
  "replacement": "--borderColor-done-emphasis"
1216
+ },
1217
+ {
1218
+ "props": ["color"],
1219
+ "replacement": "--fgColor-done"
1126
1220
  }
1127
1221
  ],
1128
1222
  "--color-done-muted": [
1129
1223
  {
1130
- "props": ["border"],
1224
+ "props": ["border", "box-shadow"],
1131
1225
  "replacement": "--borderColor-done-muted"
1132
1226
  }
1133
1227
  ],
@@ -1141,6 +1235,10 @@
1141
1235
  {
1142
1236
  "props": ["color", "fill"],
1143
1237
  "replacement": "--fgColor-sponsors"
1238
+ },
1239
+ {
1240
+ "props": ["background"],
1241
+ "replacement": "--bgColor-sponsors-emphasis"
1144
1242
  }
1145
1243
  ],
1146
1244
  "--color-sponsors-emphasis": [
@@ -1149,13 +1247,17 @@
1149
1247
  "replacement": "--bgColor-sponsors-emphasis"
1150
1248
  },
1151
1249
  {
1152
- "props": ["border"],
1250
+ "props": ["border", "box-shadow"],
1153
1251
  "replacement": "--borderColor-sponsors-emphasis"
1252
+ },
1253
+ {
1254
+ "props": ["color"],
1255
+ "replacement": "--fgColor-sponsors"
1154
1256
  }
1155
1257
  ],
1156
1258
  "--color-sponsors-muted": [
1157
1259
  {
1158
- "props": ["border"],
1260
+ "props": ["border", "box-shadow"],
1159
1261
  "replacement": "--borderColor-sponsors-muted"
1160
1262
  }
1161
1263
  ],
@@ -1195,6 +1297,12 @@
1195
1297
  "replacement": "--avatar-shadow"
1196
1298
  }
1197
1299
  ],
1300
+ "color-btn-text": [
1301
+ {
1302
+ "props": ["color"],
1303
+ "replacement": "--button-default-fgColor-rest"
1304
+ }
1305
+ ],
1198
1306
  "--color-btn-shadow": [
1199
1307
  {
1200
1308
  "props": ["box-shadow"],
@@ -44,14 +44,11 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, contex
44
44
  }
45
45
 
46
46
  // walk these nodes
47
- if (!(node.type === 'decl' || node.type === 'atrule')) {
47
+ if (node.type !== 'decl') {
48
48
  return
49
49
  }
50
50
 
51
- for (const [, variableName] of matchAll(
52
- node.type === 'atrule' ? node.params : node.value,
53
- variableReferenceRegex
54
- )) {
51
+ for (const [, variableName] of matchAll(node.value, variableReferenceRegex)) {
55
52
  if (variableName in variableChecks) {
56
53
  let replacement = variableChecks[variableName]
57
54
  if (typeof replacement === 'object') {