Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,11 @@
## v1.52.9 (2025-08-31)

### 🐞 Fixes

- fix: issue introduced in version [v1.52.7](https://github.com/Rel1cx/eslint-react/releases/tag/v1.52.7) where the `react-hooks-extra` rules were not exported, closes #1207 by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1208

**Full Changelog**: https://github.com/Rel1cx/eslint-react/compare/v1.52.8...v1.52.9

## v1.52.8 (2025-08-29)

### 🐞 Fixes
Expand Down
8 changes: 8 additions & 0 deletions apps/website/content/docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,14 @@
title: Changelog
---

## v1.52.9 (2025-08-31)

### 🐞 Fixes

- fix: issue introduced in version [v1.52.7](https://github.com/Rel1cx/eslint-react/releases/tag/v1.52.7) where the `react-hooks-extra` rules were not exported, closes #1207 by @Rel1cx in https://github.com/Rel1cx/eslint-react/pull/1208

**Full Changelog**: https://github.com/Rel1cx/eslint-react/compare/v1.52.8...v1.52.9

## v1.52.8 (2025-08-29)

### 🐞 Fixes
Expand Down
2 changes: 2 additions & 0 deletions examples/react-dom/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
// @ts-check

import eslintReact from "@eslint-react/eslint-plugin";
import eslintJs from "@eslint/js";
import eslintPluginReactHooks from "eslint-plugin-react-hooks";
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/eslint-plugin-react-debug/src/configs/all.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RulePreset } from "@eslint-react/kit";
import type { RuleConfig } from "@eslint-react/kit";
import { DEFAULT_ESLINT_REACT_SETTINGS } from "@eslint-react/shared";

export const name = "react-debug/all";
Expand All @@ -9,7 +9,7 @@ export const rules = {
"react-debug/hook": "warn",
"react-debug/is-from-react": "warn",
"react-debug/jsx": "warn",
} as const satisfies RulePreset;
} as const satisfies Record<string, RuleConfig>;

export const settings = {
"react-x": DEFAULT_ESLINT_REACT_SETTINGS,
Expand Down
5 changes: 2 additions & 3 deletions packages/plugins/eslint-plugin-react-debug/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { RulePreset } from "@eslint-react/kit";
import type { CompatibleConfig } from "@eslint-react/shared";
import type { CompatibleConfig } from "@eslint-react/kit";

import * as allConfig from "./configs/all";
import { plugin } from "./plugin";
Expand All @@ -13,7 +12,7 @@ function toFlatConfig(config: CompatibleConfig) {
};
}

function toLegacyConfig({ rules }: { rules: RulePreset }) {
function toLegacyConfig({ rules }: CompatibleConfig) {
return {
plugins: ["react-debug"],
rules,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/eslint-plugin-react-debug/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CompatiblePlugin } from "@eslint-react/shared";
import type { CompatiblePlugin } from "@eslint-react/kit";

import { name, version } from "../package.json";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RulePreset } from "@eslint-react/kit";
import type { RuleConfig } from "@eslint-react/kit";
import { DEFAULT_ESLINT_REACT_SETTINGS } from "@eslint-react/shared";

export const name = "react-dom/recommended";
Expand All @@ -20,7 +20,7 @@ export const rules = {
"react-dom/no-unsafe-target-blank": "warn",
"react-dom/no-use-form-state": "error",
"react-dom/no-void-elements-with-children": "error",
} as const satisfies RulePreset;
} as const satisfies Record<string, RuleConfig>;

export const settings = {
"react-x": DEFAULT_ESLINT_REACT_SETTINGS,
Expand Down
5 changes: 2 additions & 3 deletions packages/plugins/eslint-plugin-react-dom/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import type { RulePreset } from "@eslint-react/kit";
import type { CompatibleConfig } from "@eslint-react/shared";
import type { CompatibleConfig } from "@eslint-react/kit";

import * as recommendedConfig from "./configs/recommended";
import { plugin } from "./plugin";
Expand All @@ -13,7 +12,7 @@ function toFlatConfig(config: CompatibleConfig) {
};
}

