Skip to content

Commit

Permalink
fix: correct typos in documentation and changelog entries
Browse files Browse the repository at this point in the history
  • Loading branch information
Rel1cx committed Feb 19, 2025
1 parent 8bdae79 commit 66fc49c
Show file tree
Hide file tree
Showing 14 changed files with 15 additions and 15 deletions.
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ function useAuth() {
### 🐞 Fixes

- fix(plugins/web-api): add 'forEach' support to 'no-leaked-event-listener', closes #842 by @Rel1cx in <https://github.com/Rel1cx/eslint-react/pull/867>
- fix(plugins/web-api): add 'for of' support to 'no-leaked-event-listenner', closes #842 by @Rel1cx in <https://github.com/Rel1cx/eslint-react/pull/869>
- fix(plugins/web-api): add 'for of' support to 'no-leaked-event-listener', closes #842 by @Rel1cx in <https://github.com/Rel1cx/eslint-react/pull/869>
- fix(plugins/x): 'no-array-index-key' mistaking 'foo.bar.map' for 'Rea… by @Rel1cx in <https://github.com/Rel1cx/eslint-react/pull/868>

### 🪄 Improvements
Expand Down
2 changes: 1 addition & 1 deletion apps/website/content/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function useAuth() {
### 🐞 Fixes

- fix(plugins/web-api): add 'forEach' support to 'no-leaked-event-listener', closes #842 by @Rel1cx in <https://github.com/Rel1cx/eslint-react/pull/867>
- fix(plugins/web-api): add 'for of' support to 'no-leaked-event-listenner', closes #842 by @Rel1cx in <https://github.com/Rel1cx/eslint-react/pull/869>
- fix(plugins/web-api): add 'for of' support to 'no-leaked-event-listener', closes #842 by @Rel1cx in <https://github.com/Rel1cx/eslint-react/pull/869>
- fix(plugins/x): 'no-array-index-key' mistaking 'foo.bar.map' for 'Rea… by @Rel1cx in <https://github.com/Rel1cx/eslint-react/pull/868>

### 🪄 Improvements
Expand Down
2 changes: 1 addition & 1 deletion apps/website/content/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ function useAuth() {
### 🐞 Fixes

- fix(plugins/web-api): add 'forEach' support to 'no-leaked-event-listener', closes #842 by @Rel1cx in <https://github.com/Rel1cx/eslint-react/pull/867>
- fix(plugins/web-api): add 'for of' support to 'no-leaked-event-listenner', closes #842 by @Rel1cx in <https://github.com/Rel1cx/eslint-react/pull/869>
- fix(plugins/web-api): add 'for of' support to 'no-leaked-event-listener', closes #842 by @Rel1cx in <https://github.com/Rel1cx/eslint-react/pull/869>
- fix(plugins/x): 'no-array-index-key' mistaking 'foo.bar.map' for 'Rea… by @Rel1cx in <https://github.com/Rel1cx/eslint-react/pull/868>

### 🪄 Improvements
Expand Down
2 changes: 1 addition & 1 deletion apps/website/content/docs/rules/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ full: true
| [`prefer-read-only-props`](./prefer-read-only-props) | 0️⃣ | `🔍` `💭` | Enforces read-only props in components. | |
| [`prefer-shorthand-boolean`](./prefer-shorthand-boolean) | 0️⃣ | `🔍` `🔧` | Enforces using shorthand syntax for boolean attributes. | |
| [`prefer-shorthand-fragment`](./prefer-shorthand-fragment) | 0️⃣ | `🔍` `🔧` | Enforces using shorthand syntax for fragments. | |
| [`use-jsx-vars`](./use-jsx-vars) | 1️⃣ | | Helpes `eslint/no-unused-vars` to correctly detect variables used in JSX. | |
| [`use-jsx-vars`](./use-jsx-vars) | 1️⃣ | | Marks variables used in JSX as used. | |

### Deprecated

Expand Down
2 changes: 1 addition & 1 deletion examples/next-app/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ export default function Home() {
>
<button
type="button"
aria-label="Customise options"
aria-label="Customize options"
className="h-8 w-8 inline-flex items-center justify-center shadow-lg"
>
<HamburgerMenuIcon />
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export default function RemoteContent() {
}
```

The following examples are drived from the [React documentation](https://react.dev/learn/you-might-not-need-an-effect):
The following examples are derived from the [React documentation](https://react.dev/learn/you-might-not-need-an-effect):

### Failing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default function RemoteContent() {
}
```

The following examples are drived from the [React documentation](https://react.dev/learn/you-might-not-need-an-effect):
The following examples are derived from the [React documentation](https://react.dev/learn/you-might-not-need-an-effect):

### Failing

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ function MyComponent({ items }: MyComponentProps) {

- [`no-missing-key`](./no-missing-key)\
Prevents missing `key` on items in list rendering.
- [`no-dupecate-key`](./no-duplicate-key)\
- [`no-duplicate-key`](./no-duplicate-key)\
Prevents duplicate `key` on elements in the same array or a list of `children`.
- [`no-implicit-key`](./no-implicit-key)\
Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects).
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ function MyComponent({ items }: MyComponentProps) {

- [`no-missing-key`](./no-missing-key)\
Prevents missing `key` on items in list rendering.
- [`no-dupecate-key`](./no-duplicate-key)\
- [`no-duplicate-key`](./no-duplicate-key)\
Prevents duplicate `key` on elements in the same array or a list of `children`.
- [`no-array-index-key`](./no-array-index-key)\
Warns when an array `index` is used as a `key` prop.
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ function MyComponent({ items }: MyComponentProps) {

## See Also

- [`no-dupecate-key`](./no-duplicate-key)\
- [`no-duplicate-key`](./no-duplicate-key)\
Prevents duplicate `key` on elements in the same array or a list of `children`.
- [`no-implicit-key`](./no-implicit-key)\
Prevents `key` from not being explicitly specified (e.g. spreading `key` from objects).
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ export default createRule<[], MessageID>({
continue;
}
const parentComponent = AST.findParentNode(component, isFunctionComponent);
const isParnetComponentNotDirectValueOfRenderProperty = parentComponent != null
const isParentComponentNotDirectValueOfRenderProperty = parentComponent != null
&& !isDirectValueOfRenderPropertyLoose(parentComponent);
if (isParnetComponentNotDirectValueOfRenderProperty) {
if (isParentComponentNotDirectValueOfRenderProperty) {
context.report({
messageId: isInsideProperty
? "nestedComponentInProps"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Prevents the use of useless fragments.

A fragment is redundant if it contains only one child, or if it is the child of a html element, and is not a [keyed fragment](https://react.dev/reference/react/Fragment#caveats).

Moreoever, rendering fragments with multiple levels of depth can cause React to not retain the state of components nested within the fragment after [certain re-renders](https://gist.github.com/clemmy/b3ef00f9507909429d8aa0d3ee4f986b), which may lead to unexpected [state resetting](https://react.dev/learn/preserving-and-resetting-state).
Moreover, rendering fragments with multiple levels of depth can cause React to not retain the state of components nested within the fragment after [certain re-renders](https://gist.github.com/clemmy/b3ef00f9507909429d8aa0d3ee4f986b), which may lead to unexpected [state resetting](https://react.dev/learn/preserving-and-resetting-state).

## Examples

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ react-x/use-jsx-vars

## What it does

Helpes `eslint/no-unused-vars` to correctly detect variables used in JSX.
Marks variables used in JSX as used.

Since 0.17.0 the eslint `no-unused-vars` rule does not detect variables used in JSX (see details). This rule will find variables used in JSX and mark them as used.
This rule only has an effect when the `no-unused-vars` rule is enabled.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ export default createRule<[], MessageID>({
meta: {
type: "problem",
docs: {
description: "helpes `eslint/no-unused-vars` to correctly mark JSX variables as used.",
description: "marks variables used in JSX as used",
[Symbol.for("rule_features")]: RULE_FEATURES,
},
messages: {
Expand Down

0 comments on commit 66fc49c

Please sign in to comment.