Skip to content

Commit 2cc2ee7

Browse files
committed
Merge branch 'main' into new-css-vars
2 parents f9eb90f + 0cb5f8c commit 2cc2ee7

22 files changed

+2109
-790
lines changed

.changeset/fair-panthers-raise.md

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

.github/dependabot.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: npm
4+
directory: "/"
5+
schedule:
6+
interval: weekly
7+
open-pull-requests-limit: 99
8+
allow:
9+
- dependency-name: "eslint-plugin-github"
10+
- dependency-name: "eslint-plugin-jsx-a11y"

CHANGELOG.md

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

3+
## 4.0.2
4+
5+
### Patch Changes
6+
7+
- [#76](https://github.com/primer/eslint-plugin-primer-react/pull/76) [`1750256`](https://github.com/primer/eslint-plugin-primer-react/commit/17502566745fcc7ebcebef730c1c7c60be276f06) Thanks [@joshblack](https://github.com/joshblack)! - Update the no-system-props rule to exclude the `border` prop for the `Blankslate` component from `@primer/react`.
8+
9+
## 4.0.1
10+
11+
### Patch Changes
12+
13+
- [#74](https://github.com/primer/eslint-plugin-primer-react/pull/74) [`c07df5c`](https://github.com/primer/eslint-plugin-primer-react/commit/c07df5c067e2a980bcd373d1c992a2123ef70c5c) Thanks [@TylerJDev](https://github.com/TylerJDev)! - Adds support for `MarkdownEditor.Footer` in `direct-slot-children` rule
14+
15+
## 4.0.0
16+
17+
### Major Changes
18+
19+
- [#51](https://github.com/primer/eslint-plugin-primer-react/pull/51) [`a65aa32`](https://github.com/primer/eslint-plugin-primer-react/commit/a65aa32c612c7fe952ec47bb3d926cf8adae9fab) Thanks [@broccolinisoup](https://github.com/broccolinisoup)! - Add `a11y-tooltip-interactive-trigger`
20+
21+
* [#66](https://github.com/primer/eslint-plugin-primer-react/pull/66) [`d1df609`](https://github.com/primer/eslint-plugin-primer-react/commit/d1df609b260505ee9dea1740bc96a3187355d727) Thanks [@TylerJDev](https://github.com/TylerJDev)! - Add `a11y-explicit-heading` rule
22+
23+
### Minor Changes
24+
25+
- [#67](https://github.com/primer/eslint-plugin-primer-react/pull/67) [`4dfdb47`](https://github.com/primer/eslint-plugin-primer-react/commit/4dfdb47b40e7f187573b8203830541b86cc7a953) Thanks [@TylerJDev](https://github.com/TylerJDev)! - \* Updates component mapping, adds `components.js`
26+
- Bumps `eslint-plugin-github` and `eslint-plugin-jsx-a11y`
27+
- Fixes bug in `a11y-explicit-heading` when using spread props, or variable for `as`
28+
29+
### Patch Changes
30+
31+
- [#72](https://github.com/primer/eslint-plugin-primer-react/pull/72) [`522b9cc`](https://github.com/primer/eslint-plugin-primer-react/commit/522b9ccbcfb26d18f2ea8b2514a6a7975480aaa7) Thanks [@TylerJDev](https://github.com/TylerJDev)! - Removes `Link`, `Spinner` and `TabNav.Link` from component mapping
32+
33+
* [#73](https://github.com/primer/eslint-plugin-primer-react/pull/73) [`974d9e8`](https://github.com/primer/eslint-plugin-primer-react/commit/974d9e85c7460a05eb0345086b340b650700d24d) Thanks [@TylerJDev](https://github.com/TylerJDev)! - \* Fixes `nonInteractiveLink` rule for links that pass values through JSX rather than a string
34+
- Adds optional chaining to `getJSXOpeningElementAttribute` to avoid error when no `name` is present
35+
336
## 3.0.0
437

538
### Major Changes

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,3 +33,4 @@ ESLint rules for Primer React
3333
- [no-deprecated-colors](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/no-deprecated-colors.md)
3434
- [no-system-props](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/no-system-props.md)
3535
- [a11y-tooltip-interactive-trigger](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/a11y-tooltip-interactive-trigger.md)
36+
- [a11y-explicit-heading](https://github.com/primer/eslint-plugin-primer-react/blob/main/docs/rules/a11y-explicit-heading.md)

docs/rules/a11y-explicit-heading.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## Require explicit heading level on `<Heading>` component
2+
3+
The `Heading` component does not require you to use `as` to specify the heading level, as it will default to an `h2` if one isn't specified. This may lead to inaccessible usage if the default is out of order in the existing heading hierarchy.
4+
5+
## Rule Details
6+
7+
This rule enforces using `as` on the `<Heading>` component to specify a heading level (`h1`-`h6`). In addition, it enforces `as` usage to only be used for headings.
8+
9+
👎 Examples of **incorrect** code for this rule
10+
11+
```jsx
12+
import {Heading} from '@primer/react'
13+
14+
<Heading>Heading without explicit heading level</Heading>
15+
```
16+
17+
`as` must only be for headings (`h1`-`h6`)
18+
19+
```jsx
20+
import {Heading} from '@primer/react'
21+
22+
<Heading as="span">Heading component used as "span"</Heading>
23+
```
24+
25+
👍 Examples of **correct** code for this rule:
26+
27+
```jsx
28+
import {Heading} from '@primer/react';
29+
30+
<Heading as="h2">Heading level 2</Heading>
31+
```
32+
33+
## Options
34+
35+
- `skipImportCheck` (default: `false`)
36+
37+
By default, the `a11y-explicit-heading` rule will only check for `<Heading>` components imported directly from `@primer/react`. You can disable this behavior by setting `skipImportCheck` to `true`.
File renamed without changes.

0 commit comments

Comments
 (0)