@primer/stylelint-config 12.7.2-rc.69b2f10 → 12.7.3-rc.99e67f7

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
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 12.7.3
4
+
5
+ ### Patch Changes
6
+
7
+ - [#353](https://github.com/primer/stylelint-config/pull/353) [`cdb7ca9`](https://github.com/primer/stylelint-config/commit/cdb7ca90d4c38e429f24db92bf07578ad44d4032) Thanks [@langermank](https://github.com/langermank)! - Add `bgColor-inset` fallback for Primitives v8
8
+
3
9
  ## 12.7.2
4
10
 
5
11
  ### Patch Changes
package/browsers.js CHANGED
@@ -3,5 +3,5 @@ module.exports = [
3
3
  'last 2 firefox versions',
4
4
  'last 2 chrome versions',
5
5
  'last 2 safari versions',
6
- 'last 2 edge versions'
6
+ 'last 2 edge versions',
7
7
  ]
package/index.js CHANGED
@@ -21,7 +21,7 @@ module.exports = {
21
21
  './plugins/responsive-widths',
22
22
  './plugins/spacing',
23
23
  './plugins/typography',
24
- './plugins/utilities'
24
+ './plugins/utilities',
25
25
  ],
26
26
  rules: {
27
27
  'alpha-value-notation': 'number',
@@ -41,7 +41,7 @@ module.exports = {
41
41
  '/^transition/': ['/all/'],
42
42
  '/^background/': ['http:', 'https:'],
43
43
  '/^border/': ['none'],
44
- '/.+/': ['initial']
44
+ '/.+/': ['initial'],
45
45
  },
46
46
  'function-calc-no-unspaced-operator': true,
47
47
  'function-linear-gradient-no-nonstandard-direction': true,
@@ -65,13 +65,13 @@ module.exports = {
65
65
  'primer/no-experimental-vars': [
66
66
  true,
67
67
  {
68
- designTokens: '@primer/primitives/tokens-v2-private/docs/docValues.json'
69
- }
68
+ designTokens: '@primer/primitives/tokens-v2-private/docs/docValues.json',
69
+ },
70
70
  ],
71
71
  'primer/no-override': true,
72
72
  'primer/no-undefined-vars': [
73
73
  true,
74
- {severity: 'warning', files: 'node_modules/@primer/primitives/dist/scss/colors*/*.scss'}
74
+ {severity: 'warning', files: 'node_modules/@primer/primitives/dist/scss/colors*/*.scss'},
75
75
  ],
76
76
  'primer/no-unused-vars': [true, {severity: 'warning'}],
77
77
  'primer/responsive-widths': true,
@@ -96,6 +96,6 @@ module.exports = {
96
96
  'string-no-newline': true,
97
97
  'string-quotes': 'single',
98
98
  'unit-no-unknown': true,
99
- 'value-keyword-case': null
100
- }
99
+ 'value-keyword-case': null,
100
+ },
101
101
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@primer/stylelint-config",
3
- "version": "12.7.2-rc.69b2f10",
3
+ "version": "12.7.3-rc.99e67f7",
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.",
@@ -34,19 +34,19 @@
34
34
  "stylelint-config-standard": "25.0.0",
35
35
  "stylelint-no-unsupported-browser-features": "^5.0.1",
36
36
  "stylelint-order": "^5.0.0",
37
- "stylelint-scss": "^4.0.0",
37
+ "stylelint-scss": "^5.0.1",
38
38
  "tap-map": "^1.0.0"
39
39
  },
40
40
  "devDependencies": {
41
41
  "@changesets/changelog-github": "0.4.7",
42
42
  "@changesets/cli": "2.26.1",
43
- "@github/prettier-config": "0.0.4",
43
+ "@github/prettier-config": "0.0.6",
44
44
  "@primer/css": "^20.0.0",
45
45
  "@primer/primitives": "^7.11.11",
46
46
  "dedent": "0.7.0",
47
47
  "eslint": "8.39.0",
48
- "eslint-plugin-github": "4.3.5",
49
- "eslint-plugin-jest": "27.0.1",
48
+ "eslint-plugin-github": "4.8.0",
49
+ "eslint-plugin-jest": "27.2.3",
50
50
  "eslint-plugin-prettier": "4.2.1",
51
51
  "jest": "29.4.3",
52
52
  "jest-preset-stylelint": "6.1.0",
@@ -21,8 +21,8 @@ module.exports = createVariableRule(
21
21
  '$border-style $border-width $border-color': '$border',
22
22
  '$border-style $border-color $border-width': '$border',
23
23
  '$border-color $border-width $border-style': '$border',
24
- '$border-color $border-style $border-width': '$border'
25
- }
24
+ '$border-color $border-style $border-width': '$border',
25
+ },
26
26
  },
27
27
  'border color': {
28
28
  expects: 'a border color variable',
@@ -35,30 +35,30 @@ module.exports = createVariableRule(
35
35
  /var\(--color-(.+-)*border(-.+)*\)/,
36
36
  /var\(--color-[^)]+\)/,
37
37
  /var\(--borderColor-[^)]+\)/,
38
- /var\((.+-)*borderColor(-.+)*\)/
38
+ /var\((.+-)*borderColor(-.+)*\)/,
39
39
  ],
40
40
  replacements: {
41
- '$border-gray': '$border-color'
42
- }
41
+ '$border-gray': '$border-color',
42
+ },
43
43
  },
44
44
  'border style': {
45
45
  expects: 'a border style variable',
46
46
  props: 'border{,-top,-right,-bottom,-left}-style',
47
- values: ['$border-style', 'none']
47
+ values: ['$border-style', 'none'],
48
48
  },
