Skip to content

Commit e74e581

Browse files
chore(deps): Bump eslint-plugin-primer-react to v5.4.0 and update the code accordingly (#4766)
* Update primer-react eslint plugin and update the code accordignly * fix linting * disable the rule * disable the rule * Create honest-ligers-fly.md * add role region for pagelayout content
1 parent 75cbb2a commit e74e581

File tree

19 files changed

+61
-136
lines changed

19 files changed

+61
-136
lines changed

.changeset/honest-ligers-fly.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@primer/react": patch
3+
---
4+
5+
chore(deps): Update eslint-plugin-primer-react to latest

.eslintrc.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ module.exports = {
7575
],
7676
},
7777
],
78-
'primer-react/no-deprecated-colors': ['warn', {checkAllStrings: true}],
7978

8079
// Overrides from updating plugin:github
8180
'filenames/match-regex': 'off',
@@ -89,6 +88,7 @@ module.exports = {
8988
'github/no-inner-html': 'off',
9089
'github/role-supports-aria-props': 'off',
9190
'no-restricted-syntax': 'off',
91+
'primer-react/a11y-use-next-tooltip': 'off',
9292
},
9393
overrides: [
9494
// rules which apply only to JS
@@ -241,7 +241,6 @@ module.exports = {
241241
'jsx-a11y/label-has-for': 'off',
242242
'@typescript-eslint/no-unnecessary-condition': 'off',
243243
'@typescript-eslint/no-unused-vars': 'off',
244-
'primer-react/no-deprecated-colors': ['error', {skipImportCheck: true}],
245244
'no-redeclare': 'off',
246245
'ssr-friendly/no-dom-globals-in-module-scope': 'off',
247246
'ssr-friendly/no-dom-globals-in-react-fc': 'off',

docs/content/ActionMenu.mdx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@ You can choose to have a different _anchor_ for the Menu depending on the applic
121121

122122
<ActionMenu.Overlay>
123123
<ActionList showDividers>
124-
<ActionList.Group title="Live query">
124+
<ActionList.Group>
125+
<ActionList.GroupHeading>Live query</ActionList.GroupHeading>
125126
<ActionList.Item>
126127
<ActionList.LeadingVisual>
127128
<SearchIcon />
@@ -130,7 +131,8 @@ You can choose to have a different _anchor_ for the Menu depending on the applic
130131
</ActionList.Item>
131132
</ActionList.Group>
132133
<ActionList.Divider />
133-
<ActionList.Group title="Layout" variant="subtle">
134+
<ActionList.Group variant="subtle">
135+
<ActionList.GroupHeading>Layout</ActionList.GroupHeading>
134136
<ActionList.Item>
135137
<ActionList.LeadingVisual>
136138
<NoteIcon />

package-lock.json

Lines changed: 6 additions & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"eslint-plugin-mdx": "3.0.0",
6565
"eslint-plugin-playwright": "0.15.1",
6666
"eslint-plugin-prettier": "5.0.0",
67-
"eslint-plugin-primer-react": "4.0.2",
67+
"eslint-plugin-primer-react": "5.4.0",
6868
"eslint-plugin-react": "7.32.2",
6969
"eslint-plugin-react-hooks": "4.6.0",
7070
"eslint-plugin-ssr-friendly": "1.3.0",

packages/react/src/ActionList/ActionList.dev.stories.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ export const GroupWithSubtleTitleOldAPI = () => {
4141
under features.
4242
</p>
4343
<ActionList selectionVariant="multiple" role="menu" showDividers aria-label="Reviewers">
44+
{/* eslint-disable-next-line primer-react/no-deprecated-props */}
4445
<ActionList.Group title="Everyone">
4546
{users.slice(2).map(user => (
4647
<ActionList.Item
@@ -80,6 +81,7 @@ export const GroupWithFilledTitleOldAPI = () => {
8081
under features.
8182
</p>
8283
<ActionList selectionVariant="multiple" role="menu" showDividers aria-label="Reviewers">
84+
{/* eslint-disable-next-line primer-react/no-deprecated-props */}
8385
<ActionList.Group title="Everyone" variant="filled">
8486
{users.slice(2).map(user => (
8587
<ActionList.Item

packages/react/src/ActionList/Item.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -181,7 +181,7 @@ export const Item = React.forwardRef<HTMLLIElement, ActionListItemProps>(
181181
cursor: 'not-allowed',
182182
'[data-component="ActionList.Checkbox"]': {
183183
cursor: 'not-allowed',
184-
bg: selected ? 'fg.muted' : 'var(--color-input-disabled-bg, rgba(175, 184, 193, 0.2))',
184+
bg: selected ? 'fg.muted' : 'var(--control-bgColor-disabled, rgba(175, 184, 193, 0.2))',
185185
borderColor: selected ? 'fg.muted' : 'var(--color-input-disabled-bg, rgba(175, 184, 193, 0.2))',
186186
},
187187
},

packages/react/src/ActionMenu/ActionMenu.features.stories.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,8 @@ export const LoadingItems = () => (
219219
</ActionList.LeadingVisual>
220220
</ActionList.Item>
221221
<ActionList.Divider />
222-
<ActionList.Group title="Github projects">
222+
<ActionList.Group>
223+
<ActionList.GroupHeading>Github projects</ActionList.GroupHeading>
223224
<ActionList.LinkItem href="/">
224225
What&apos;s new
225226
<ActionList.LeadingVisual>

packages/react/src/Button/IconButton.dev.stories.tsx

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,7 @@ export default {
77
}
88

99
export const CustomSize = () => (
10-
<IconButton
11-
aria-label="Expand"
12-
variant="primary"
13-
size="small"
14-
icon={ChevronDownIcon}
15-
unsafeDisableTooltip={false}
16-
sx={{width: 16, height: 16}}
17-
/>
10+
<IconButton aria-label="Expand" variant="primary" size="small" icon={ChevronDownIcon} sx={{width: 16, height: 16}} />
1811
)
1912

2013
export const CustomSizeWithMedia = () => {
@@ -24,19 +17,11 @@ export const CustomSizeWithMedia = () => {
2417
variant="primary"
2518
size="small"
2619
icon={ChevronDownIcon}
27-
unsafeDisableTooltip={false}
2820
sx={{'@media (min-width: 123px)': {width: 16, height: 16}}}
2921
/>
3022
)
3123
}
3224

3325
export const CustomIconColor = () => (
34-
<IconButton
35-
aria-label="Expand"
36-
variant="invisible"
37-
size="small"
38-
icon={ChevronDownIcon}
39-
unsafeDisableTooltip={false}
40-
sx={{color: 'red'}}
41-
/>
26+
<IconButton aria-label="Expand" variant="invisible" size="small" icon={ChevronDownIcon} sx={{color: 'red'}} />
4227
)

packages/react/src/Button/IconButton.features.stories.tsx

Lines changed: 10 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -10,41 +10,22 @@ export default {
1010
title: 'Components/IconButton/Features',
1111
}
1212

13-
export const Primary = () => (
14-
<IconButton icon={HeartIcon} variant="primary" aria-label="Favorite" unsafeDisableTooltip={false} />
15-
)
13+
export const Primary = () => <IconButton icon={HeartIcon} variant="primary" aria-label="Favorite" />
1614

17-
export const Danger = () => (
18-
<IconButton icon={HeartIcon} variant="danger" aria-label="Favorite" unsafeDisableTooltip={false} />
19-
)
15+
export const Danger = () => <IconButton icon={HeartIcon} variant="danger" aria-label="Favorite" />
2016

21-
export const Invisible = () => (
22-
<IconButton icon={HeartIcon} variant="invisible" aria-label="Favorite" unsafeDisableTooltip={false} />
23-
)
17+
export const Invisible = () => <IconButton icon={HeartIcon} variant="invisible" aria-label="Favorite" />
2418

25-
export const Disabled = () => (
26-
<IconButton disabled icon={HeartIcon} aria-label="Favorite" unsafeDisableTooltip={false} />
27-
)
19+
export const Disabled = () => <IconButton disabled icon={HeartIcon} aria-label="Favorite" />
2820

29-
export const Small = () => (
30-
<IconButton size="small" icon={HeartIcon} aria-label="Favorite" unsafeDisableTooltip={false} />
31-
)
21+
export const Small = () => <IconButton size="small" icon={HeartIcon} aria-label="Favorite" />
3222

33-
export const Medium = () => (
34-
<IconButton size="medium" icon={HeartIcon} aria-label="Favorite" unsafeDisableTooltip={false} />
35-
)
23+
export const Medium = () => <IconButton size="medium" icon={HeartIcon} aria-label="Favorite" />
3624

37-
export const Large = () => (
38-
<IconButton size="large" icon={HeartIcon} aria-label="Favorite" unsafeDisableTooltip={false} />
39-
)
25+
export const Large = () => <IconButton size="large" icon={HeartIcon} aria-label="Favorite" />
4026

4127
export const WithDescription = () => (
42-
<IconButton
43-
icon={InboxIcon}
44-
aria-label="Notifications"
45-
description="You have no unread notifications."
46-
unsafeDisableTooltip={false}
47-
/>
28+
<IconButton icon={InboxIcon} aria-label="Notifications" description="You have no unread notifications." />
4829
)
4930

5031
export const ExternalTooltip = () => (
@@ -62,7 +43,7 @@ export const ExternalTooltipVersion1 = () => (
6243
export const AsAMenuAnchor = () => (
6344
<ActionMenu>
6445
<ActionMenu.Anchor>
65-
<IconButton icon={ChevronDownIcon} aria-label="Something" unsafeDisableTooltip={false} />
46+
<IconButton icon={ChevronDownIcon} aria-label="Something" />
6647
</ActionMenu.Anchor>
6748

6849
<ActionMenu.Overlay width="medium">
@@ -105,14 +86,11 @@ export const LoadingTrigger = () => {
10586
}
10687
export const KeyshortcutsOnDescription = () => (
10788
<IconButton
108-
unsafeDisableTooltip={false}
10989
icon={InboxIcon}
11090
aria-label="Notifications"
11191
description="You have unread notifications"
11292
keyshortcuts="G+N"
11393
/>
11494
)
11595

116-
export const Keyshortcuts = () => (
117-
<IconButton unsafeDisableTooltip={false} icon={BoldIcon} aria-label="Bold" keyshortcuts="Command+B" />
118-
)
96+
export const Keyshortcuts = () => <IconButton icon={BoldIcon} aria-label="Bold" keyshortcuts="Command+B" />

0 commit comments

Comments
 (0)