Skip to content

Commit a44c5eb

Browse files
jonrohanlangermank
andauthored
Upgrade @primer/stylelint-config to latest version 13.0.1 (primer#3101)
Co-authored-by: Katie Langerman <18661030+langermank@users.noreply.github.com>
1 parent cc378f6 commit a44c5eb

39 files changed

+660
-1350
lines changed

.devcontainer/devcontainer.json

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -13,25 +13,29 @@
1313
},
1414
"onCreateCommand": ".devcontainer/on-create-command.sh",
1515
"postCreateCommand": ".devcontainer/post-create-command.sh",
16-
"settings": {
17-
"files.watcherExclude": {
18-
"**/vendor": true,
19-
"**/.git": true,
20-
"**/tmp": true,
21-
"**/node_modules": true
22-
}
16+
"customizations": {
17+
"settings": {
18+
"files.watcherExclude": {
19+
"**/vendor": true,
20+
"**/.git": true,
21+
"**/tmp": true,
22+
"**/node_modules": true
23+
}
24+
},
25+
"extensions": [
26+
"castwide.solargraph",
27+
"kaiwood.endwise",
28+
"manuelpuyol.erb-linter",
29+
"misogi.ruby-rubocop",
30+
"rebornix.ruby",
31+
"wingrunr21.vscode-ruby",
32+
"mutantdino.resourcemonitor",
33+
"vunguyentuan.vscode-postcss",
34+
"DavidAnson.vscode-markdownlint",
35+
"stylelint.vscode-stylelint",
36+
"hex-ci.stylelint-plus"
37+
]
2338
},
24-
"extensions": [
25-
"castwide.solargraph",
26-
"kaiwood.endwise",
27-
"manuelpuyol.erb-linter",
28-
"misogi.ruby-rubocop",
29-
"rebornix.ruby",
30-
"wingrunr21.vscode-ruby",
31-
"mutantdino.resourcemonitor",
32-
"vunguyentuan.vscode-postcss",
33-
"DavidAnson.vscode-markdownlint"
34-
],
3539
"forwardPorts": [4000],
3640
"appPort": [4000],
3741
"portsAttributes": {

.github/workflows/lint.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ jobs:
2525
- uses: actions/setup-node@v4
2626
if: steps.changed-files.outputs.any_changed == 'true'
2727
with:
28-
node-version: 16
2928
cache: 'npm'
3029
- name: Lint with Markdownlint
3130
if: steps.changed-files.outputs.any_changed == 'true'
@@ -83,7 +82,6 @@ jobs:
8382
- uses: actions/setup-node@v4
8483
if: steps.changed-files.outputs.any_changed == 'true'
8584
with:
86-
node-version: 16
8785
cache: 'npm'
8886
- name: Lint with ESLint
8987
if: steps.changed-files.outputs.any_changed == 'true'
@@ -105,10 +103,9 @@ jobs:
105103
- uses: actions/setup-node@v4
106104
if: steps.changed-files.outputs.any_changed == 'true'
107105
with:
108-
node-version: 16
109106
cache: 'npm'
110107
- name: Lint with Stylelint
111108
if: steps.changed-files.outputs.any_changed == 'true'
112109
run: |
113110
npm ci
114-
npx stylelint ${{ steps.changed-files.outputs.all_changed_files }} -f "github"
111+
npx stylelint ${{ steps.changed-files.outputs.all_changed_files }} --custom-formatter=stylelint-actions-formatters

.stylelintrc.json

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
{
2-
"extends": ["stylelint-config-standard"],
3-
"plugins": ["@primer/stylelint-config/plugins/no-deprecated-colors"],
2+
"extends": ["@primer/stylelint-config"],
43
"ignoreFiles": ["app/**/*.css", "**/*.js", "**/*.ts"],
54
"rules": {
65
"media-feature-range-notation": null,
@@ -17,7 +16,6 @@
1716
{
1817
"ignoreAtRules": ["mixin", "define-mixin"]
1918
}
20-
],
21-
"primer/no-deprecated-colors": true
19+
]
2220
}
2321
}

.vscode/extensions.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"recommendations": [
3+
"stylelint.vscode-stylelint",
4+
"hex-ci.stylelint-plus"
5+
]
6+
}

.vscode/settings.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
{
22
"explorer.fileNesting.patterns": {
33
"*.rb": "${basename}.rb, ${basename}.html.erb, ${basename}.ts, ${basename}_element.ts, ${basename}.pcss, ${basename}.css*"
4-
}
4+
},
5+
"stylelint.reportNeedlessDisables": true,
6+
"stylelint.validate": [
7+
"css",
8+
"postcss",
9+
"pcss"
10+
]
511
}

app/components/primer/alpha/action_bar.pcss

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
}
1313

1414
.ActionBar-item-container {
15+
height: var(--control-medium-size);
1516
box-sizing: content-box;
1617
overflow: hidden;
17-
height: var(--control-medium-size);
1818
}
1919