49
49
  'border width': {
50
50
  expects: 'a border width variable',
51
51
  props: 'border{,-top,-right,-bottom,-left}-width',
52
- values: ['$border-width*', '0']
52
+ values: ['$border-width*', '0'],
53
53
  },
54
54
  'border radius': {
55
55
  expects: 'a border radius variable',
56
56
  props: 'border{,-{top,bottom}-{left,right}}-radius',
57
57
  values: ['$border-radius', '0', '50%', 'inherit'],
58
58
  replacements: {
59
- '100%': '50%'
60
- }
61
- }
59
+ '100%': '50%',
60
+ },
61
+ },
62
62
  },
63
- 'https://primer.style/css/utilities/borders'
63
+ 'https://primer.style/css/utilities/borders',
64
64
  )
@@ -13,10 +13,10 @@ module.exports = createVariableRule(
13
13
  // Match variables in any of the following formats: --color-shadow-*, --color-*-shadow-*, --color-*-shadow, --shadow-*, *shadow*
14
14
  /var\(--color-(.+-)*shadow(-.+)*\)/,
15
15
  /var\(--shadow(-.+)*\)/,
16
- /var\((.+-)*shadow(-.+)*\)/
16
+ /var\((.+-)*shadow(-.+)*\)/,
17
17
  ],
18
- singular: true
19
- }
18
+ singular: true,
19
+ },
20
20
  },
21
- 'https://primer.style/css/utilities/box-shadow'
21
+ 'https://primer.style/css/utilities/box-shadow',
22
22
  )
package/plugins/colors.js CHANGED
@@ -9,7 +9,7 @@ const bgVars = [
9
9
  /var\((.+-)*bgColor(-.+)*\)/,
10
10
  /var\((.+-)*fgColor(-.+)*\)/,
11
11
  /var\((.+-)*borderColor(-.+)*\)/,
12
- /var\((.+-)*iconColor(-.+)*\)/
12
+ /var\((.+-)*iconColor(-.+)*\)/,
13
13
  ]
14
14
 
15
15
  module.exports = createVariableRule(
@@ -17,11 +17,11 @@ module.exports = createVariableRule(
17
17
  {
18
18
  'background-color': {
19
19
  expects: 'a background color variable',
20
- values: bgVars.concat('none', 'transparent')
20
+ values: bgVars.concat('none', 'transparent'),
21
21
  },
22
22
  background: {
23
23
  expects: 'a background color variable',
24
- values: bgVars.concat('none', 'transparent', 'top', 'right', 'bottom', 'left', 'center', '*px', 'url(*)')
24
+ values: bgVars.concat('none', 'transparent', 'top', 'right', 'bottom', 'left', 'center', '*px', 'url(*)'),
25
25
  },
26
26
  'text color': {
27
27
  expects: 'a text color variable',
@@ -35,9 +35,9 @@ module.exports = createVariableRule(
35
35
  /var\(--color-(.+-)*fg(-.+)*\)/,
36
36
  /var\(--color-[^)]+\)/,
37
37
  /var\((.+-)*fgColor(-.+)*\)/,
38
- /var\((.+-)*iconColor(-.+)*\)/
39
- ]
40
- }
38
+ /var\((.+-)*iconColor(-.+)*\)/,
39
+ ],
40
+ },
41
41
  },
42
- 'https://primer.style/primitives/colors'
42
+ 'https://primer.style/primitives/colors',
43
43
  )
@@ -28,7 +28,7 @@ module.exports = function declarationValidator(rules, options = {}) {
28
28
  return {
29
29
  rule,
30
30
  matchesProp: anymatch(props),
31
- validate: Array.isArray(rule.components) ? componentValidator(rule) : valueValidator(rule)
31
+ validate: Array.isArray(rule.components) ? componentValidator(rule) : valueValidator(rule),
32
32
  }
33
33
  })
34
34
  .filter(Boolean)
@@ -88,7 +88,7 @@ module.exports = function declarationValidator(rules, options = {}) {
88
88
  valid: true,
89
89
  errors: [],
90
90
  fixable: false,
91
- replacement: undefined
91
+ replacement: undefined,
92
92
  }
93
93
  } else if (replacements[value]) {
94
94
  let replacement = value
@@ -99,7 +99,7 @@ module.exports = function declarationValidator(rules, options = {}) {
99
99
  valid: false,
100
100
  errors: [{expects, prop, value, replacement}],
101
101
  fixable: true,
102
- replacement
102
+ replacement,
103
103
  }
104
104
  } else {
105
105
  if (nested || singular) {
@@ -107,7 +107,7 @@ module.exports = function declarationValidator(rules, options = {}) {
107
107
  valid: false,
108
108
  errors: [{expects, prop, value}],
109
109
  fixable: false,
110
- replacement: undefined
110
+ replacement: undefined,
111
111
  }
112
112
  }
113
113
 
@@ -144,7 +144,7 @@ module.exports = function declarationValidator(rules, options = {}) {
144
144
  valid,
145
145
  fixable,
146
146
  errors,
147
- replacement
147
+ replacement,
148
148
  }
149
149
  }
150
150
  }
@@ -183,7 +183,7 @@ module.exports = function declarationValidator(rules, options = {}) {
183
183
  if (result.replacement) {
184
184
  parsed.nodes[index] = {
185
185
  type: 'word',
186
- value: result.replacement
186
+ value: result.replacement,
187
187
  }
188
188
  fixable = true
189
189
  }
@@ -206,7 +206,7 @@ module.exports = function declarationValidator(rules, options = {}) {
206
206
  valid: false,
207
207
  errors: [{expects, prop, value: compoundValue, replacement}],
208
208
  fixable: true,
209
- replacement
209
+ replacement,
210
210
  }
211
211
  }
212
212
 
