eslint-plugin-primer-react 5.2.1 → 5.3.0-rc.e240e9d

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
  # eslint-plugin-primer-react
2
2
 
3
+ ## 5.3.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#185](https://github.com/primer/eslint-plugin-primer-react/pull/185) [`fea642d`](https://github.com/primer/eslint-plugin-primer-react/commit/fea642d79982e36729262ec55d6e291780ca6160) Thanks [@broccolinisoup](https://github.com/broccolinisoup)! - Add a rule that warns against removing `unsafeDisableTooltip` prop
8
+
3
9
  ## 5.2.1
4
10
 
5
11
  ### Patch Changes
package/README.md CHANGED
@@ -38,3 +38,4 @@ ESLint rules for Primer React
38
38
  - [a11y-tooltip-interactive-trigger](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/a11y-tooltip-interactive-trigger.md)
39
39
  - [a11y-explicit-heading](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/a11y-explicit-heading.md)
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
+ - [a11y-remove-disable-tooltip](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/a11y-remove-disable-tooltip.md)
@@ -0,0 +1,25 @@
1
+ ## Rule Details
2
+
3
+ This rule enforces to remove the `unsafeDisableTooltip` from `IconButton` component so that they have a tooltip by default. `unsafeDisableTooltip` prop is created for an incremental migration and should be removed once all icon buttons have a tooltip.
4
+
5
+ 👎 Examples of **incorrect** code for this rule:
6
+
7
+ ```jsx
8
+ import {IconButton} from '@primer/react'
9
+
10
+ const App = () => (
11
+ <IconButton icon={SearchIcon} aria-label="Search" unsafeDisableTooltip />
12
+ // OR
13
+ <IconButton icon={SearchIcon} aria-label="Search" unsafeDisableTooltip={true} />
14
+ // OR
15
+ <IconButton icon={SearchIcon} aria-label="Search" unsafeDisableTooltip={false} /> // This is incorrect because it should be removed
16
+ )
17
+ ```
18
+
19
+ 👍 Examples of **correct** code for this rule:
20
+
21
+ ```jsx
22
+ import {IconButton} from '@primer/react'
23
+
24
+ const App = () => <IconButton icon={SearchIcon} aria-label="Search" />
25
+ ```