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
2 changes: 1 addition & 1 deletion .pkgs/eslint-plugin-local/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"devDependencies": {
"@local/configs": "workspace:*",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.8",
"@types/react-dom": "^19.1.9",
"tsdown": "^0.14.2"
},
"peerDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion apps/website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"@types/mdx": "^2.0.13",
"@types/node": "^24.3.0",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.8",
"@types/react-dom": "^19.1.9",
"autoprefixer": "^10.4.21",
"dedent": "^1.6.0",
"eslint": "^9.34.0",
Expand Down
5 changes: 3 additions & 2 deletions examples/lynx/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import eslintJs from "@eslint/js";
import gitignore from "eslint-config-flat-gitignore";
import eslintPluginReactHooks from "eslint-plugin-react-hooks";
import eslintPluginReactX from "eslint-plugin-react-x";
import { defineConfig } from "eslint/config";
import tseslint from "typescript-eslint";

import TSCONFIG from "./tsconfig.json" with { type: "json" };
Expand All @@ -10,7 +11,7 @@ const GLOB_TS = ["**/*.ts", "**/*.tsx"];
const GLOB_JS = ["**/*.js", "**/*.jsx"];
const GLOB_CONFIG = ["**/*.config.{js,mjs,ts,tsx}"];

export default tseslint.config(
export default defineConfig([
gitignore(),
{
files: GLOB_TS,
Expand Down Expand Up @@ -52,4 +53,4 @@ export default tseslint.config(
"no-console": "off",
},
},
);
]);
2 changes: 1 addition & 1 deletion examples/lynx/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
"@lynx-js/qrcode-rsbuild-plugin": "^0.4.1",
"@lynx-js/react-rsbuild-plugin": "^0.10.13",
"@lynx-js/rspeedy": "^0.10.8",
"@lynx-js/types": "^3.3.0",
"@lynx-js/types": "^3.4.11",
"@rsbuild/plugin-sass": "^1.4.0",
"@rsbuild/plugin-type-check": "^1.2.4",
"@types/react": "^19.1.12",
Expand Down
5 changes: 3 additions & 2 deletions examples/next/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import eslintPluginNext from "@next/eslint-plugin-next";
import gitignore from "eslint-config-flat-gitignore";
import eslintPluginReactHooks from "eslint-plugin-react-hooks";
import eslintPluginReactRefresh from "eslint-plugin-react-refresh";
import { defineConfig } from "eslint/config";
import tseslint from "typescript-eslint";

import TSCONFIG from "./tsconfig.json" with { type: "json" };
Expand All @@ -13,7 +14,7 @@ const GLOB_JS = ["**/*.js", "**/*.jsx"];
const GLOB_APP = ["app/**/*.{js,ts,jsx,tsx}"];
const GLOB_CONFIG = ["**/*.config.{js,mjs,ts,tsx}"];

export default tseslint.config(
export default defineConfig([
gitignore(),
{
files: GLOB_TS,
Expand Down Expand Up @@ -65,4 +66,4 @@ export default tseslint.config(
"no-console": "off",
},
},
);
]);
2 changes: 1 addition & 1 deletion examples/next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"@tsconfig/strictest": "^2.0.5",
"@types/node": "^24.3.0",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.8",
"@types/react-dom": "^19.1.9",
"eslint": "^9.34.0",
"eslint-config-flat-gitignore": "^2.1.0",
"eslint-plugin-react-hooks": "^5.2.0",
Expand Down
4 changes: 2 additions & 2 deletions examples/react-dom-js/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
"@eslint/config-inspector": "^1.2.0",
"@eslint/js": "^9.34.0",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.8",
"@vitejs/plugin-react": "^5.0.1",
"@types/react-dom": "^19.1.9",
"@vitejs/plugin-react": "^5.0.2",
"eslint": "^9.34.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
Expand Down
5 changes: 3 additions & 2 deletions examples/react-dom-v1/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import eslintReact from "@eslint-react/eslint-plugin";
import eslintJs from "@eslint/js";
import eslintPluginReactHooks from "eslint-plugin-react-hooks";
import eslintPluginReactRefresh from "eslint-plugin-react-refresh";
import { defineConfig } from "eslint/config";
import tseslint from "typescript-eslint";

import TSCONFIG_APP from "./tsconfig.app.json" with { type: "json" };
import TSCONFIG_NODE from "./tsconfig.node.json" with { type: "json" };

const GLOB_TS = ["**/*.ts", "**/*.tsx"];