@@ -214,7 +214,7 @@ module.exports = function declarationValidator(rules, options = {}) {
214
214
  valid: errors.length === 0,
215
215
  errors,
216
216
  fixable,
217
- replacement
217
+ replacement,
218
218
  }
219
219
  }
220
220
  }
@@ -5,522 +5,522 @@ module.exports = {
5
5
  color: [
6
6
  {
7
7
  value: 'var(--color-fg-default)',
8
- utilityClass: 'color-fg-default'
8
+ utilityClass: 'color-fg-default',
9
9
  },
10
10
  {
11
11
  value: 'var(--color-fg-muted)',
12
- utilityClass: 'color-fg-muted'
12
+ utilityClass: 'color-fg-muted',
13
13
  },
14
14
  {
15
15
  value: 'var(--color-fg-subtle)',
16
- utilityClass: 'color-fg-subtle'
17
- }
16
+ utilityClass: 'color-fg-subtle',
17
+ },
18
18
  ].concat(
19
19
  colorTypes.map(type => {
20
20
  return {
21
21
  value: `var(--color-${type}-fg)`,
22
- utilityClass: `color-fg-${type}`
22
+ utilityClass: `color-fg-${type}`,
23
23
  }
24
- })
24
+ }),
25
25
  ),
26
26
  'background-color': [
27
27
  {
28
28
  value: 'var(--color-canvas-default)',
29
- utilityClass: 'color-bg-default'
29
+ utilityClass: 'color-bg-default',
30
30
  },
31
31
  {
32
32
  value: 'var(--color-canvas-overlay)',
33
- utilityClass: 'color-bg-overlay'
33
+ utilityClass: 'color-bg-overlay',
34
34
  },
35
35
  {
36
36
  value: 'var(--color-canvas-inset)',
37
- utilityClass: 'color-bg-inset'
37
+ utilityClass: 'color-bg-inset',
38
38
  },
39
39
  {
40
40
  value: 'var(--color-canvas-subtle)',
41
- utilityClass: 'color-bg-subtle'
41
+ utilityClass: 'color-bg-subtle',
42
42
  },
43
43
  {
44
44
  value: 'transparent',
45
- utilityClass: 'color-bg-transparent'
46
- }
45
+ utilityClass: 'color-bg-transparent',
46
+ },
47
47
  ]
48
48
  .concat(
49
49
  colorTypes.map(type => {
50
50
  return {
51
51
  value: `var(--color-${type}-subtle)`,
52
- utilityClass: `color-bg-${type}`
52
+ utilityClass: `color-bg-${type}`,
53
53
  }
54
- })
54
+ }),
55
55
  )
56
56
  .concat(
57
57
  colorTypes.map(type => {
58
58
  return {
59
59
  value: `var(--color-${type}-emphasis)`,
60
- utilityClass: `color-bg-${type}-emphasis`
60
+ utilityClass: `color-bg-${type}-emphasis`,
61
61
  }
62
- })
62
+ }),
63
63
  ),
64
64
  'border-color': [
65
65
  {
66
66
  value: 'var(--color-border-default',
67
- utilityClass: 'color-border-default'
67
+ utilityClass: 'color-border-default',
68
68
  },
69
69
  {
70
70
  value: 'var(--color-border-muted',
71
- utilityClass: 'color-border-muted'
71
+ utilityClass: 'color-border-muted',
72
72
  },
73
73
  {
74
74
  value: 'var(--color-border-subtle',
75
- utilityClass: 'color-border-subtle'
76
- }
75
+ utilityClass: 'color-border-subtle',
76
+ },
77
77
  ]
78
78
  .concat(
79
79
  colorTypes.map(type => {
80
80
  return {
81
81
  value: `var(--color-${type}-muted)`,
82
- utilityClass: `color-border-${type}`
82
+ utilityClass: `color-border-${type}`,
83
83
  }
84
- })
84
+ }),
85
85
  )
86
86
  .concat(
87
87
  colorTypes.map(type => {
88
88
  return {
89
89
  value: `var(--color-${type}-emphasis)`,
90
- utilityClass: `color-border-${type}-emphasis`
90
+ utilityClass: `color-border-${type}-emphasis`,
91
91
  }
92
- })
92
+ }),
93
93
  ),
94
94
  margin: Array.from(new Array(6)).map((_, i) => {
95
95
  return {
96
96
  value: `$spacer-${i + 1}`,
97
- utilityClass: `m-${i + 1}`
97
+ utilityClass: `m-${i + 1}`,
98
98
  }
99
99
  }),
100
100
  'margin-top': Array.from(new Array(6)).map((_, i) => {
101
101
  return {
102
102
  value: `$spacer-${i + 1}`,
103
- utilityClass: `mt-${i + 1}`
103
+ utilityClass: `mt-${i + 1}`,
104
104
  }
105
105
  }),
106
106
  'margin-right': Array.from(new Array(6)).map((_, i) => {
107
107
  return {
108
108
  value: `$spacer-${i + 1}`,
109
- utilityClass: `mr-${i + 1}`
109
+ utilityClass: `mr-${i + 1}`,
110
110
  }
111
111
  }),
112
112
  'margin-bottom': Array.from(new Array(6)).map((_, i) => {
113
113
  return {
114
114
  value: `$spacer-${i + 1}`,
115
- utilityClass: `mb-${i + 1}`
115
+ utilityClass: `mb-${i + 1}`,
116
116
  }
117
117
  }),
118
118
  'margin-left': Array.from(new Array(6)).map((_, i) => {
119
119
  return {
120
120
  value: `$spacer-${i + 1}`,
121
- utilityClass: `ml-${i + 1}`
121
+ utilityClass: `ml-${i + 1}`,
122
122
  }
123
123
  }),
124
124
  padding: Array.from(new Array(6)).map((_, i) => {
125
125
  return {
126
126
  value: `$spacer-${i + 1}`,
127
- utilityClass: `p-${i + 1}`
127
+ utilityClass: `p-${i + 1}`,
128
128
  }
129
129
  }),
