Skip to content

Commit 24da5bb

Browse files
authored
[doc] add eslint rule references in react guide
* react/jsx-filename-extension * react/no-array-index-key
1 parent 924dfb2 commit 24da5bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

react/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ This style guide is mostly based on the standards that are currently prevalent i
8080

8181
## Naming
8282

83-
- **Extensions**: Use `.jsx` extension for React components.
83+
- **Extensions**: Use `.jsx` extension for React components. eslint: [`react/jsx-filename-extension`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-filename-extension.md)
8484
- **Filename**: Use PascalCase for filenames. E.g., `ReservationCard.jsx`.
8585
- **Reference Naming**: Use PascalCase for React components and camelCase for their instances. eslint: [`react/jsx-pascal-case`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/jsx-pascal-case.md)
8686

@@ -351,7 +351,7 @@ This style guide is mostly based on the standards that are currently prevalent i
351351
<div />
352352
```
353353

354-
- Avoid using an array index as `key` prop, prefer a stable ID.
354+
- Avoid using an array index as `key` prop, prefer a stable ID. eslint: [`react/no-array-index-key`](https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/no-array-index-key.md)
355355

356356
> Why? Not using a stable ID [is an anti-pattern](https://medium.com/@robinpokorny/index-as-a-key-is-an-anti-pattern-e0349aece318) because it can negatively impact performance and cause issues with component state.
357357

0 commit comments

Comments
 (0)