Skip to content

Commit fbc9051

Browse files
committed
Merge branch 'main' into react-dom/no-render
2 parents 832766b + 2f605cf commit fbc9051

File tree

193 files changed

+4429
-4037
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

193 files changed

+4429
-4037
lines changed
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# ADR 0000: Choice between "useless" and "unnecessary" in rule naming
2+
3+
## Status
4+
5+
Accepted
6+
7+
## Context
8+
9+
When naming rules related to identifying redundant or non-functional code (e.g., in linting or static analysis), the terms "useless" and "unnecessary" both convey a sense of superfluity. However, their nuanced semantic differences could lead to ambiguity if misapplied. For example, a `forwardRef` call with no `ref` usage is entirely without purpose, but other scenarios might involve optional code that is only redundant in specific contexts. A consistent naming convention is needed to ensure clarity and accuracy in rule documentation and error messaging.
10+
11+
## Decision
12+
13+
Use "useless" to describe code that has no functional purpose under any circumstances (e.g., a `forwardRef` call with no `ref` usage).
14+
15+
Use "unnecessary" to describe code that is contextually redundant but not strictly non-functional (e.g., an `useEffect` that runs event-specific logic).
16+
17+
## Consequences
18+
19+
- Improved clarity: Developers can better discern whether code is strictly non-functional ("useless") or situationally redundant ("unnecessary").
20+
21+
- Consistency: Rules and error messages will align with precise semantic definitions.
22+
23+
- Potential learning curve: Teams may need documentation to understand the distinction initially.
24+
25+
## Alternatives Considered
26+
27+
1. Using only "unnecessary" for all cases:
28+
- Rejected because it conflates fundamentally distinct scenarios (strictly non-functional vs. contextually redundant), reducing diagnostic precision.
29+
30+
2. Using only "useless" for all cases:
31+
- Rejected because it could mislabel code that is optional but valid in other contexts, leading to confusion or dismissal of valid feedback.
32+
33+
## Related ADRs
34+
35+
N/A
36+
37+
## Links
38+
39+
N/A
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# ADR 0001: Rename ensure-forward-ref-using-ref to no-useless-forward-ref
2+
3+
## Status
4+
5+
Accepted
6+
7+
## Context
8+
9+
Renaming the `ensure-forward-ref-using-ref` rule to align with the existing rule naming conventions and accurately reflect the rule's focus on non-functional code.
10+
11+
## Decision
12+
13+
Rename the rule to **`no-useless-forward-ref`** adhere to the `no-<category>-<term>` pattern used in similar rules (e.g., `no-useless-fragment`).
14+
15+
## Consequences
16+
17+
- The rule name will be more consistent with other rules in the project.
18+
- The rule name will more accurately reflect the rule's focus on non-functional code.
19+
20+
## Alternatives Considered
21+
22+
Using `no-unnecessary-forward-ref`:
23+
24+
- Rejected because "unnecessary" implies optional redundancy, in this case, the `forwardRef` call is always redundant.
25+
26+
## Related ADRs
27+
28+
- [ADR 0000: Choice between "useless" and "unnecessary" in rule naming](./0000-choice-between-useless-and-unnecessary-in-rule-naming.md)
29+
30+
## Links
31+
32+
N/A