130
130
  'padding-top': Array.from(new Array(6)).map((_, i) => {
131
131
  return {
132
132
  value: `$spacer-${i + 1}`,
133
- utilityClass: `pt-${i + 1}`
133
+ utilityClass: `pt-${i + 1}`,
134
134
  }
135
135
  }),
136
136
  'padding-right': Array.from(new Array(6)).map((_, i) => {
137
137
  return {
138
138
  value: `$spacer-${i + 1}`,
139
- utilityClass: `pr-${i + 1}`
139
+ utilityClass: `pr-${i + 1}`,
140
140
  }
141
141
  }),
142
142
  'padding-bottom': Array.from(new Array(6)).map((_, i) => {
143
143
  return {
144
144
  value: `$spacer-${i + 1}`,
145
- utilityClass: `pb-${i + 1}`
145
+ utilityClass: `pb-${i + 1}`,
146
146
  }
147
147
  }),
148
148
  'padding-left': Array.from(new Array(6)).map((_, i) => {
149
149
  return {
150
150
  value: `$spacer-${i + 1}`,
151
- utilityClass: `pl-${i + 1}`
151
+ utilityClass: `pl-${i + 1}`,
152
152
  }
153
153
  }),
154
154
  'line-height': [
155
155
  {
156
156
  value: '$lh-condensed-ultra',
157
- utilityClass: 'lh-condensed-ultra'
157
+ utilityClass: 'lh-condensed-ultra',
158
158
  },
159
159
  {
160
160
  value: '$lh-condensed',
161
- utilityClass: 'lh-condensed'
161
+ utilityClass: 'lh-condensed',
162
162
  },
163
163
  {
164
164
  value: '$lh-default',
165
- utilityClass: 'lh-default'
165
+ utilityClass: 'lh-default',
166
166
  },
167
167
  {
168
168
  value: '0',
169
- utilityClass: 'lh-0'
170
- }
169
+ utilityClass: 'lh-0',
170
+ },
171
171
  ],
172
172
  'text-align': [
173
173
  {
174
174
  value: 'left',
175
- utilityClass: 'text-left'
175
+ utilityClass: 'text-left',
176
176
  },
177
177
  {
178
178
  value: 'right',
179
- utilityClass: 'text-right'
179
+ utilityClass: 'text-right',
180
180
  },
181
181
  {
182
182
  value: 'center',
183
- utilityClass: 'text-center'
184
- }
183
+ utilityClass: 'text-center',
184
+ },
185
185
  ],
186
186
  'font-style': [
187
187
  {
188
188
  value: 'italic',
189
- utilityClass: 'text-italic'
190
- }
189
+ utilityClass: 'text-italic',
190
+ },
191
191
  ],
192
192
  'text-transform': [
193
193
  {
194
194
  value: 'uppercase',
195
- utilityClass: 'text-uppercase'
196
- }
195
+ utilityClass: 'text-uppercase',
196
+ },
197
197
  ],
198
198
  'text-decoration': [
199
199
  {
200
200
  value: 'underline',
201
- utilityClass: 'text-underline'
201
+ utilityClass: 'text-underline',
202
202
  },
203
203
  {
204
204
  value: 'none',
205
- utilityClass: 'no-underline'
206
- }
205
+ utilityClass: 'no-underline',
206
+ },
207
207
  ],
208
208
  'white-space': [
209
209
  {
210
210
  value: 'nowrap',
211
- utilityClass: 'no-wrap'
211
+ utilityClass: 'no-wrap',
212
212
  },
213
213
  {
214
214
  value: 'normal',
215
- utilityClass: 'ws-normal'
216
- }
215
+ utilityClass: 'ws-normal',
216
+ },
217
217
  ],
218
218
  'word-break': [
219
219
  {
220
220
  value: 'break-all',
221
- utilityClass: 'wb-break-all'
222
- }
221
+ utilityClass: 'wb-break-all',
222
+ },
223
223
  ],
224
224
  width: [
225
225
  {
226
226
  value: '100%',
227
- utilityClass: 'width-full'
227
+ utilityClass: 'width-full',
228
228
  },
229
229
  {
230
230
  value: 'auto%',
231
- utilityClass: 'width-auto'
232
- }
231
+ utilityClass: 'width-auto',
232
+ },
233
233
  ],
234
234
  overflow: [
235
235
  {
236
236
  value: 'visible',
237
- utilityClass: 'overflow-visible'
237
+ utilityClass: 'overflow-visible',
238
238
  },
239
239
  {
240
240
  value: 'hidden',
241
- utilityClass: 'overflow-hidden'
241
+ utilityClass: 'overflow-hidden',
242
242
  },
243
243
  {
244
244
  value: 'auto',
245
- utilityClass: 'overflow-auto'
245
+ utilityClass: 'overflow-auto',
246
246
  },
247
247
  {
248
248
  value: 'scroll',
249
- utilityClass: 'overflow-scroll'
250
- }
249
+ utilityClass: 'overflow-scroll',
250
+ },
251
251
  ],
252
252
  'overflow-x': [
253
253
  {
254
254
  value: 'visible',
255
- utilityClass: 'overflow-x-visible'
255
+ utilityClass: 'overflow-x-visible',
256
256
  },
257
257
  {
258
258
  value: 'hidden',
259
- utilityClass: 'overflow-x-hidden'
259
+ utilityClass: 'overflow-x-hidden',
260
260
  },
261
261
  {
262
262
  value: 'auto',
263
- utilityClass: 'overflow-x-auto'
263
+ utilityClass: 'overflow-x-auto',
264
264
  },
265
265
  {
266
266
  value: 'scroll',
267
- utilityClass: 'overflow-x-scroll'
268
- }
267
+ utilityClass: 'overflow-x-scroll',
268
+ },
269
269
  ],