function toLegacyConfig({ rules }: { rules: RulePreset }) {
function toLegacyConfig({ rules }: CompatibleConfig) {
return {
plugins: ["react-dom"],
rules,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/eslint-plugin-react-dom/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CompatiblePlugin } from "@eslint-react/shared";
import type { CompatiblePlugin } from "@eslint-react/kit";

import { name, version } from "../package.json";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { RulePreset } from "@eslint-react/kit";
import type { RuleConfig } from "@eslint-react/kit";

export const name = "react-hooks-extra/recommended";

export const rules = {
"react-hooks-extra/no-direct-set-state-in-use-effect": "warn",
} as const satisfies RulePreset;
} as const satisfies Record<string, RuleConfig>;
6 changes: 3 additions & 3 deletions packages/plugins/eslint-plugin-react-hooks-extra/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RulePreset } from "@eslint-react/kit";
import type { CompatibleConfig } from "@eslint-react/shared";
import type { RuleConfig } from "@eslint-react/kit";

Check warning on line 1 in packages/plugins/eslint-plugin-react-hooks-extra/src/index.ts

View workflow job for this annotation

GitHub Actions / check

'RuleConfig' is defined but never used

Check warning on line 1 in packages/plugins/eslint-plugin-react-hooks-extra/src/index.ts

View workflow job for this annotation

GitHub Actions / Publish

'RuleConfig' is defined but never used
import type { CompatibleConfig } from "@eslint-react/kit";

import * as recommendedConfig from "./configs/recommended";
import { plugin } from "./plugin";
Expand All @@ -13,7 +13,7 @@
};
}

function toLegacyConfig({ rules }: { rules: RulePreset }) {
function toLegacyConfig({ rules }: CompatibleConfig) {
return {
plugins: ["react-hooks-extra"],
rules,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CompatiblePlugin } from "@eslint-react/shared";
import type { CompatiblePlugin } from "@eslint-react/kit";

import { name, version } from "../package.json";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { RulePreset } from "@eslint-react/kit";
import type { RuleConfig } from "@eslint-react/kit";

export const name = "react-naming-convention/recommended";

export const rules = {
"react-naming-convention/context-name": "warn",
// "react-naming-convention/use-state": "warn",
} as const satisfies RulePreset;
} as const satisfies Record<string, RuleConfig>;
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RulePreset } from "@eslint-react/kit";
import type { CompatibleConfig } from "@eslint-react/shared";
import type { RuleConfig } from "@eslint-react/kit";

Check warning on line 1 in packages/plugins/eslint-plugin-react-naming-convention/src/index.ts

View workflow job for this annotation

GitHub Actions / check

'RuleConfig' is defined but never used

Check warning on line 1 in packages/plugins/eslint-plugin-react-naming-convention/src/index.ts

View workflow job for this annotation

GitHub Actions / Publish

'RuleConfig' is defined but never used
import type { CompatibleConfig } from "@eslint-react/kit";

import * as recommendedConfig from "./configs/recommended";
import { plugin } from "./plugin";
Expand All @@ -13,7 +13,7 @@
};
}

function toLegacyConfig({ rules }: { rules: RulePreset }) {
function toLegacyConfig({ rules }: CompatibleConfig) {
return {
plugins: ["react-naming-convention"],
rules,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CompatiblePlugin } from "@eslint-react/shared";
import type { CompatiblePlugin } from "@eslint-react/kit";

import { name, version } from "../package.json";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RulePreset } from "@eslint-react/kit";
import type { RuleConfig } from "@eslint-react/kit";
import { DEFAULT_ESLINT_REACT_SETTINGS } from "@eslint-react/shared";

export const name = "react-web-api/recommended";
Expand All @@ -8,7 +8,7 @@ export const rules = {
"react-web-api/no-leaked-interval": "warn",
"react-web-api/no-leaked-resize-observer": "warn",
"react-web-api/no-leaked-timeout": "warn",
} as const satisfies RulePreset;
} as const satisfies Record<string, RuleConfig>;

export const settings = {
"react-x": DEFAULT_ESLINT_REACT_SETTINGS,
Expand Down
6 changes: 3 additions & 3 deletions packages/plugins/eslint-plugin-react-web-api/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RulePreset } from "@eslint-react/kit";
import type { CompatibleConfig } from "@eslint-react/shared";
import type { RuleConfig } from "@eslint-react/kit";

Check warning on line 1 in packages/plugins/eslint-plugin-react-web-api/src/index.ts

View workflow job for this annotation

GitHub Actions / check

'RuleConfig' is defined but never used

Check warning on line 1 in packages/plugins/eslint-plugin-react-web-api/src/index.ts

View workflow job for this annotation

GitHub Actions / Publish

'RuleConfig' is defined but never used
import type { CompatibleConfig } from "@eslint-react/kit";

import * as recommendedConfig from "./configs/recommended";
import { plugin } from "./plugin";
Expand All @@ -13,7 +13,7 @@
};
}