.github/workflows/publish.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,10 @@ on:
77
- "**"
88
paths-ignore:
99
- "**/*.gitignore"
10+
- .adrs/**
1011
- .editorconfig
11-
- adrs/**
12-
- docs/**
12+
- apps/**
1313
- examples/**
14-
- website/**
15-
- scripts/**
1614
pull_request: null
1715
jobs:
1816
publish:

.pkgs/configs/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"dependencies": {
2222
"@eslint/js": "^9.22.0",
2323
"@stylistic/eslint-plugin": "^4.2.0",
24-
"eslint-plugin-de-morgan": "^1.2.0",
24+
"eslint-plugin-de-morgan": "^1.2.1",
2525
"eslint-plugin-jsdoc": "^50.6.6",
2626
"eslint-plugin-perfectionist": "^4.10.1",
2727
"eslint-plugin-regexp": "^2.7.0",

.pkgs/eslint-plugin-local/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@typescript-eslint/type-utils": "^8.26.1",
3232
"@typescript-eslint/types": "^8.26.1",
3333
"@typescript-eslint/utils": "^8.26.1",
34-
"eslint-plugin-de-morgan": "^1.2.0",
34+
"eslint-plugin-de-morgan": "^1.2.1",
3535
"eslint-plugin-jsdoc": "^50.6.6",
3636
"eslint-plugin-perfectionist": "^4.10.1",
3737
"eslint-plugin-regexp": "^2.7.0",

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"editor.defaultFormatter": "dprint.dprint"
44
},
55
"[jsonc]": {
6-
"editor.defaultFormatter": "dprint.dprint"
6+
"editor.defaultFormatter": "vscode.json-language-features"
77
},
88
"[typescript]": {
99
"editor.defaultFormatter": "dprint.dprint"

CHANGELOG.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,42 @@
1+
## v1.34.0 (2025-03-15)
2+
3+
### 🪄 Improvements
4+
5+
- refactor: export the create function of each rule by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/989
6+
- refactor(plugins/x): rename `no-nested-components` rule to `no-nested-component-definitions` and update related docs by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/990
7+
8+
### 📝 Changes you should be aware of
9+
10+
The following rules have been renamed:
11+
12+
- `react-x/no-nested-components` to `react-x/no-nested-component-definitions`
13+
- `@eslint-react/no-nested-components` to `@eslint-react/no-nested-component-definitions`
14+
15+
The old rule names will still be available until the next major update to avoid breaking changes.
16+
17+
**Full Changelog**: https://github.com/Rel1cx/eslint-react/compare/v1.33.0...v1.34.0
18+
19+
## v1.33.0 (2025-03-14)
20+
21+
### 🐞 Fixes
22+
23+
- fix: update rule severity for `no-flush-sync` and `no-void-elements-with-children` in recommended presets by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/988
24+
25+
### 🪄 Improvements
26+
27+
- refactor(plugins/x): rename `ensure-forward-ref-using-ref` to `no-useless-forward-ref` by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/987
28+
29+
### 📝 Changes you should be aware of
30+
31+
The following rules have been renamed:
32+
33+
- `react-x/ensure-forward-ref-using-ref` to `react-x/no-useless-forward-ref`
34+
- `@eslint-react/ensure-forward-ref-using-ref` to `@eslint-react/no-useless-forward-ref`
35+
36+
The old rule names will still be available until the next major update to avoid breaking changes.
37+
38+
**Full Changelog**: https://github.com/Rel1cx/eslint-react/compare/v1.32.1...v1.33.0
39+
140
## v1.32.1 (2025-03-13)
241

342
### 🐞 Fixes

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.32.1
1+
1.34.0

apps/website/app/theme.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,15 @@
4444
border: none;
4545
}
4646

47+
.dark .prose {
48+
--tw-prose-body:
49+
color-mix(in oklab, var(--color-fd-foreground) 80%, transparent);
50+
}
51+
52+
.dark .prose :where(code):not(:where([class~="not-prose"], [class~="not-prose"] *)) {
53+
color: #ffffff;
54+
}
55+
4756
.dark #nd-sidebar {
4857
--color-fd-muted: hsl(0, 0%, 16%);
4958
--color-fd-secondary: hsl(0, 0%, 18%);

apps/website/content/docs/changelog.md

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,45 @@
22
title: Changelog
33
---
44

5+
## v1.34.0 (2025-03-15)
6+
7+
### 🪄 Improvements
8+
9+
- refactor: export the create function of each rule by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/989
10+
- refactor(plugins/x): rename `no-nested-components` rule to `no-nested-component-definitions` and update related docs by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/990
11+
12+
### 📝 Changes you should be aware of
13+
14+
The following rules have been renamed:
15+
16+
- `react-x/no-nested-components` to `react-x/no-nested-component-definitions`
17+
- `@eslint-react/no-nested-components` to `@eslint-react/no-nested-component-definitions`
18+
19+
The old rule names will still be available until the next major update to avoid breaking changes.
20+
21+
**Full Changelog**: https://github.com/Rel1cx/eslint-react/compare/v1.33.0...v1.34.0
22+
23+
## v1.33.0 (2025-03-14)
24+
25+
### 🐞 Fixes
26+
27+
- fix: update rule severity for `no-flush-sync` and `no-void-elements-with-children` in recommended presets by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/988
28+
29+
### 🪄 Improvements
30+
31+
- refactor(plugins/x): rename `ensure-forward-ref-using-ref` to `no-useless-forward-ref` by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/987
32+
33+
### 📝 Changes you should be aware of
34+
35+
The following rules have been renamed:
36+
37+
- `react-x/ensure-forward-ref-using-ref` to `react-x/no-useless-forward-ref`
38+
- `@eslint-react/ensure-forward-ref-using-ref` to `@eslint-react/no-useless-forward-ref`
39+
40+
The old rule names will still be available until the next major update to avoid breaking changes.
41+
42+
**Full Changelog**: https://github.com/Rel1cx/eslint-react/compare/v1.32.1...v1.33.0
43+
544
## v1.32.1 (2025-03-13)
645

746
### 🐞 Fixes

0 commit comments

Comments
 (0)