Skip to content

Commit 1d44765

Browse files
authored
feat: add rule react/ensure-forward-ref-using-ref (#240)
1 parent 02ac139 commit 1d44765

37 files changed

+447
-62
lines changed

CHANGELOG.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
1-
## v0.9.8-beta.0 (Draft)
1+
## v0.9.8-beta.0 (Sun Dec 17 2023)
22

33
### Release Notes
44

5+
#### Add rule `react/ensure-forward-ref-using-ref`
6+
57
#### Reduce false positives in rule `react/no-unstable-nested-components`
68

79
#### Reduce false positives in rule `debug/function-component`
@@ -10,13 +12,23 @@
1012

1113
#### 🏠 Internal
1214

15+
- `@eslint-react/eslint-plugin-react`
16+
- Add rule `react/ensure-forward-ref-using-ref`.
17+
- Reduce false positives in rule `react/no-unstable-nested-components`.
18+
19+
- `@eslint-react/eslint-plugin-debug`
20+
- Reduce false positives in rule `debug/function-component`.
21+
1322
- `@eslint-react/ast`
1423
- Refactor `getFunctionIdentifier` function to follow spec convention for `IsAnonymousFunctionDefinition()` usage in ECMAScript spec.
1524
- Improve module structure.
1625

1726
- `@eslint-react/core`
1827
- Move construction detection from `@eslint-react/ast` to `@eslint-react/core`.
1928

29+
- `@eslint-react/monorepo`
30+
- Update `rollup` to `4.9.1`.
31+
2032
#### Authors: 1
2133

2234
- Eva1ent ([@Rel1cx](https://github.com/Rel1cx))

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ module.exports = {
171171
- [x] `react/no-constructed-context-value`
172172
- [ ] `react/no-unused-class-component-methods`
173173
- [ ] `react/no-unused-state`
174+
- [ ] `react/ensure-forward-ref-using-ref`
174175
- [x] `react/prefer-destructuring-assignment`
175176
- [ ] `react/prefer-readonly-props`
176177
- [ ] `react/ban-components`

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@
8989
"markdownlint": "0.32.1",
9090
"pathe": "1.1.1",
9191
"publint": "0.2.6",
92-
"rollup": "4.9.0",
92+
"rollup": "4.9.1",
9393
"rollup-plugin-dts": "6.1.0",
9494
"rollup-plugin-swc3": "0.11.0",
9595
"rollup-plugin-visualizer": "5.11.0",

packages/eslint-plugin-debug/src/rules/class-component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ export type MessageID = "CLASS_COMPONENT";
1111
export default createRule<[], MessageID>({
1212
name: RULE_NAME,
1313
meta: {
14-
type: "suggestion",
14+
type: "problem",
1515
docs: {
1616
// eslint-disable-next-line eslint-plugin/require-meta-docs-description
1717
description: "report all class components, including anonymous ones",

packages/eslint-plugin-debug/src/rules/function-component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type MessageID = ConstantCase<typeof RULE_NAME>;
1212
export default createRule<[], MessageID>({
1313
name: RULE_NAME,
1414
meta: {
15-
type: "suggestion",
15+
type: "problem",
1616
docs: {
1717
// eslint-disable-next-line eslint-plugin/require-meta-docs-description
1818
description: "report all function components, including anonymous ones",

packages/eslint-plugin-debug/src/rules/react-hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export type MessageID = ConstantCase<typeof RULE_NAME>;
1010
export default createRule<[], MessageID>({
1111
name: RULE_NAME,
1212
meta: {
13-
type: "suggestion",
13+
type: "problem",
1414
docs: {
1515
// eslint-disable-next-line eslint-plugin/require-meta-docs-description
1616
description: "report all react hooks",

packages/eslint-plugin-jsx/src/rules/no-complicated-conditional-rendering.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export type MessageID = ConstantCase<typeof RULE_NAME>;
1313
export default createRule<[], MessageID>({
1414
name: RULE_NAME,
1515
meta: {
16-
type: "suggestion",
16+
type: "problem",
1717
docs: {
1818
description: "disallow complicated conditional rendering",
1919
requiresTypeChecking: true,

packages/eslint-plugin-jsx/src/rules/no-spreading-key.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export type MessageID = ConstantCase<typeof RULE_NAME>;
1313
export default createRule<[], MessageID>({
1414
name: RULE_NAME,
1515
meta: {
16-
type: "suggestion",
16+
type: "problem",
1717
docs: {
1818
description: "disallow spreading `key` from objects.",
1919
recommended: "recommended",

packages/eslint-plugin-jsx/src/rules/no-useless-fragment.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ function isFragmentWithSingleExpression(node: TSESTree.JSXElement | TSESTree.JSX
6767
export default createRule<[], MessageID>({
6868
name: RULE_NAME,
6969
meta: {
70-
type: "suggestion",
70+
type: "problem",
7171
docs: {
7272
description: "disallow unnecessary fragments",
7373
recommended: "recommended",

packages/eslint-plugin-jsx/src/rules/prefer-shorthand-boolean.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export type MessageID = ConstantCase<typeof RULE_NAME>;
1212
export default createRule<[], MessageID>({
1313
name: RULE_NAME,
1414
meta: {
15-
type: "suggestion",
15+
type: "problem",
1616
docs: {
1717
description: "enforce `boolean` attributes notation in JSX",
1818
recommended: "recommended",

0 commit comments

Comments
 (0)