From 5baa78d4fb2b55aee343f3a560b3d855cb49dd34 Mon Sep 17 00:00:00 2001 From: Eva1ent Date: Tue, 10 Dec 2024 05:49:53 +0800 Subject: [PATCH] refactor: hide 'avoid-*' rules from presets and docs --- VERSION | 2 +- package.json | 2 +- packages/core/package.json | 2 +- .../plugins/eslint-plugin-react-debug/package.json | 2 +- packages/plugins/eslint-plugin-react-dom/package.json | 2 +- .../eslint-plugin-react-hooks-extra/package.json | 2 +- .../eslint-plugin-react-naming-convention/package.json | 2 +- .../plugins/eslint-plugin-react-web-api/package.json | 2 +- packages/plugins/eslint-plugin-react-x/README.md | 2 -- packages/plugins/eslint-plugin-react-x/package.json | 2 +- packages/plugins/eslint-plugin/package.json | 2 +- packages/plugins/eslint-plugin/src/configs/all.ts | 2 -- packages/shared/package.json | 2 +- packages/tools/package.json | 2 +- packages/types/package.json | 2 +- packages/utilities/ast/package.json | 2 +- packages/utilities/jsx/package.json | 2 +- packages/utilities/var/package.json | 2 +- website/pages/docs/rules/_meta.ts | 10 ++++++++-- website/pages/docs/rules/overview.md | 2 -- website/pages/roadmap.md | 2 -- 21 files changed, 24 insertions(+), 26 deletions(-) diff --git a/VERSION b/VERSION index 815d5ca06..a7ea7cfc9 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.19.0 +1.19.0-next.4 diff --git a/package.json b/package.json index 6dae9fff5..041cf63b5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/monorepo", - "version": "1.19.0", + "version": "1.19.0-next.4", "private": true, "description": "Monorepo for eslint-plugin-react-[x, dom, web-api, hooks-extra, naming-convention].", "keywords": [ diff --git a/packages/core/package.json b/packages/core/package.json index d050c1123..71c28fc70 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/core", - "version": "1.19.0", + "version": "1.19.0-next.4", "description": "ESLint React's ESLint utility module for static analysis of React core APIs and Patterns.", "homepage": "https://github.com/rel1cx/eslint-react", "bugs": { diff --git a/packages/plugins/eslint-plugin-react-debug/package.json b/packages/plugins/eslint-plugin-react-debug/package.json index cba0c9341..ccfbf7e98 100644 --- a/packages/plugins/eslint-plugin-react-debug/package.json +++ b/packages/plugins/eslint-plugin-react-debug/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-debug", - "version": "1.19.0", + "version": "1.19.0-next.4", "description": "ESLint React's ESLint plugin for debugging related rules.", "keywords": [ "eslint", diff --git a/packages/plugins/eslint-plugin-react-dom/package.json b/packages/plugins/eslint-plugin-react-dom/package.json index 858053f5d..3037efa1d 100644 --- a/packages/plugins/eslint-plugin-react-dom/package.json +++ b/packages/plugins/eslint-plugin-react-dom/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-dom", - "version": "1.19.0", + "version": "1.19.0-next.4", "description": "ESLint React's ESLint plugin for React DOM related rules.", "keywords": [ "eslint", diff --git a/packages/plugins/eslint-plugin-react-hooks-extra/package.json b/packages/plugins/eslint-plugin-react-hooks-extra/package.json index 8991e6d72..d0d511fdd 100644 --- a/packages/plugins/eslint-plugin-react-hooks-extra/package.json +++ b/packages/plugins/eslint-plugin-react-hooks-extra/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-hooks-extra", - "version": "1.19.0", + "version": "1.19.0-next.4", "description": "ESLint React's ESLint plugin for React Hooks related rules.", "keywords": [ "eslint", diff --git a/packages/plugins/eslint-plugin-react-naming-convention/package.json b/packages/plugins/eslint-plugin-react-naming-convention/package.json index 35f4fd515..ca7b37c6e 100644 --- a/packages/plugins/eslint-plugin-react-naming-convention/package.json +++ b/packages/plugins/eslint-plugin-react-naming-convention/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-naming-convention", - "version": "1.19.0", + "version": "1.19.0-next.4", "description": "ESLint React's ESLint plugin for naming convention related rules.", "keywords": [ "eslint", diff --git a/packages/plugins/eslint-plugin-react-web-api/package.json b/packages/plugins/eslint-plugin-react-web-api/package.json index e4a7684fa..781f32b5b 100644 --- a/packages/plugins/eslint-plugin-react-web-api/package.json +++ b/packages/plugins/eslint-plugin-react-web-api/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-web-api", - "version": "1.19.0", + "version": "1.19.0-next.4", "description": "ESLint React's ESLint plugin for interacting with Web APIs", "keywords": [ "eslint", diff --git a/packages/plugins/eslint-plugin-react-x/README.md b/packages/plugins/eslint-plugin-react-x/README.md index d9d82b50d..5d3fd9d39 100644 --- a/packages/plugins/eslint-plugin-react-x/README.md +++ b/packages/plugins/eslint-plugin-react-x/README.md @@ -75,8 +75,6 @@ export default [ | Rule | Description | 💼 | 💭 | | | :--------------------------------------- | :--------------------------------------------------------------------------------------------------- | :-: | :-: | :-: | -| `avoid-shorthand-boolean` | Prevents using shorthand syntax for boolean attributes. | 🎨 | | 🔧 | -| `avoid-shorthand-fragment` | Prevents using shorthand syntax for fragments. | 🎨 | | | | `ensure-forward-ref-using-ref` | Requires that components wrapped with `forwardRef` must have a `ref` parameter. | ✔️ | | | | `jsx-no-duplicate-props` | Prevents duplicate props in JSX. | ✔️ | | | | `jsx-uses-vars` | Prevents variables used in JSX to be marked as unused. | ✔️ | | | diff --git a/packages/plugins/eslint-plugin-react-x/package.json b/packages/plugins/eslint-plugin-react-x/package.json index 91d373c01..c7c839207 100644 --- a/packages/plugins/eslint-plugin-react-x/package.json +++ b/packages/plugins/eslint-plugin-react-x/package.json @@ -1,6 +1,6 @@ { "name": "eslint-plugin-react-x", - "version": "1.19.0", + "version": "1.19.0-next.4", "description": "A set of composable ESLint rules for libraries and frameworks that use React as a UI runtime.", "keywords": [ "eslint", diff --git a/packages/plugins/eslint-plugin/package.json b/packages/plugins/eslint-plugin/package.json index 689aacb62..1332c77e7 100644 --- a/packages/plugins/eslint-plugin/package.json +++ b/packages/plugins/eslint-plugin/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/eslint-plugin", - "version": "1.19.0", + "version": "1.19.0-next.4", "description": "The main ESLint plugin of ESLint React. Contains all the rules and presets of ESLint React.", "keywords": [ "eslint", diff --git a/packages/plugins/eslint-plugin/src/configs/all.ts b/packages/plugins/eslint-plugin/src/configs/all.ts index bd1ac7cf0..ef08b17ed 100644 --- a/packages/plugins/eslint-plugin/src/configs/all.ts +++ b/packages/plugins/eslint-plugin/src/configs/all.ts @@ -10,8 +10,6 @@ import * as dom from "./dom"; export const name = "@eslint-react/all"; export const rules = { - "@eslint-react/avoid-shorthand-boolean": "warn", - "@eslint-react/avoid-shorthand-fragment": "warn", "@eslint-react/ensure-forward-ref-using-ref": "warn", "@eslint-react/jsx-no-duplicate-props": "warn", "@eslint-react/jsx-uses-vars": "warn", diff --git a/packages/shared/package.json b/packages/shared/package.json index dfe9c116e..66aa18291 100644 --- a/packages/shared/package.json +++ b/packages/shared/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/shared", - "version": "1.19.0", + "version": "1.19.0-next.4", "description": "ESLint React's Shared constants and functions.", "homepage": "https://github.com/rel1cx/eslint-react", "bugs": { diff --git a/packages/tools/package.json b/packages/tools/package.json index 7ba33ccf1..a92eb3694 100644 --- a/packages/tools/package.json +++ b/packages/tools/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/tools", - "version": "1.19.0", + "version": "1.19.0-next.4", "description": "ESLint React's std library and primitives.", "homepage": "https://github.com/rel1cx/eslint-react", "bugs": { diff --git a/packages/types/package.json b/packages/types/package.json index 381cda15a..ac3de4ae9 100644 --- a/packages/types/package.json +++ b/packages/types/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/types", - "version": "1.19.0", + "version": "1.19.0-next.4", "description": "ESLint React's type definitions.", "homepage": "https://github.com/rel1cx/eslint-react", "bugs": { diff --git a/packages/utilities/ast/package.json b/packages/utilities/ast/package.json index 87465123d..f0a057889 100644 --- a/packages/utilities/ast/package.json +++ b/packages/utilities/ast/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/ast", - "version": "1.19.0", + "version": "1.19.0-next.4", "description": "ESLint React's TSESTree AST utility module.", "homepage": "https://github.com/rel1cx/eslint-react", "bugs": { diff --git a/packages/utilities/jsx/package.json b/packages/utilities/jsx/package.json index f193f8295..695e12b3f 100644 --- a/packages/utilities/jsx/package.json +++ b/packages/utilities/jsx/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/jsx", - "version": "1.19.0", + "version": "1.19.0-next.4", "description": "ESLint React's TSESTree AST utility module for static analysis of JSX.", "homepage": "https://github.com/rel1cx/eslint-react", "bugs": { diff --git a/packages/utilities/var/package.json b/packages/utilities/var/package.json index 2e98374ce..785bd38d8 100644 --- a/packages/utilities/var/package.json +++ b/packages/utilities/var/package.json @@ -1,6 +1,6 @@ { "name": "@eslint-react/var", - "version": "1.19.0", + "version": "1.19.0-next.4", "description": "TSESTree AST utility module for static analysis of variables", "homepage": "https://github.com/rel1cx/eslint-react", "bugs": { diff --git a/website/pages/docs/rules/_meta.ts b/website/pages/docs/rules/_meta.ts index e2ef84b63..2ed1808bc 100644 --- a/website/pages/docs/rules/_meta.ts +++ b/website/pages/docs/rules/_meta.ts @@ -56,8 +56,14 @@ export default { "prefer-read-only-props": "prefer-read-only-props", "prefer-shorthand-boolean": "prefer-shorthand-boolean", "prefer-shorthand-fragment": "prefer-shorthand-fragment", - "avoid-shorthand-boolean": "avoid-shorthand-boolean", - "avoid-shorthand-fragment": "avoid-shorthand-fragment", + "avoid-shorthand-boolean": { + title: "avoid-shorthand-boolean", + display: "hidden", + }, + "avoid-shorthand-fragment": { + title: "avoid-shorthand-fragment", + display: "hidden", + }, "dom-no-children-in-void-dom-elements": "dom/no-children-in-void-dom-elements", "dom-no-dangerously-set-innerhtml": "dom/no-dangerously-set-innerhtml", "dom-no-dangerously-set-innerhtml-with-children": "dom/no-dangerously-set-innerhtml-with-children", diff --git a/website/pages/docs/rules/overview.md b/website/pages/docs/rules/overview.md index 6b83b56c4..12f211a68 100644 --- a/website/pages/docs/rules/overview.md +++ b/website/pages/docs/rules/overview.md @@ -22,8 +22,6 @@ | Rule | Description | 💼 | 💭 | | | :--------------------------------------------------------------------------------- | :--------------------------------------------------------------------------------------------------- | :-: | :-: | :-: | -| [`avoid-shorthand-boolean`](avoid-shorthand-boolean) | Prevents using shorthand syntax for boolean attributes. | 🎨 | | 🔧 | -| [`avoid-shorthand-fragment`](avoid-shorthand-fragment) | Prevents using shorthand syntax for fragments. | 🎨 | | | | [`ensure-forward-ref-using-ref`](ensure-forward-ref-using-ref) | Requires that components wrapped with `forwardRef` must have a `ref` parameter. | ✔️ | | | | [`jsx-no-duplicate-props`](jsx-no-duplicate-props) | Prevents duplicate props in JSX. | ✔️ | | | | [`jsx-uses-vars`](jsx-uses-vars) | Prevents variables used in JSX to be marked as unused. | ✔️ | | | diff --git a/website/pages/roadmap.md b/website/pages/roadmap.md index c9603544a..f776304cd 100644 --- a/website/pages/roadmap.md +++ b/website/pages/roadmap.md @@ -15,8 +15,6 @@ | Rule | Description | | :--------------------------------------- | :--------------------------------------------------------------------------------------------------- | -| `avoid-shorthand-boolean` | Prevents using shorthand syntax for boolean attributes. | -| `avoid-shorthand-fragment` | Prevents using shorthand syntax for fragments. | | `ensure-forward-ref-using-ref` | Requires that components wrapped with `forwardRef` must have a `ref` parameter. | | `no-access-state-in-setstate` | Prevents accessing `this.state` inside `setState` calls. | | `no-array-index-key` | Prevents using array `index` as `key`. |