Skip to content

Commit 4435db4

Browse files
Merge branch 'main' into bs/rule-for-tooltip-v2
2 parents 4f7c1d1 + 29d7638 commit 4435db4

25 files changed

+821
-1623
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
# All changes should be reviewed by a member of the @react-reviewers team
2-
* @primer/react-reviewers
2+
* @primer/engineer-reviewers

.github/workflows/release_canary.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ jobs:
4949
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5050

5151
- name: Output canary version number
52-
uses: actions/github-script@v6.4.1
52+
uses: actions/github-script@v7.0.1
5353
with:
5454
script: |
5555
const package = require(`${process.env.GITHUB_WORKSPACE}/package.json`)

.github/workflows/release_candidate.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
4545

4646
- name: Output release candidate version number
47-
uses: actions/github-script@v6.4.1
47+
uses: actions/github-script@v7.0.1
4848
with:
4949
script: |
5050
const package = require(`${process.env.GITHUB_WORKSPACE}/package.json`)

CHANGELOG.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,41 @@
11
# eslint-plugin-primer-react
22

3+
## 5.0.0
4+
5+
### Major Changes
6+
7+
- [#174](https://github.com/primer/eslint-plugin-primer-react/pull/174) [`d9832b8`](https://github.com/primer/eslint-plugin-primer-react/commit/d9832b850cbcf808ddcdfd3efbbab7d2bf913ccd) Thanks [@langermank](https://github.com/langermank)! - - Remove `no-deprecated-colors` plugin
8+
9+
- Remove dependency on `primer/primitives`
10+
11+
- [#172](https://github.com/primer/eslint-plugin-primer-react/pull/172) [`8e24d66`](https://github.com/primer/eslint-plugin-primer-react/commit/8e24d660065b3c690a14d826580c793d7b305068) Thanks [@langermank](https://github.com/langermank)! - [Breaking] Remove `new-color-css-vars-have-fallback`
12+
13+
## 4.2.0
14+
15+
### Minor Changes
16+
17+
- [#156](https://github.com/primer/eslint-plugin-primer-react/pull/156) [`15cfbb4`](https://github.com/primer/eslint-plugin-primer-react/commit/15cfbb4a261c44418404249cc33e279bce25b2b7) Thanks [@broccolinisoup](https://github.com/broccolinisoup)! - Add no-deprecated-props rule
18+
19+
### Patch Changes
20+
21+
- [#166](https://github.com/primer/eslint-plugin-primer-react/pull/166) [`4c3d9b4`](https://github.com/primer/eslint-plugin-primer-react/commit/4c3d9b4e761733ac52f4d624a94996a4379c37ca) Thanks [@chadfawcett](https://github.com/chadfawcett)! - Move eslint-plugin-github to dependencies
22+
23+
- [#152](https://github.com/primer/eslint-plugin-primer-react/pull/152) [`7baeb96`](https://github.com/primer/eslint-plugin-primer-react/commit/7baeb9684cc5f84847f004fee282a3362517d7d0) Thanks [@siddharthkp](https://github.com/siddharthkp)! - no-system-props: Add option to ignore specific component names
24+
25+
## 4.1.2
26+
27+
### Patch Changes
28+
29+
- [#148](https://github.com/primer/eslint-plugin-primer-react/pull/148) [`523e169`](https://github.com/primer/eslint-plugin-primer-react/commit/523e169a3c6c801750d451e875c83f52e383c772) Thanks [@siddharthkp](https://github.com/siddharthkp)! - no-system-props: skip html elements
30+
31+
- [#149](https://github.com/primer/eslint-plugin-primer-react/pull/149) [`ca14bb6`](https://github.com/primer/eslint-plugin-primer-react/commit/ca14bb695ad296903bfe7598b4eb81291796245a) Thanks [@siddharthkp](https://github.com/siddharthkp)! - no-system-props: allow maxWidth prop for Truncate
32+
33+
## 4.1.1
34+
35+
### Patch Changes
36+
37+
- [#145](https://github.com/primer/eslint-plugin-primer-react/pull/145) [`0369cb8`](https://github.com/primer/eslint-plugin-primer-react/commit/0369cb857dd49945ac7929444ffacb2ecc02a2ed) Thanks [@siddharthkp](https://github.com/siddharthkp)! - no-system-props: Add `position` as allowed prop for `Dialog`
38+
339
## 4.1.0
440

541
### Minor Changes

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,8 +32,8 @@ ESLint rules for Primer React
3232
## Rules
3333

3434
- [direct-slot-children](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/direct-slot-children.md)
35-
- [no-deprecated-colors](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/no-deprecated-colors.md)
3635
- [no-system-props](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/no-system-props.md)
3736
- [a11y-tooltip-interactive-trigger](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/a11y-tooltip-interactive-trigger.md)
3837
- [a11y-explicit-heading](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/a11y-explicit-heading.md)
3938
- [new-css-color-vars](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/new-css-color-vars.md)
39+
- [no-deprecated-props](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/no-deprecated-props.md)

docs/rules/new-color-css-vars-have-fallback.md

Lines changed: 0 additions & 25 deletions
This file was deleted.

docs/rules/new-css-color-vars.md

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

33
CSS variables are allowed within the `sx` prop in Primer React components. However, the legacy color CSS variables are
44
deprecated in favor of the new CSS variables introduced in Primitives v8. This rule will warn you if you are using the
5-
deprecated color CSS variables in the `sx` prop, and autofix it including a fallback to the old value.
5+
deprecated color CSS variables in the `sx` prop, and autofix it.
66

77
## Rule Details
88

@@ -36,5 +36,5 @@ one based on the property. We only check `sx` because `stylelint` is used to lin
3636
👍 Examples of **correct** code for this rule:
3737

3838
```jsx
39-
<Button sx={{color: 'var(--fgColor-muted, var(--color-fg-muted))'}}>Test</Button>
39+
<Button sx={{color: 'var(--fgColor-muted)'}}>Test</Button>
4040
```

docs/rules/no-deprecated-colors.md

Lines changed: 0 additions & 91 deletions
This file was deleted.

docs/rules/no-deprecated-props.md

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
## Rule Details
2+
3+
This rule enforces to use the recommended API (`ActionList.GroupHeading`) component over the deprecated prop (`title` prop on `ActionList.Group`) for ActionList component.
4+
5+
👎 Examples of **incorrect** code for this rule:
6+
7+
```jsx
8+
/* eslint primer-react/no-deprecated-props: "error" */
9+
import {ActionList} from '@primer/react'
10+
11+
const App = () => (
12+
<ActionList>
13+
<ActionList.Group title="Group heading">
14+
<ActionList.Item>Item 1</ActionList.Item>
15+
</ActionList.Group>
16+
</ActionList>
17+
)
18+
```
19+
20+
👍 Examples of **correct** code for this rule:
21+
22+
```jsx
23+
/* eslint primer-react/no-deprecated-props: "error" */
24+
import {ActionList} from '@primer/react'
25+
26+
const App = () => (
27+
<ActionList>
28+
<ActionList.Group>
29+
<ActionList.GroupHeading as="h2">Group heading</ActionList.GroupHeading>
30+
<ActionList.Item>Item 1</ActionList.Item>
31+
</ActionList.Group>
32+
</ActionList>
33+
)
34+
```
35+
36+
```jsx
37+
/* eslint primer-react/no-deprecated-props: "error" */
38+
import {ActionList} from '@primer/react'
39+
40+
const App = () => (
41+
<ActionList role="lisbox">
42+
<ActionList.Group>
43+
<ActionList.GroupHeading>Group heading</ActionList.GroupHeading>
44+
<ActionList.Item>Item 1</ActionList.Item>
45+
</ActionList.Group>
46+
</ActionList>
47+
)
48+
```

0 commit comments

Comments
 (0)