2020
.ActionBar-item {
@@ -37,19 +37,22 @@
3737
/* Divider */
3838

3939
.ActionBar-divider {
40+
top: 50%;
41+
bottom: 50%;
42+
float: left;
4043
height: calc(var(--control-medium-size) / 2);
44+
/* stylelint-disable-next-line primer/spacing */
4145
margin: 0 var(--controlStack-medium-gap-condensed);
4246
border-left: var(--borderWidth-thin) solid var(--borderColor-muted);
43-
float: left;
44-
top: 50%;
45-
bottom: 50%;
4647
transform: translateY(-50%);
4748
}
4849

4950
.ActionBar--small .ActionBar-divider {
51+
/* stylelint-disable-next-line primer/spacing */
5052
margin: 0 var(--controlStack-small-gap-condensed);
5153
}
5254

5355
.ActionBar--large .ActionBar-divider {
56+
/* stylelint-disable-next-line primer/spacing */
5457
margin: 0 var(--controlStack-large-gap-condensed);
5558
}

app/components/primer/alpha/action_bar_element.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,8 @@ const resizeObserver = new ResizeObserver(entries => {
2222

2323
// These are definitely used, but eslint is dumb apparently
2424

25-
// eslint-disable-next-line no-unused-vars
2625
enum ItemType {
27-
// eslint-disable-next-line no-unused-vars
2826
Item,
29-
// eslint-disable-next-line no-unused-vars
3027
Divider,
3128
}
3229

@@ -164,7 +161,6 @@ class ActionBarElement extends HTMLElement {
164161
return this.moreMenu.querySelectorAll('[role="menu"] > li')
165162
}
166163

167-
// eslint-disable-next-line no-unused-vars
168164
#eachItem(callback: (item: HTMLElement, index: number, type: ItemType) => boolean): void {
169165
for (let i = 0; i < this.items.length; i++) {
170166
const item = this.items[i]

app/components/primer/alpha/action_list.pcss

Lines changed: 19 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,25 @@
1+
/* stylelint-disable selector-max-compound-selectors */
2+
/* stylelint-disable selector-max-specificity */
3+
/* stylelint-disable max-nesting-depth */
14
:root {
25
--actionListContent-paddingBlock: var(--control-medium-paddingBlock);
36
}
47

58
/* ActionList */
69

10+
/* stylelint-disable-next-line selector-max-type */
711
action-list {
812
display: block;
913
}
1014

15+
/* stylelint-disable-next-line selector-max-type */
1116
nav-list {
1217
display: block;
1318
}
1419

1520
.ActionListHeader {
16-
margin-left: var(--base-size-8);
1721
margin-bottom: var(--base-size-16);
22+
margin-left: var(--base-size-8);
1823
}
1924

2025
/* <ul> */
@@ -32,6 +37,7 @@ nav-list {
3237
.ActionListWrap--divided {
3338
& .ActionListItem-label::before {
3439
position: absolute;
40+
/* stylelint-disable-next-line primer/spacing */
3541
top: calc(-1 * var(--actionListContent-paddingBlock));
3642
display: block;
3743
width: 100%;
@@ -44,6 +50,7 @@ nav-list {
4450
& .ActionListItem-descriptionWrap--inline {
4551
&::before {
4652
position: absolute;
53+
/* stylelint-disable-next-line primer/spacing */
4754
top: calc(-1 * var(--actionListContent-paddingBlock));
4855
display: block;
4956
width: 100%;
@@ -290,7 +297,9 @@ nav-list {
290297
position: relative;
291298
display: grid;
292299
width: 100%;
300+
/* stylelint-disable-next-line primer/spacing */
293301
padding-block: var(--actionListContent-paddingBlock);
302+
/* stylelint-disable-next-line primer/spacing */
294303
padding-inline: var(--control-medium-paddingInline-condensed);
295304
color: var(--control-fgColor-rest);
296305
text-align: left;
@@ -308,6 +317,7 @@ nav-list {
308317

309318
/* column-gap persists with empty grid-areas, margin applies only when children exist */
310319
& > :not(:last-child) {
320+
/* stylelint-disable-next-line primer/spacing */
311321
margin-right: var(--control-medium-gap);
312322
}
313323

@@ -492,7 +502,7 @@ nav-list {
492502

493503
& .ActionListItem-multiSelectIconRect {
494504
fill: var(--bgColor-default);
495-
border: var(--borderWidth-thin, 1px) solid var(--control-borderColor-rest);
505+
border: var(--borderWidth-thin) solid var(--control-borderColor-rest);
496506
}
497507
}
498508

@@ -539,6 +549,7 @@ nav-list {
539549

540550
/* have leading visual svg filled with chosen color */
541551

552+
/* stylelint-disable-next-line selector-max-type */
542553
.ActionListItem-visual--leading svg {
543554
fill: currentcolor;
544555
}
@@ -642,20 +653,22 @@ nav-list {
642653
/* with children */
643654
&:not(:empty) {
644655
display: flex;
645-
padding-inline: var(--actionListContent-paddingBlock);
646-
padding-block: var(--base-size-8);
647656
font-size: var(--text-body-size-small);
648-
line-height: var(--text-body-lineHeight-small);
649657
font-weight: var(--base-text-weight-semibold);
658+
line-height: var(--text-body-lineHeight-small);
650659
color: var(--fgColor-muted);
651660
flex-direction: column;
661+
/* stylelint-disable-next-line primer/spacing */
662+
padding-inline: var(--actionListContent-paddingBlock);
663+
padding-block: var(--base-size-8);
652664
}
653665

654666
/* no children */
655667
&:empty {
656668
display: block;
657669
height: var(--borderWidth-thin);
658670
padding: 0;
671+
/* stylelint-disable-next-line primer/spacing */
659672
margin-block-start: calc(var(--base-size-8) - var(--borderWidth-thin));
660673
margin-block-end: var(--base-size-8);
661674
margin-inline: calc(-1 * var(--base-size-8));
@@ -673,6 +686,7 @@ nav-list {
673686
}
674687

675688
.ActionList-sectionDivider--filled {
689+
/* stylelint-disable-next-line primer/spacing */
676690
margin-block-start: calc(var(--base-size-8) - var(--borderWidth-thin));
677691
margin-block-end: var(--base-size-8);
678692
margin-inline: calc(-1 * var(--base-size-8));

app/components/primer/alpha/auto_complete.pcss

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,20 +6,20 @@
66
/* Stacked label (default) */
77
.autocomplete-label-stacked {
88
display: block;
9-
margin-bottom: 6px;
9+
margin-bottom: var(--base-size-6);
1010
}
1111

1212
/* Inline label (non-default) */
1313
.autocomplete-label-inline {
1414
display: inline;
15-
margin-right: 6px;
15+
margin-right: var(--base-size-6);
1616
}
1717

1818
/* Switch to stacked at smaller viewport */
1919
@media (max-width: 543.98px) {
2020
.autocomplete-label-inline {
2121
display: block;
22-
margin-bottom: 6px;
22+
margin-bottom: var(--base-size-6);
2323
}
2424
}
2525

@@ -32,7 +32,7 @@
3232
/* Wrapper and conditional styles for when an icon is added */
3333
.autocomplete-embedded-icon-wrap {
3434
display: inline-flex;
35-
padding: 4px 8px;
35+
padding: var(--base-size-4) var(--base-size-8);
3636
align-items: center;
3737

3838
&:focus-within {
@@ -43,7 +43,7 @@
4343

4444
& .form-control {
4545
padding: 0;
46-
margin-left: 8px;
46+
margin-left: var(--base-size-8);
4747
border: none;
4848
box-shadow: none;
4949

@@ -66,7 +66,7 @@
6666
min-width: 100%;
6767
max-height: 20em;
6868
overflow-y: auto;
69-
font-size: 13px;
69+
font-size: var(--text-codeBlock-size);
7070
list-style: none;
7171
background: var(--overlay-bgColor);
7272
border: var(--borderWidth-thin) solid var(--borderColor-default);
@@ -80,7 +80,7 @@
8080
.autocomplete-item {
8181
display: block;
8282
width: 100%;
83-
padding: 4px 8px;
83+
padding: var(--base-size-4) var(--base-size-8);
8484
overflow: hidden;
8585
font-weight: var(--base-text-weight-semibold);
8686
color: var(--fgColor-default);

app/components/primer/alpha/banner.pcss

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
& .Banner-visual {
3232
display: grid;
33-
padding: 0.375rem var(--base-size-8);
33+
padding: var(--base-size-6) var(--base-size-8);
3434
grid-area: visual;
3535
align-self: start;
3636

@@ -44,10 +44,11 @@
4444
}
4545

4646
& .Banner-message {
47-
padding: 0.375rem var(--base-size-8);
47+
padding: var(--base-size-6) var(--base-size-8);
4848
grid-area: message;
4949
align-self: center;
5050

51+
/* stylelint-disable-next-line selector-max-type */
5152
& p:last-child {
5253
margin-bottom: 0;
5354
}
@@ -69,6 +70,7 @@
6970
/* is this used anywhere? could not find any use, but unsure */
7071
& .Banner-close {
7172
grid-area: close;
73+
/* stylelint-disable-next-line primer/spacing */
7274
margin-left: var(--controlStack-medium-gap-condensed);
7375
}
7476

@@ -109,6 +111,7 @@
109111
/* Full-width */
110112

111113
&.Banner--full {
114+
/* stylelint-disable-next-line primer/spacing */
112115
margin-top: calc(var(--borderWidth-thin) * -1);
113116
border-right: 0;
114117
border-left: 0;
@@ -117,6 +120,7 @@
117120

118121
@media (max-width: 767.98px) {
119122
&.Banner--full-whenNarrow {
123+
/* stylelint-disable-next-line primer/spacing */
120124
margin-top: calc(var(--borderWidth-thin) * -1);
121125
border-right: 0;
122126
border-left: 0;

0 commit comments

Comments
 (0)