270
270
  'overflow-y': [
271
271
  {
272
272
  value: 'visible',
273
- utilityClass: 'overflow-y-visible'
273
+ utilityClass: 'overflow-y-visible',
274
274
  },
275
275
  {
276
276
  value: 'hidden',
277
- utilityClass: 'overflow-y-hidden'
277
+ utilityClass: 'overflow-y-hidden',
278
278
  },
279
279
  {
280
280
  value: 'auto',
281
- utilityClass: 'overflow-y-auto'
281
+ utilityClass: 'overflow-y-auto',
282
282
  },
283
283
  {
284
284
  value: 'scroll',
285
- utilityClass: 'overflow-y-scroll'
286
- }
285
+ utilityClass: 'overflow-y-scroll',
286
+ },
287
287
  ],
288
288
  height: [
289
289
  {
290
290
  value: '100%',
291
- utilityClass: 'height-full'
292
- }
291
+ utilityClass: 'height-full',
292
+ },
293
293
  ],
294
294
  'max-width': [
295
295
  {
296
296
  value: '100%',
297
- utilityClass: 'width-fit'
298
- }
297
+ utilityClass: 'width-fit',
298
+ },
299
299
  ],
300
300
  'max-height': [
301
301
  {
302
302
  value: '100%',
303
- utilityClass: 'height-fit'
304
- }
303
+ utilityClass: 'height-fit',
304
+ },
305
305
  ],
306
306
  'min-width': [
307
307
  {
308
308
  value: '0',
309
- utilityClass: 'min-width-0'
310
- }
309
+ utilityClass: 'min-width-0',
310
+ },
311
311
  ],
312
312
  float: [
313
313
  {
314
314
  value: 'left',
315
- utilityClass: 'float-left'
315
+ utilityClass: 'float-left',
316
316
  },
317
317
  {
318
318
  value: 'right',
319
- utilityClass: 'float-right'
319
+ utilityClass: 'float-right',
320
320
  },
321
321
  {
322
322
  value: 'none',
323
- utilityClass: 'float-none'
324
- }
323
+ utilityClass: 'float-none',
324
+ },
325
325
  ],
326
326
  'list-style': [
327
327
  {
328
328
  value: 'none',
329
- utilityClass: 'list-style-none'
330
- }
329
+ utilityClass: 'list-style-none',
330
+ },
331
331
  ],
332
332
  'user-select': [
333
333
  {
334
334
  value: 'none',
335
- utilityClass: 'user-select-none'
336
- }
335
+ utilityClass: 'user-select-none',
336
+ },
337
337
  ],
338
338
  visibility: [
339
339
  {
340
340
  value: 'hidden',
341
- utilityClass: 'v-hidden'
341
+ utilityClass: 'v-hidden',
342
342
  },
343
343
  {
344
344
  value: 'visible',
345
- utilityClass: 'v-visible'
346
- }
345
+ utilityClass: 'v-visible',
346
+ },
347
347
  ],
348
348
  'vertical-align': [
349
349
  {
350
350
  value: 'middle',
351
- utilityClass: 'v-align-middle'
351
+ utilityClass: 'v-align-middle',
352
352
  },
353
353
  {
354
354
  value: 'top',
355
- utilityClass: 'v-align-top'
355
+ utilityClass: 'v-align-top',
356
356
  },
357
357
  {
358
358
  value: 'bottom',
359
- utilityClass: 'v-align-bottom'
359
+ utilityClass: 'v-align-bottom',
360
360
  },
361
361
  {
362
362
  value: 'text-top',
363
- utilityClass: 'v-align-text-top'
363
+ utilityClass: 'v-align-text-top',
364
364
  },
365
365
  {
366
366
  value: 'text-bottom',
367
- utilityClass: 'v-align-text-bottom'
367
+ utilityClass: 'v-align-text-bottom',
368
368
  },
369
369
  {
370
370
  value: 'text-baseline',
371
- utilityClass: 'v-align-baseline'
372
- }
371
+ utilityClass: 'v-align-baseline',
372
+ },
373
373
  ],
374
374
  'font-weight': [
375
375
  {
376
376
  value: '$font-weight-normal',
377
- utilityClass: 'text-normal'
377
+ utilityClass: 'text-normal',
378
378
  },
379
379
  {
380
380
  value: '$font-weight-bold',
381
- utilityClass: 'text-bold'
381
+ utilityClass: 'text-bold',
382
382
  },
383
383
  {
384
384
  value: '$font-weight-semibold',
385
- utilityClass: 'text-semibold'
385
+ utilityClass: 'text-semibold',
386
386
  },
387
387
  {
388
388
  value: '$font-weight-light',
389
- utilityClass: 'text-light'
390
- }
389
+ utilityClass: 'text-light',
390
+ },
391
391
  ],
392
392
  top: [
393
393
  {
394
394
  value: '0',
395
- utilityClass: 'top-0'
395
+ utilityClass: 'top-0',
396
396
  },
397
397
  {
398
398
  value: 'auto',
399
- utilityClass: 'top-auto'
400
- }
399
+ utilityClass: 'top-auto',
400
+ },
401
401
  ],
402
402
  right: [
403
403
  {
404
404
  value: '0',
405
- utilityClass: 'right-0'
405
+ utilityClass: 'right-0',
406
406
  },
407
407
  {
408
408
  value: 'auto',
409
- utilityClass: 'right-auto'
410
- }
409
+ utilityClass: 'right-auto',
410
+ },
411
411
  ],