function toLegacyConfig({ rules }: { rules: RulePreset }) {
function toLegacyConfig({ rules }: CompatibleConfig) {
return {
plugins: ["react-web-api"],
rules,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/eslint-plugin-react-web-api/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CompatiblePlugin } from "@eslint-react/shared";
import type { CompatiblePlugin } from "@eslint-react/kit";

import { name, version } from "../package.json";

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RulePreset } from "@eslint-react/kit";
import type { RuleConfig } from "@eslint-react/kit";

import * as recommendedTypeScript from "./recommended-typescript";

Expand All @@ -8,7 +8,7 @@ export const rules = {
...recommendedTypeScript.rules,
"react-x/no-leaked-conditional-rendering": "warn",
"react-x/no-unused-props": "warn",
} as const satisfies RulePreset;
} as const satisfies Record<string, RuleConfig>;

export const settings = {
...recommendedTypeScript.settings,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RulePreset } from "@eslint-react/kit";
import type { RuleConfig } from "@eslint-react/kit";

import * as recommended from "./recommended";

Expand All @@ -10,7 +10,7 @@ export const rules = {
"react-x/jsx-no-undef": "off",
"react-x/jsx-uses-react": "off",
"react-x/jsx-uses-vars": "off",
} as const satisfies RulePreset;
} as const satisfies Record<string, RuleConfig>;

export const settings = {
...recommended.settings,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RulePreset } from "@eslint-react/kit";
import type { RuleConfig } from "@eslint-react/kit";
import { DEFAULT_ESLINT_REACT_SETTINGS } from "@eslint-react/shared";

export const name = "react-x/recommended";
Expand Down Expand Up @@ -47,7 +47,7 @@ export const rules = {
"react-x/no-use-context": "warn",
"react-x/no-useless-forward-ref": "warn",
"react-x/prefer-use-state-lazy-initialization": "warn",
} as const satisfies RulePreset;
} as const satisfies Record<string, RuleConfig>;

export const settings = {
"react-x": DEFAULT_ESLINT_REACT_SETTINGS,
Expand Down
6 changes: 3 additions & 3 deletions packages/plugins/eslint-plugin-react-x/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { RulePreset } from "@eslint-react/kit";
import type { CompatibleConfig } from "@eslint-react/shared";
import type { RuleConfig } from "@eslint-react/kit";

Check warning on line 1 in packages/plugins/eslint-plugin-react-x/src/index.ts

View workflow job for this annotation

GitHub Actions / check

'RuleConfig' is defined but never used

Check warning on line 1 in packages/plugins/eslint-plugin-react-x/src/index.ts

View workflow job for this annotation

GitHub Actions / Publish

'RuleConfig' is defined but never used
import type { CompatibleConfig } from "@eslint-react/kit";

import * as recommendedConfig from "./configs/recommended";
import * as recommendedTypeCheckedConfig from "./configs/recommended-type-checked";
Expand All @@ -15,7 +15,7 @@
};
}

