From 5c8a9c5c1015b2404bef6bf0ad19694b5d9884aa Mon Sep 17 00:00:00 2001 From: Rel1cx Date: Mon, 13 Oct 2025 21:32:43 +0800 Subject: [PATCH] Remove eslint-plugin-react-debug from unified plugin --- packages/plugins/eslint-plugin/README.md | 4 ++-- packages/plugins/eslint-plugin/package.json | 1 - .../plugins/eslint-plugin/src/configs/all.ts | 2 -- .../plugins/eslint-plugin/src/configs/debug.ts | 17 ----------------- .../eslint-plugin/src/configs/disable-debug.ts | 9 --------- .../eslint-plugin/src/configs/recommended.ts | 2 -- packages/plugins/eslint-plugin/src/index.ts | 12 ------------ pnpm-lock.yaml | 3 --- 8 files changed, 2 insertions(+), 48 deletions(-) delete mode 100644 packages/plugins/eslint-plugin/src/configs/debug.ts delete mode 100644 packages/plugins/eslint-plugin/src/configs/disable-debug.ts diff --git a/packages/plugins/eslint-plugin/README.md b/packages/plugins/eslint-plugin/README.md index 6e3e0de57..e3c67b873 100644 --- a/packages/plugins/eslint-plugin/README.md +++ b/packages/plugins/eslint-plugin/README.md @@ -183,8 +183,8 @@ ESLint React is not affiliated with Meta Corporation or [facebook/react](https:/ Contributions are welcome! -Please follow our [contributing guidelines](https://github.com/Rel1cx/eslint-react/tree/main/.github/CONTRIBUTING.md). +Please follow our [contributing guidelines](https://github.com/Rel1cx/eslint-react/tree/remove-eslint-plugin-react-debug-from-unified-plugin/.github/CONTRIBUTING.md). ## License -This project is licensed under the MIT License - see the [LICENSE](https://github.com/Rel1cx/eslint-react/tree/main/LICENSE) file for details. +This project is licensed under the MIT License - see the [LICENSE](https://github.com/Rel1cx/eslint-react/tree/remove-eslint-plugin-react-debug-from-unified-plugin/LICENSE) file for details. diff --git a/packages/plugins/eslint-plugin/package.json b/packages/plugins/eslint-plugin/package.json index 4d5605a7e..001d800e8 100644 --- a/packages/plugins/eslint-plugin/package.json +++ b/packages/plugins/eslint-plugin/package.json @@ -49,7 +49,6 @@ "@typescript-eslint/type-utils": "^8.46.0", "@typescript-eslint/types": "^8.46.0", "@typescript-eslint/utils": "^8.46.0", - "eslint-plugin-react-debug": "workspace:*", "eslint-plugin-react-dom": "workspace:*", "eslint-plugin-react-hooks-extra": "workspace:*", "eslint-plugin-react-naming-convention": "workspace:*", diff --git a/packages/plugins/eslint-plugin/src/configs/all.ts b/packages/plugins/eslint-plugin/src/configs/all.ts index 0c3db8d80..ac9fa73cb 100644 --- a/packages/plugins/eslint-plugin/src/configs/all.ts +++ b/packages/plugins/eslint-plugin/src/configs/all.ts @@ -1,5 +1,4 @@ import type { RuleConfig } from "@eslint-react/shared"; -import reactDebug from "eslint-plugin-react-debug"; import reactHooksExtra from "eslint-plugin-react-hooks-extra"; import reactNamingConvention from "eslint-plugin-react-naming-convention"; import reactWebApi from "eslint-plugin-react-web-api"; @@ -109,7 +108,6 @@ export const rules = { export const plugins = { ...x.plugins, ...dom.plugins, - "@eslint-react/debug": reactDebug, "@eslint-react/hooks-extra": reactHooksExtra, "@eslint-react/naming-convention": reactNamingConvention, "@eslint-react/web-api": reactWebApi, diff --git a/packages/plugins/eslint-plugin/src/configs/debug.ts b/packages/plugins/eslint-plugin/src/configs/debug.ts deleted file mode 100644 index 6eb4f030e..000000000 --- a/packages/plugins/eslint-plugin/src/configs/debug.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { RuleConfig } from "@eslint-react/shared"; - -import reactDebug from "eslint-plugin-react-debug"; - -export const name = "@eslint-react/debug"; - -export const rules = { - "@eslint-react/debug/class-component": "warn", - "@eslint-react/debug/function-component": "warn", - "@eslint-react/debug/hook": "warn", - "@eslint-react/debug/is-from-react": "warn", - "@eslint-react/debug/jsx": "warn", -} as const satisfies Record; - -export const plugins = { - "@eslint-react/debug": reactDebug, -}; diff --git a/packages/plugins/eslint-plugin/src/configs/disable-debug.ts b/packages/plugins/eslint-plugin/src/configs/disable-debug.ts deleted file mode 100644 index 9b1e6e5fa..000000000 --- a/packages/plugins/eslint-plugin/src/configs/disable-debug.ts +++ /dev/null @@ -1,9 +0,0 @@ -import type { RuleConfig } from "@eslint-react/shared"; - -import { rules as debugRules } from "./debug"; - -export const name = "@eslint-react/disable-debug"; - -export const rules: Record = Object.fromEntries( - Object.entries(debugRules).map(([rule]) => [rule, "off"]), -); diff --git a/packages/plugins/eslint-plugin/src/configs/recommended.ts b/packages/plugins/eslint-plugin/src/configs/recommended.ts index e2d36bf74..e1a5b6a13 100644 --- a/packages/plugins/eslint-plugin/src/configs/recommended.ts +++ b/packages/plugins/eslint-plugin/src/configs/recommended.ts @@ -1,5 +1,4 @@ import type { RuleConfig } from "@eslint-react/shared"; -import reactDebug from "eslint-plugin-react-debug"; import reactHooksExtra from "eslint-plugin-react-hooks-extra"; import reactNamingConvention from "eslint-plugin-react-naming-convention"; @@ -22,7 +21,6 @@ export const plugins = { ...x.plugins, ...dom.plugins, ...webApi.plugins, - "@eslint-react/debug": reactDebug, "@eslint-react/hooks-extra": reactHooksExtra, "@eslint-react/naming-convention": reactNamingConvention, }; diff --git a/packages/plugins/eslint-plugin/src/index.ts b/packages/plugins/eslint-plugin/src/index.ts index afed7ea99..c0db0e713 100644 --- a/packages/plugins/eslint-plugin/src/index.ts +++ b/packages/plugins/eslint-plugin/src/index.ts @@ -1,7 +1,6 @@ import { name, version } from "../package.json"; import type { CompatiblePlugin } from "@eslint-react/shared"; -import reactDebug from "eslint-plugin-react-debug"; import reactDom from "eslint-plugin-react-dom"; import reactHooksExtra from "eslint-plugin-react-hooks-extra"; import reactNamingConvention from "eslint-plugin-react-naming-convention"; @@ -9,9 +8,7 @@ import reactWebApi from "eslint-plugin-react-web-api"; import react from "eslint-plugin-react-x"; import * as allConfig from "./configs/all"; -import * as debugConfig from "./configs/debug"; import * as disableConflictEslintPluginReact from "./configs/disable-conflict-eslint-plugin-react"; -import * as disableDebugConfig from "./configs/disable-debug"; import * as disableDomConfig from "./configs/disable-dom"; import * as disableTypeCheckedConfig from "./configs/disable-type-checked"; import * as disableWebApiConfig from "./configs/disable-web-api"; @@ -40,7 +37,6 @@ const plugin: CompatiblePlugin = { ...padKeysLeft(reactWebApi.rules, "web-api/"), ...padKeysLeft(reactHooksExtra.rules, "hooks-extra/"), ...padKeysLeft(reactNamingConvention.rules, "naming-convention/"), - ...padKeysLeft(reactDebug.rules, "debug/"), }, }; @@ -51,18 +47,10 @@ export default { * Enable all applicable rules from this plugin */ ["all"]: allConfig, - /** - * Enable debug rules - */ - ["debug"]: debugConfig, /** * Disable rules in `eslint-plugin-react` that conflict with rules in our plugins */ ["disable-conflict-eslint-plugin-react"]: disableConflictEslintPluginReact, - /** - * Disable debug rules - */ - ["disable-debug"]: disableDebugConfig, /** * Disable rules in the `dom` preset */ diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index bb52758ca..8f800f08b 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -754,9 +754,6 @@ importers: eslint: specifier: ^9.37.0 version: 9.37.0(jiti@2.6.1) - eslint-plugin-react-debug: - specifier: workspace:* - version: link:../eslint-plugin-react-debug eslint-plugin-react-dom: specifier: workspace:* version: link:../eslint-plugin-react-dom