412
412
  bottom: [
413
413
  {
414
414
  value: '0',
415
- utilityClass: 'bottom-0'
415
+ utilityClass: 'bottom-0',
416
416
  },
417
417
  {
418
418
  value: 'auto',
419
- utilityClass: 'bottom-auto'
420
- }
419
+ utilityClass: 'bottom-auto',
420
+ },
421
421
  ],
422
422
  left: [
423
423
  {
424
424
  value: '0',
425
- utilityClass: 'left-0'
425
+ utilityClass: 'left-0',
426
426
  },
427
427
  {
428
428
  value: 'auto',
429
- utilityClass: 'left-auto'
430
- }
429
+ utilityClass: 'left-auto',
430
+ },
431
431
  ],
432
432
  position: [
433
433
  {
434
434
  value: 'static',
435
- utilityClass: 'position-static'
435
+ utilityClass: 'position-static',
436
436
  },
437
437
  {
438
438
  value: 'relative',
439
- utilityClass: 'position-relative'
439
+ utilityClass: 'position-relative',
440
440
  },
441
441
  {
442
442
  value: 'absolute',
443
- utilityClass: 'position-absolute'
443
+ utilityClass: 'position-absolute',
444
444
  },
445
445
  {
446
446
  value: 'fixed',
447
- utilityClass: 'position-fixed'
447
+ utilityClass: 'position-fixed',
448
448
  },
449
449
  {
450
450
  value: 'sticky',
451
- utilityClass: 'position-sticky'
452
- }
451
+ utilityClass: 'position-sticky',
452
+ },
453
453
  ],
454
454
  'box-shadow': [
455
455
  {
456
456
  value: 'none',
457
- utilityClass: 'box-shadow-none'
457
+ utilityClass: 'box-shadow-none',
458
458
  },
459
459
  {
460
460
  value: 'var(--color-shadow-small)',
461
- utilityClass: 'box-shadow-small'
461
+ utilityClass: 'box-shadow-small',
462
462
  },
463
463
  {
464
464
  value: 'var(--color-shadow-medium)',
465
- utilityClass: 'box-shadow-medium'
465
+ utilityClass: 'box-shadow-medium',
466
466
  },
467
467
  {
468
468
  value: 'var(--color-shadow-large)',
469
- utilityClass: 'box-shadow-large'
469
+ utilityClass: 'box-shadow-large',
470
470
  },
471
471
  {
472
472
  value: 'var(--color-shadow-extra-large)',
473
- utilityClass: 'box-shadow-extra-large'
474
- }
473
+ utilityClass: 'box-shadow-extra-large',
474
+ },
475
475
  ],
476
476
  border: [
477
477
  {
478
478
  value: '$border',
479
- utilityClass: 'border'
479
+ utilityClass: 'border',
480
480
  },
481
481
  {
482
482
  value: '0',
483
- utilityClass: 'border-0'
484
- }
483
+ utilityClass: 'border-0',
484
+ },
485
485
  ],
486
486
  'border-top': [
487
487
  {
488
488
  value: '$border',
489
- utilityClass: 'border-top'
489
+ utilityClass: 'border-top',
490
490
  },
491
491
  {
492
492
  value: '0',
493
- utilityClass: 'border-top-0'
494
- }
493
+ utilityClass: 'border-top-0',
494
+ },
495
495
  ],
496
496
  'border-right': [
497
497
  {
498
498
  value: '$border',
499
- utilityClass: 'border-right'
499
+ utilityClass: 'border-right',
500
500
  },
501
501
  {
502
502
  value: '0',
503
- utilityClass: 'border-right-0'
504
- }
503
+ utilityClass: 'border-right-0',
504
+ },
505
505
  ],
506
506
  'border-bottom': [
507
507
  {
508
508
  value: '$border',
509
- utilityClass: 'border-bottom'
509
+ utilityClass: 'border-bottom',
510
510
  },
511
511
  {
512
512
  value: '0',
513
- utilityClass: 'border-bottom-0'
514
- }
513
+ utilityClass: 'border-bottom-0',
514
+ },
515
515
  ],
516
516
  'border-left': [
517
517
  {
518
518
  value: '$border',
519
- utilityClass: 'border-left'
519
+ utilityClass: 'border-left',
520
520
  },
521
521
  {
522
522
  value: '0',
523
- utilityClass: 'border-left-0'
524
- }
525
- ]
523
+ utilityClass: 'border-left-0',
524
+ },
525
+ ],
526
526
  }
@@ -3,7 +3,7 @@ const {join} = require('path')
3
3
 
4
4
  module.exports = {
5
5
  getPrimerModuleDir,
6
- requirePrimerFile
6
+ requirePrimerFile,
7
7
  }
8
8
 
9
9
  function getPrimerModuleDir() {
@@ -876,7 +876,7 @@
876
876
  "--color-canvas-inset": [
877
877
  {
878
878
  "props": ["background"],
879
- "replacement": "--bgColor-muted"
879
+ "replacement": "--bgColor-inset"
880
880
  }
881
881
  ],
882
882
  "--color-canvas-subtle": [
@@ -10,7 +10,7 @@ module.exports = {
10
10
  createVariableRule,
11
11
  CSS_DIRECTIONS,
12
12
  CSS_CORNERS,
13
- CSS_IMPORTANT
13
+ CSS_IMPORTANT,
14
14
  }
15
15
 
16
16
  function createVariableRule(ruleName, rules, url) {
@@ -79,7 +79,7 @@ function createVariableRule(ruleName, rules, url) {
79
79
  return `${m}. See ${url}.`
80
80
  }
81
81
  return `${m}.`
82
- }
82
+ },
83
83
  })
84
84
  .rejected(error)
85
85
 
@@ -87,7 +87,7 @@ function createVariableRule(ruleName, rules, url) {
87
87
  message,
88
88
  node: decl,
89
89
  result,
90
- ruleName
90
+ ruleName,
91
91
  })
