eslint-plugin-primer-react 7.0.0-rc.0d4a60c → 7.0.0-rc.1eafbbd

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.
@@ -14,6 +14,6 @@ on:
14
14
  jobs:
15
15
  release-tracking:
16
16
  name: Release Tracking
17
- uses: primer/.github/.github/workflows/release_tracking.yml@v2.1.1
17
+ uses: primer/.github/.github/workflows/release_tracking.yml@v2.2.0
18
18
  secrets:
19
19
  datadog_api_key: ${{ secrets.DATADOG_API_KEY }}
package/CHANGELOG.md CHANGED
@@ -6,12 +6,16 @@
6
6
 
7
7
  - [#270](https://github.com/primer/eslint-plugin-primer-react/pull/270) [`17814a2`](https://github.com/primer/eslint-plugin-primer-react/commit/17814a2d77d752b6675e51124fe3c18671837a10) Thanks [@broccolinisoup](https://github.com/broccolinisoup)! - Update a11y-use-next-tooltip to be a11y-use-accessible-tooltip and make the changes accordingly
8
8
 
9
+ - [#316](https://github.com/primer/eslint-plugin-primer-react/pull/316) [`40016c8`](https://github.com/primer/eslint-plugin-primer-react/commit/40016c8db99b4045ed7474cead0b48eed05f5f64) Thanks [@TylerJDev](https://github.com/TylerJDev)! - Add `a11y-no-title-usage` that warns against using `title` in some components
10
+
9
11
  ### Minor Changes
10
12
 
11
13
  - [#266](https://github.com/primer/eslint-plugin-primer-react/pull/266) [`90134bc`](https://github.com/primer/eslint-plugin-primer-react/commit/90134bcee073c424e81c53e69632e1518798af93) Thanks [@keithamus](https://github.com/keithamus)! - Add enforce-css-module-default-import rule
12
14
 
13
15
  - [#258](https://github.com/primer/eslint-plugin-primer-react/pull/258) [`83f29f3`](https://github.com/primer/eslint-plugin-primer-react/commit/83f29f339999b9c21d95167bcc2680c1797cbab6) Thanks [@keithamus](https://github.com/keithamus)! - Add enforce-css-module-identifier-casing rule
14
16
 
17
+ - [#325](https://github.com/primer/eslint-plugin-primer-react/pull/325) [`f689fcc`](https://github.com/primer/eslint-plugin-primer-react/commit/f689fcc0ca3e5a2c4b76aa04ebb620c7c5786fdf) Thanks [@TylerJDev](https://github.com/TylerJDev)! - Add `no-deprecated-experimental-components` rule
18
+
15
19
  ### Patch Changes
16
20
 
17
21
  - [#314](https://github.com/primer/eslint-plugin-primer-react/pull/314) [`63ef9fd`](https://github.com/primer/eslint-plugin-primer-react/commit/63ef9fdf02a9c4b80528644a96fd81e366bce187) Thanks [@khiga8](https://github.com/khiga8)! - fix: Link to should be allowed to have tooltip
package/README.md CHANGED
@@ -40,3 +40,4 @@ ESLint rules for Primer React
40
40
  - [a11y-link-in-text-block](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/a11y-link-in-text-block.md)
41
41
  - [a11y-remove-disable-tooltip](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/a11y-remove-disable-tooltip.md)
42
42
  - [a11y-use-accessible-tooltip](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/a11y-use-accessible-tooltip.md)
43
+ - [no-deprecated-experimental-components](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/no-deprecated-experimental-components.md)
@@ -0,0 +1,40 @@
1
+ ## Rule Details
2
+
3
+ This rule aims to prevent the use of the `title` attribute with some components from `@primer/react`. The `title` attribute is not keyboard accessible, which results in accessibility issues. Instead, we should utilize alternatives that are accessible.
4
+
5
+ 👎 Examples of **incorrect** code for this rule
6
+
7
+ ```jsx
8
+ import {RelativeTime} from '@primer/react'
9
+
10
+ const App = () => <RelativeTime date={new Date('2020-01-01T00:00:00Z')} noTitle={false} />
11
+ ```
12
+
13
+ 👍 Examples of **correct** code for this rule:
14
+
15
+ ```jsx
16
+ import {RelativeTime} from '@primer/react'
17
+
18
+ const App = () => <RelativeTime date={new Date('2020-01-01T00:00:00Z')} />
19
+ ```
20
+
21
+ The noTitle attribute is true by default, so it can be omitted.
22
+
23
+ ## With alternative tooltip
24
+
25
+ If you want to still utilize a tooltip in a similar way to how the `title` attribute works, you can use the [Primer `Tooltip`](https://primer.style/components/tooltip/react/beta). If you use the `Tooltip` component, you must use it with an interactive element, such as with a button or a link.
26
+
27
+ ```jsx
28
+ import {RelativeTime, Tooltip} from '@primer/react'
29
+
30
+ const App = () => {
31
+ const date = new Date('2020-01-01T00:00:00Z')
32
+ return (
33
+ <Tooltip text={date.toString()}>
34
+ <Link href="#">
35
+ <RelativeTime date={date} noTitle={true} />
36
+ </Link>
37
+ </Tooltip>
38
+ )
39
+ }
40
+ ```
@@ -0,0 +1,29 @@
1
+ # No deprecated experimental components
2
+
3
+ ## Rule Details
4
+
5
+ This rule discourages the usage of specific imports from `@primer/react/experimental`.
6
+
7
+ 👎 Examples of **incorrect** code for this rule
8
+
9
+ ```jsx
10
+ import {SelectPanel} from '@primer/react/experimental'
11
+
12
+ function ExampleComponent() {
13
+ return <SelectPanel />
14
+ }
15
+ ```
16
+
17
+ 👍 Examples of **correct** code for this rule:
18
+
19
+ You can satisfy the rule by either converting to the non-experimental version:
20
+
21
+ ```jsx
22
+ import {SelectPanel} from '@primer/react'
23
+
24
+ function ExampleComponent() {
25
+ return <SelectPanel />
26
+ }
27
+ ```
28
+
29
+ Or by removing usage of the component.