export default tseslint.config(
export default defineConfig([
{
files: GLOB_TS,
extends: [
Expand Down Expand Up @@ -155,4 +156,4 @@ export default tseslint.config(
"@eslint-react/naming-convention/use-state": "warn",
},
},
);
]);
4 changes: 2 additions & 2 deletions examples/react-dom-v1/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"@tsconfig/strictest": "^2.0.5",
"@tsconfig/vite-react": "^7.0.0",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.8",
"@vitejs/plugin-react": "^5.0.1",
"@types/react-dom": "^19.1.9",
"@vitejs/plugin-react": "^5.0.2",
"eslint": "^9.34.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
Expand Down
5 changes: 3 additions & 2 deletions examples/react-dom/eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import eslintReact from "@eslint-react/eslint-plugin";
import eslintJs from "@eslint/js";
import eslintPluginReactHooks from "eslint-plugin-react-hooks";
import eslintPluginReactRefresh from "eslint-plugin-react-refresh";
import { defineConfig } from "eslint/config";
import tseslint from "typescript-eslint";

import TSCONFIG_APP from "./tsconfig.app.json" with { type: "json" };
import TSCONFIG_NODE from "./tsconfig.node.json" with { type: "json" };

const GLOB_TS = ["**/*.ts", "**/*.tsx"];

export default tseslint.config(
export default defineConfig([
{
files: GLOB_TS,
extends: [
Expand Down Expand Up @@ -60,4 +61,4 @@ export default tseslint.config(
...eslintPluginReactHooks.configs.recommended.rules,
},
},
);
]);
4 changes: 2 additions & 2 deletions examples/react-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@
"@tsconfig/strictest": "^2.0.5",
"@tsconfig/vite-react": "^7.0.0",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.8",
"@vitejs/plugin-react": "^5.0.1",
"@types/react-dom": "^19.1.9",
"@vitejs/plugin-react": "^5.0.2",
"eslint": "^9.34.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
Expand Down
4 changes: 2 additions & 2 deletions examples/with-babel-eslint-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"@types/babel__core": "~7.20.5",
"@types/babel__preset-env": "~7.10.0",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.8",
"@vitejs/plugin-react": "^5.0.1",
"@types/react-dom": "^19.1.9",
"@vitejs/plugin-react": "^5.0.2",
"eslint": "^9.34.0",
"eslint-plugin-react-debug": "workspace:*",
"eslint-plugin-react-dom": "workspace:*",
Expand Down
7 changes: 3 additions & 4 deletions examples/with-ts-blank-eslint-parser/eslint.config.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
// @ts-check
import eslintReact from "@eslint-react/eslint-plugin";
import eslintJs from "@eslint/js";
import eslintPluginReactHooks from "eslint-plugin-react-hooks";
import eslintPluginReactRefresh from "eslint-plugin-react-refresh";
import { defineConfig } from "eslint/config";
import globals from "globals";
import tsBlankEslintParser from "ts-blank-eslint-parser";
import tseslint from "typescript-eslint";

import TSCONFIG_APP from "./tsconfig.app.json" with { type: "json" };
import TSCONFIG_NODE from "./tsconfig.node.json" with { type: "json" };

export default tseslint.config(
export default defineConfig([
// base configuration for browser environment source files
{
files: TSCONFIG_APP.include,
Expand Down Expand Up @@ -54,4 +53,4 @@ export default tseslint.config(
...eslintPluginReactHooks.configs.recommended.rules,
},
},
);
]);
4 changes: 2 additions & 2 deletions examples/with-ts-blank-eslint-parser/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@
"@tsconfig/strictest": "^2.0.5",
"@tsconfig/vite-react": "^7.0.0",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.8",
"@vitejs/plugin-react": "^5.0.1",
"@types/react-dom": "^19.1.9",
"@vitejs/plugin-react": "^5.0.2",
"eslint": "^9.34.0",
"eslint-plugin-react-hooks": "^5.2.0",
"eslint-plugin-react-refresh": "^0.4.20",
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@
"@tsconfig/strictest": "^2.0.5",
"@types/node": "^24.3.0",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.8",
"@types/react-dom": "^19.1.9",
"@typescript-eslint/parser": "^8.41.0",
"@typescript-eslint/rule-tester": "^8.41.0",
"@typescript-eslint/types": "^8.41.0",
Expand Down Expand Up @@ -118,7 +118,7 @@
"overrides": {
"@eslint/plugin-kit": ">=0.3.5",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.8",
"@types/react-dom": "^19.1.9",
"cross-spawn": "^7.0.6",
"esbuild": "^0.25.9",
"lucide-react": "^0.542.0",
Expand Down
4 changes: 2 additions & 2 deletions packages/plugins/eslint-plugin-react-debug/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"./package.json"
],
"scripts": {
"build": "tsdown --dts-resolve",
"build": "tsdown",
"lint:publish": "publint",
"lint:ts": "tsc --noEmit",
"publish": "pnpm run build && pnpm run lint:publish"
Expand All @@ -57,7 +57,7 @@
"devDependencies": {
"@local/configs": "workspace:*",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.8",
"@types/react-dom": "^19.1.9",
"tsdown": "^0.14.2"
},
"peerDependencies": {
Expand Down
9 changes: 5 additions & 4 deletions packages/plugins/eslint-plugin-react-debug/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { RulePreset } from "@eslint-react/kit";
import type { CompatibleConfig } from "@eslint-react/shared";

import * as allConfig from "./configs/all";
import { plugin } from "./plugin";

function makeConfig(config: { name: string; rules: RulePreset }) {
function toFlatConfig(config: CompatibleConfig) {
return {
...config,
plugins: {
Expand All @@ -12,7 +13,7 @@ function makeConfig(config: { name: string; rules: RulePreset }) {
};
}

function makeLegacyConfig({ rules }: { rules: RulePreset }) {
function toLegacyConfig({ rules }: { rules: RulePreset }) {
return {
plugins: ["react-debug"],
rules,
Expand All @@ -22,7 +23,7 @@ function makeLegacyConfig({ rules }: { rules: RulePreset }) {
export default {
...plugin,
configs: {
["all"]: makeConfig(allConfig),
["all-legacy"]: makeLegacyConfig(allConfig),
["all"]: toFlatConfig(allConfig),
["all-legacy"]: toLegacyConfig(allConfig),
},
};
7 changes: 5 additions & 2 deletions packages/plugins/eslint-plugin-react-debug/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import type { CompatiblePlugin } from "@eslint-react/shared";

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

import classComponent from "./rules/class-component";
import functionComponent from "./rules/function-component";
import hook from "./rules/hook";
import isFromReact from "./rules/is-from-react";
import jsx from "./rules/jsx";

export const plugin = {
export const plugin: CompatiblePlugin = {
meta: {
name,
version,
Expand All @@ -17,4 +20,4 @@ export const plugin = {
["is-from-react"]: isFromReact,
["jsx"]: jsx,
},
} as const;
};
4 changes: 2 additions & 2 deletions packages/plugins/eslint-plugin-react-dom/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
"./package.json"
],
"scripts": {
"build": "tsdown --dts-resolve",
"build": "tsdown",
"lint:publish": "publint",
"lint:ts": "tsc --noEmit",
"publish": "pnpm run build && pnpm run lint:publish"
Expand All @@ -57,7 +57,7 @@
"devDependencies": {
"@local/configs": "workspace:*",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.8",
"@types/react-dom": "^19.1.9",
"tsdown": "^0.14.2"
},
"peerDependencies": {
Expand Down
9 changes: 5 additions & 4 deletions packages/plugins/eslint-plugin-react-dom/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import type { RulePreset } from "@eslint-react/kit";
import type { CompatibleConfig } from "@eslint-react/shared";

import * as recommendedConfig from "./configs/recommended";
import { plugin } from "./plugin";

function makeConfig(config: { name: string; rules: RulePreset }) {
function toFlatConfig(config: CompatibleConfig) {
return {
...config,
plugins: {
Expand All @@ -12,7 +13,7 @@ function makeConfig(config: { name: string; rules: RulePreset }) {
};
}

function makeLegacyConfig({ rules }: { rules: RulePreset }) {
function toLegacyConfig({ rules }: { rules: RulePreset }) {
return {
plugins: ["react-dom"],
rules,
Expand All @@ -22,7 +23,7 @@ function makeLegacyConfig({ rules }: { rules: RulePreset }) {
export default {
...plugin,
configs: {
["recommended"]: makeConfig(recommendedConfig),
["recommended-legacy"]: makeLegacyConfig(recommendedConfig),
["recommended"]: toFlatConfig(recommendedConfig),
["recommended-legacy"]: toLegacyConfig(recommendedConfig),
},
};
7 changes: 5 additions & 2 deletions packages/plugins/eslint-plugin-react-dom/src/plugin.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import type { CompatiblePlugin } from "@eslint-react/shared";

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

import noDangerouslySetInnerHTML from "./rules/no-dangerously-set-innerhtml";
import noDangerouslySetInnerHTMLWithChildren from "./rules/no-dangerously-set-innerhtml-with-children";
import noFindDomNode from "./rules/no-find-dom-node";
Expand All @@ -17,7 +20,7 @@ import noUnsafeTargetBlank from "./rules/no-unsafe-target-blank";
import noUseFormState from "./rules/no-use-form-state";
import noVoidElementsWithChildren from "./rules/no-void-elements-with-children";

export const plugin = {
export const plugin: CompatiblePlugin = {
meta: {
name,
version,
Expand All @@ -41,4 +44,4 @@ export const plugin = {
"no-use-form-state": noUseFormState,
"no-void-elements-with-children": noVoidElementsWithChildren,
},
} as const;
};
4 changes: 2 additions & 2 deletions packages/plugins/eslint-plugin-react-hooks-extra/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"./package.json"
],
"scripts": {
"build": "tsdown --dts-resolve",
"build": "tsdown",
"lint:publish": "publint",
"lint:ts": "tsc --noEmit",
"publish": "pnpm run build && pnpm run lint:publish"
Expand All @@ -58,7 +58,7 @@
"devDependencies": {
"@local/configs": "workspace:*",
"@types/react": "^19.1.12",
"@types/react-dom": "^19.1.8",
"@types/react-dom": "^19.1.9",
"tsdown": "^0.14.2"
},
"peerDependencies": {
Expand Down
Loading