92
92
  }
93
93
  }
@@ -9,7 +9,7 @@ const messages = stylelint.utils.ruleMessages(ruleName, {
9
9
  }
10
10
 
11
11
  return `Variable ${varName} is deprecated for property ${property}. Please use the replacement ${replacement}.`
12
- }
12
+ },
13
13
  })
14
14
 
15
15
  // Match CSS variable references (e.g var(--color-text-primary))
@@ -84,7 +84,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, contex
84
84
  message: messages.rejected(variableName, replacement, node.prop),
85
85
  node,
86
86
  ruleName,
87
- result
87
+ result,
88
88
  })
89
89
  }
90
90
  }
@@ -92,7 +92,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, contex
92
92
  }
93
93
 
94
94
  log(
95
- `${Object.keys(replacedVars).length} deprecated variables replaced with ${Object.keys(newVars).length} variables.`
95
+ `${Object.keys(replacedVars).length} deprecated variables replaced with ${Object.keys(newVars).length} variables.`,
96
96
  )
97
97
  return lintResult
98
98
  })
@@ -5,7 +5,7 @@ const ruleName = 'primer/no-experimental-vars'
5
5
  const messages = stylelint.utils.ruleMessages(ruleName, {
6
6
  rejected: value => {
7
7
  return `Do not use experimental variable \`var(--${value})\`. Experimental variables are undergoing testing, see https://github.com/github/primer/issues/889 for more details.`
8
- }
8
+ },
9
9
  })
10
10
 
11
11
  // eslint-disable-next-line no-unused-vars
@@ -31,7 +31,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, contex
31
31
  message: messages.rejected(expVar),
32
32
  node: decl,
33
33
  result,
34
- ruleName
34
+ ruleName,
35
35
  })
36
36
  }
37
37
  }
@@ -52,7 +52,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}) => {
52
52
  const ruleSelector = collapseWhitespace(rule.selector)
53
53
  const context = selector === rule.selector ? '' : ` in "${ruleSelector}"`
54
54
  return `"${collapseWhitespace(selector)}" should not be overridden${context}${definedIn}.`
55
- }
55
+ },
56
56
  })
57
57
 
58
58
  return (root, result) => {
@@ -62,7 +62,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}) => {
62
62
  : '(not an array)'
63
63
  result.warn(`The "bundles" option must be an array of valid bundles; got: ${invalidBundles}`, {
64
64
  stylelintType: 'invalidOption',
65
- stylelintReference: 'https://github.com/primer/stylelint-config#options'
65
+ stylelintReference: 'https://github.com/primer/stylelint-config#options',
66
66
  })
67
67
  }
68
68
 
@@ -71,7 +71,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}) => {
71
71
  message: messages.rejected(subject),
72
72
  node: subject.rule,
73
73
  result,
74
- ruleName
74
+ ruleName,
75
75
  })
76
76
 
77
77
  root.walkRules(rule => {
@@ -82,7 +82,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}) => {
82
82
  return report({
83
83
  rule,
84
84
  bundle: immutableSelectors.get(selector),
85
- selector
85
+ selector,
86
86
  })
87
87
  }
88
88
  } else {
@@ -95,7 +95,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}) => {
95
95
  return report({
96
96
  rule,
97
97
  bundle: immutableClassSelectors.get(classSelector),
98
- selector: classSelector
98
+ selector: classSelector,
99
99
  })
100
100
  }
101
101
  }
@@ -4,7 +4,7 @@ const matchAll = require('string.prototype.matchall')
4
4
  const ruleName = 'primer/no-scale-colors'
5
5
  const messages = stylelint.utils.ruleMessages(ruleName, {
6
6
  rejected: varName =>
7
- `${varName} is a non-functional scale color and cannot be used without being wrapped in the color-variables mixin`
7
+ `${varName} is a non-functional scale color and cannot be used without being wrapped in the color-variables mixin`,
8
8
  })
9
9
 
10
10
  // Match CSS variable references (e.g var(--color-text-primary))
@@ -39,7 +39,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}) => {
39
39
  message: messages.rejected(variableName),
40
40
  node: decl,
41
41
  result,
42
- ruleName
42
+ ruleName,
43
43
  })
44
44
  }
45
45
  }
@@ -6,7 +6,7 @@ const TapMap = require('tap-map')
6
6
 
7
7
  const ruleName = 'primer/no-undefined-vars'
8
8
  const messages = stylelint.utils.ruleMessages(ruleName, {
9
- rejected: varName => `${varName} is not defined`
9
+ rejected: varName => `${varName} is not defined`,
10
10
  })
11
11
 
12
12
  // Match CSS variable definitions (e.g. --color-text-primary:)
@@ -40,7 +40,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}) => {
40
40
  message: messages.rejected(variableName),
41
41
  node,
42
42
  result,
43
- ruleName
43
+ ruleName,
44
44
  })
45
45
  }
46
46
  }
@@ -80,7 +80,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}) => {
80
80
  checkVariable(
81
81
  variableName,
82
82
  decl,
83
- new Set([...globalDefinedVariables, ...fileDefinedVariables, ...scopeDefinedVaribles])
83
+ new Set([...globalDefinedVariables, ...fileDefinedVariables, ...scopeDefinedVaribles]),
84
84
  )
85
85
  }
86
86
  })
@@ -11,7 +11,7 @@ const COLON = ':'
11
11
  const SCSS_VARIABLE_PATTERN = /(\$[-\w]+)/g
12
12
 
13
13
  const messages = stylelint.utils.ruleMessages(ruleName, {
14
- rejected: name => `The variable "${name}" is not referenced.`
14
+ rejected: name => `The variable "${name}" is not referenced.`,
15
15
  })
16
16
 
17
17
  const cache = new TapMap()