function toLegacyConfig({ rules }: { rules: RulePreset }) {
function toLegacyConfig({ rules }: CompatibleConfig) {
return {
plugins: ["react-x"],
rules,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugins/eslint-plugin-react-x/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { CompatiblePlugin } from "@eslint-react/shared";
import type { CompatiblePlugin } from "@eslint-react/kit";

import { name, version } from "../package.json";

Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/eslint-plugin/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@ export default tseslint.config({

Contributions are welcome!

Please follow our [contributing guidelines](https://github.com/Rel1cx/eslint-react/tree/2.0.0/.github/CONTRIBUTING.md).
Please follow our [contributing guidelines](https://github.com/Rel1cx/eslint-react/tree/feature/refine-plugin-configuration-types/.github/CONTRIBUTING.md).

## License

This project is licensed under the MIT License - see the [LICENSE](https://github.com/Rel1cx/eslint-react/tree/2.0.0/LICENSE) file for details.
This project is licensed under the MIT License - see the [LICENSE](https://github.com/Rel1cx/eslint-react/tree/feature/refine-plugin-configuration-types/LICENSE) file for details.
4 changes: 2 additions & 2 deletions packages/plugins/eslint-plugin/src/configs/all.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RulePreset } from "@eslint-react/kit";
import type { RuleConfig } from "@eslint-react/kit";
import reactDebug from "eslint-plugin-react-debug";
import reactHooksExtra from "eslint-plugin-react-hooks-extra";
import reactNamingConvention from "eslint-plugin-react-naming-convention";
Expand Down Expand Up @@ -104,7 +104,7 @@ export const rules = {
"@eslint-react/naming-convention/filename": "warn",
"@eslint-react/naming-convention/filename-extension": "warn",
"@eslint-react/naming-convention/use-state": "warn",
} as const satisfies RulePreset;
} as const satisfies Record<string, RuleConfig>;

export const plugins = {
...x.plugins,
Expand Down
4 changes: 3 additions & 1 deletion packages/plugins/eslint-plugin/src/configs/debug.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import type { RuleConfig } from "@eslint-react/kit";

import reactDebug from "eslint-plugin-react-debug";

export const name = "@eslint-react/debug";
Expand All @@ -8,7 +10,7 @@ export const rules = {
"@eslint-react/debug/hook": "warn",
"@eslint-react/debug/is-from-react": "warn",
"@eslint-react/debug/jsx": "warn",
} as const;
} as const satisfies Record<string, RuleConfig>;

export const plugins = {
"@eslint-react/debug": reactDebug,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RulePreset } from "@eslint-react/kit";
import type { RuleConfig } from "@eslint-react/kit";

// This rulelist should be kept in sync with `apps/website/content/docs/migration.mdx`
// Rules provided by `eslint-plugin-react` that exist in this plugin.
Expand Down Expand Up @@ -54,6 +54,6 @@ const conflictingRules = [

export const name = "@eslint-react/disable-conflict-eslint-plugin-react";

export const rules: RulePreset = Object.fromEntries(
export const rules: Record<string, RuleConfig> = Object.fromEntries(
conflictingRules.map((key) => [key, "off"] as const),
);
6 changes: 4 additions & 2 deletions packages/plugins/eslint-plugin/src/configs/disable-debug.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type { RulePreset } from "@eslint-react/kit";
import type { RuleConfig } from "@eslint-react/kit";

import { rules as debugRules } from "./debug";

export const name = "@eslint-react/disable-debug";

export const rules: RulePreset = Object.fromEntries(Object.entries(debugRules).map(([rule]) => [rule, "off"]));
export const rules: Record<string, RuleConfig> = Object.fromEntries(
Object.entries(debugRules).map(([rule]) => [rule, "off"]),
);
6 changes: 4 additions & 2 deletions packages/plugins/eslint-plugin/src/configs/disable-dom.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type { RulePreset } from "@eslint-react/kit";
import type { RuleConfig } from "@eslint-react/kit";

import { rules as domRules } from "./dom";

export const name = "@eslint-react/disable-dom";

export const rules: RulePreset = Object.fromEntries(Object.entries(domRules).map(([key]) => [key, "off"] as const));
export const rules: Record<string, RuleConfig> = Object.fromEntries(
Object.entries(domRules).map(([key]) => [key, "off"] as const),
);
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import type { RulePreset } from "@eslint-react/kit";
import type { RuleConfig } from "@eslint-react/kit";

export const name = "@eslint-react/disable-type-checked";

export const rules: RulePreset = {
export const rules: Record<string, RuleConfig> = {
"@eslint-react/no-leaked-conditional-rendering": "off",
"@eslint-react/no-unused-props": "off",
"@eslint-react/prefer-read-only-props": "off",
Expand Down
6 changes: 4 additions & 2 deletions packages/plugins/eslint-plugin/src/configs/disable-web-api.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import type { RulePreset } from "@eslint-react/kit";
import type { RuleConfig } from "@eslint-react/kit";

import { rules as webApiRules } from "./web-api";

export const name = "@eslint-react/disable-web-api";

export const rules: RulePreset = Object.fromEntries(Object.entries(webApiRules).map(([key]) => [key, "off"] as const));
export const rules: Record<string, RuleConfig> = Object.fromEntries(
Object.entries(webApiRules).map(([key]) => [key, "off"] as const),
);
4 changes: 2 additions & 2 deletions packages/plugins/eslint-plugin/src/configs/dom.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RulePreset } from "@eslint-react/kit";
import type { RuleConfig } from "@eslint-react/kit";
import { DEFAULT_ESLINT_REACT_SETTINGS } from "@eslint-react/shared";
import reactDom from "eslint-plugin-react-dom";

Expand All @@ -20,7 +20,7 @@ export const rules = {
"@eslint-react/dom/no-unsafe-target-blank": "warn",
"@eslint-react/dom/no-use-form-state": "error",
"@eslint-react/dom/no-void-elements-with-children": "error",
} as const satisfies RulePreset;
} as const satisfies Record<string, RuleConfig>;

export const plugins = {
"@eslint-react/dom": reactDom,
Expand Down
Loading