Skip to content

Commit a07e3ad

Browse files
authored
feat!: remove 'jsx-shorthand-*' rules (#1091)
1 parent 42696d8 commit a07e3ad

File tree

13 files changed

+4
-363
lines changed

13 files changed

+4
-363
lines changed

apps/website/content/docs/roadmap.md

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,7 @@ Minimum supported versions:
3838

3939
- [ ] `function-component-definition`
4040
- [x] `no-useless-fragment`
41-
- [x] `prefer-react-namespace-import`
42-
- [x] `prefer-shorthand-fragment`
43-
- [x] `prefer-shorthand-boolean`
41+
- [x] `prefer-namespace-import`
4442

4543
### Add suggestion-fix feature to rules that can be fixed interactively
4644

@@ -56,8 +54,6 @@ Minimum supported versions:
5654
### New Rules
5755

5856
- [x] `jsx-no-comment-textnodes` - Disallow text nodes with comments in JSX (Replaces `no-comment-textnodes`)
59-
- [x] `jsx-shorthand-boolean` - Enforces shorthand boolean attributes in JSX (Replaces `prefer-shorthand-boolean`)
60-
- [x] `jsx-shorthand-fragment` - Enforces shorthand fragment syntax in JSX (Replaces `prefer-shorthand-fragment`)
6157
- [x] `no-context-provider` - Replaces usages of `<Context.Provider>` with `<Context>` (React 19)
6258
- [x] `no-forward-ref` - Replaces usages of `forwardRef` with passing `ref` as a prop (React 19)
6359
- [x] `no-use-context` - Replaces usages of `useContext` with `use` (React 19)
@@ -74,10 +70,12 @@ Minimum supported versions:
7470

7571
### Removed Rules
7672

73+
- [x] `avoid-shorthand-boolean`
74+
- [x] `avoid-shorthand-fragment`
7775
- [x] `no-comment-textnodes` - Replaced by `jsx-no-comment-textnodes`
7876
- [x] `prefer-react-namespace-import` - Replaced by `prefer-namespace-import`
7977
- [x] `prefer-shorthand-boolean` - Replaced by `jsx-shorthand-boolean`
80-
- [x] `prefer-shorthand-fragment` - Replaced by `jsx-shorthand-fragment`
78+
- [x] `prefer-shorthand-fragment`
8179

8280
### Versioning Policy
8381

apps/website/content/docs/rules/meta.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@
55
"jsx-no-comment-textnodes",
66
"jsx-no-duplicate-props",
77
"jsx-no-undef",
8-
"jsx-shorthand-boolean",
9-
"jsx-shorthand-fragment",
108
"jsx-uses-react",
119
"jsx-uses-vars",
1210
"no-access-state-in-setstate",

apps/website/content/docs/rules/overview.mdx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,6 @@ The `jsx-*` rules check for issues exclusive to JSX syntax, which are absent fro
3434
| [`jsx-no-comment-textnodes`](./jsx-no-comment-textnodes) | 1️⃣ | | Prevents comments from being inserted as text nodes | |
3535
| [`jsx-no-duplicate-props`](./jsx-no-duplicate-props) | 1️⃣ | | Disallow duplicate props in JSX elements | |
3636
| [`jsx-no-undef`](./jsx-no-undef) | 0️⃣ | | Disallow undefined variables in JSX elements | |
37-
| [`jsx-shorthand-boolean`](./jsx-shorthand-boolean) | 0️⃣ | | Enforces the use of shorthand or explicit boolean attributes | |
38-
| [`jsx-shorthand-fragment`](./jsx-shorthand-fragment) | 0️⃣ | | Enforces the use of shorthand `<>` or `</>` syntax or `<React.Fragment>` element | |
3937
| [`jsx-uses-react`](./jsx-uses-react) | 1️⃣ | | Marks React variables as used when JSX is used | |
4038
| [`jsx-uses-vars`](./jsx-uses-vars) | 1️⃣ | | Marks variables used in JSX elements as used | |
4139
| [`no-access-state-in-setstate`](./no-access-state-in-setstate) | 2️⃣ | | Disallow accessing `this.state` inside `setState` calls | |

packages/plugins/eslint-plugin-react-x/src/configs/recommended.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,6 @@ export const rules = {
77
"react-x/jsx-no-comment-textnodes": "warn",
88
"react-x/jsx-no-duplicate-props": "warn",
99
// "react-x/jsx-no-undef": "error",
10-
// "react-x/jsx-shorthand-boolean": "warn",
11-
// "react-x/jsx-shorthand-fragment": "warn",
1210
"react-x/jsx-uses-react": "warn",
1311
"react-x/jsx-uses-vars": "warn",
1412
"react-x/no-access-state-in-setstate": "error",

packages/plugins/eslint-plugin-react-x/src/plugin.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@ import { name, version } from "../package.json";
22
import jsxNoCommentTextnodes from "./rules/jsx-no-comment-textnodes";
33
import jsxNoDuplicateProps from "./rules/jsx-no-duplicate-props";
44
import jsxNoUndef from "./rules/jsx-no-undef";
5-
import jsxShorthandBoolean from "./rules/jsx-shorthand-boolean";
6-
import jsxShorthandFragment from "./rules/jsx-shorthand-fragment";
75
import jsxUsesReact from "./rules/jsx-uses-react";
86
import jsxUsesVars from "./rules/jsx-uses-vars";
97
import noAccessStateInSetstate from "./rules/no-access-state-in-setstate";
@@ -62,8 +60,6 @@ export const plugin = {
6260
"jsx-no-comment-textnodes": jsxNoCommentTextnodes,
6361
"jsx-no-duplicate-props": jsxNoDuplicateProps,
6462
"jsx-no-undef": jsxNoUndef,
65-
"jsx-shorthand-boolean": jsxShorthandBoolean,
66-
"jsx-shorthand-fragment": jsxShorthandFragment,
6763
"jsx-uses-react": jsxUsesReact,
6864
"jsx-uses-vars": jsxUsesVars,
6965
"no-access-state-in-setstate": noAccessStateInSetstate,

packages/plugins/eslint-plugin-react-x/src/rules/jsx-shorthand-boolean.md

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

packages/plugins/eslint-plugin-react-x/src/rules/jsx-shorthand-boolean.spec.ts

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

packages/plugins/eslint-plugin-react-x/src/rules/jsx-shorthand-boolean.ts

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

packages/plugins/eslint-plugin-react-x/src/rules/jsx-shorthand-fragment.md

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

packages/plugins/eslint-plugin-react-x/src/rules/jsx-shorthand-fragment.spec.ts

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

0 commit comments

Comments
 (0)