@@ -35,7 +35,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}) => {
35
35
  message: messages.rejected(name),
36
36
  node: decl,
37
37
  result,
38
- ruleName
38
+ ruleName,
39
39
  })
40
40
  } else {
41
41
  const path = stripCwd(decl.source.input.file)
@@ -7,7 +7,7 @@ const ruleName = 'primer/responsive-widths'
7
7
  const messages = stylelint.utils.ruleMessages(ruleName, {
8
8
  rejected: value => {
9
9
  return `A value larger than the smallest viewport could break responsive pages. Use a width value smaller than ${value}. https://primer.style/css/support/breakpoints`
10
- }
10
+ },
11
11
  })
12
12
 
13
13
  // 320px is the smallest viewport size that we support
@@ -60,7 +60,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, contex
60
60
  if (parseInt(valueUnit.number) > 320) {
61
61
  problems.push({
62
62
  index: declarationValueIndex(decl) + node.sourceIndex,
63
- message: messages.rejected(node.value)
63
+ message: messages.rejected(node.value),
64
64
  })
65
65
  }
66
66
  break
@@ -68,7 +68,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, contex
68
68
  if (parseInt(valueUnit.number) > 100) {
69
69
  problems.push({
70
70
  index: declarationValueIndex(decl) + node.sourceIndex,
71
- message: messages.rejected(node.value)
71
+ message: messages.rejected(node.value),
72
72
  })
73
73
  }
74
74
  break
@@ -82,7 +82,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, contex
82
82
  message: err.message,
83
83
  node: decl,
84
84
  result,
85
- ruleName
85
+ ruleName,
86
86
  })
87
87
  }
88
88
  }
@@ -21,7 +21,7 @@ const spacerValues = {
21
21
  '$em-spacer-3': '0.25em',
22
22
  '$em-spacer-4': '0.375em',
23
23
  '$em-spacer-5': '0.5em',
24
- '$em-spacer-6': '0.75em'
24
+ '$em-spacer-6': '0.75em',
25
25
  }
26
26
 
27
27
  const ruleName = 'primer/spacing'
@@ -32,7 +32,7 @@ const messages = stylelint.utils.ruleMessages(ruleName, {
32
32
  }
33
33
 
34
34
  return `Please replace ${value} with spacing variable '${replacement}'.`
35
- }
35
+ },
36
36
  })
37
37
 
38
38
  const walkGroups = (root, validate) => {
@@ -83,7 +83,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, contex
83
83
  // If the a variable is found in the value, skip it.
84
84
  if (
85
85
  Object.keys(spacerValues).some(variable =>
86
- new RegExp(`${variable.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\b`).test(cleanValue)
86
+ new RegExp(`${variable.replace(/[.*+?^${}()|[\]\\]/g, '\\$&')}\\b`).test(cleanValue),
87
87
  )
88
88
  ) {
89
89
  return
@@ -97,7 +97,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, contex
97
97
  } else {
98
98
  problems.push({
99
99
  index: declarationValueIndex(decl) + node.sourceIndex,
100
- message: messages.rejected(valueMatch, replacement)
100
+ message: messages.rejected(valueMatch, replacement),
101
101
  })
102
102
  }
103
103
 
@@ -115,7 +115,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, contex
115
115
  message: err.message,
116
116
  node: decl,
117
117
  result,
118
- ruleName
118
+ ruleName,
119
119
  })
120
120
  }
121
121
  }
@@ -5,20 +5,20 @@ module.exports = createVariableRule(
5
5
  {
6
6
  'font-size': {
7
7
  expects: 'a font-size variable',
8
- values: ['$body-font-size', '$h{000,00,0,1,2,3,4,5,6}-size', '$font-size-*', '1', '1em', 'inherit']
8
+ values: ['$body-font-size', '$h{000,00,0,1,2,3,4,5,6}-size', '$font-size-*', '1', '1em', 'inherit'],
9
9
  },
10
10
  'font-weight': {
11
11
  props: 'font-weight',
12
12
  values: ['$font-weight-*', 'inherit'],
13
13
  replacements: {
14
14
  bold: '$font-weight-bold',
15
- normal: '$font-weight-normal'
16
- }
15
+ normal: '$font-weight-normal',
16
+ },
17
17
  },
18
18
  'line-height': {
19
19
  props: 'line-height',
20
- values: ['$body-line-height', '$lh-*', '0', '1', '1em', 'inherit']
21
- }
20
+ values: ['$body-line-height', '$lh-*', '0', '1', '1em', 'inherit'],
21
+ },
22
22
  },
23
- 'https://primer.style/css/utilities/typography'
23
+ 'https://primer.style/css/utilities/typography',
24
24
  )
@@ -6,7 +6,7 @@ const ruleName = 'primer/utilities'
6
6
  const messages = stylelint.utils.ruleMessages(ruleName, {
7
7
  rejected: (selector, utilityClass) => {
8
8
  return `Consider using the Primer utility '.${utilityClass}' instead of the selector '${selector}' in your html. https://primer.style/css/utilities`
9
- }
9
+ },
10
10
  })
11
11
 
12
12
  // eslint-disable-next-line no-unused-vars
@@ -39,7 +39,7 @@ module.exports = stylelint.createPlugin(ruleName, (enabled, options = {}, contex
39
39
  message: messages.rejected(rule.selector, replacement.utilityClass),
40
40
  node: rule,
41
41
  result,
42
- ruleName
42
+ ruleName,
43
43
  })
44
44
  }
45
45
  }
package/property-order.js CHANGED
@@ -168,5 +168,5 @@ module.exports = [
168
168
  'animation-timing-function',
169
169
  'animation-delay',
170
170
  'animation-iteration-count',
171
- 'animation-direction'
171
+ 'animation-direction',
172
172
  ]