Skip to content

Commit

Permalink
refactor: minor improvements
Browse files Browse the repository at this point in the history
  • Loading branch information
Rel1cx committed Nov 23, 2024
1 parent 7447e32 commit 2123b29
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 60 deletions.
2 changes: 1 addition & 1 deletion examples/webpack-react-dom-ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"@tsconfig/node22": "22.0.0",
"@tsconfig/strictest": "2.0.5",
"@types/dotenv-webpack": "7.0.7",
"@types/node": "^22.9.2",
"@types/node": "^22.9.3",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"css-loader": "^7.1.2",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@
"@swc/core": "^1.9.3",
"@tsconfig/node22": "^22.0.0",
"@tsconfig/strictest": "^2.0.5",
"@types/node": "^22.9.2",
"@types/node": "^22.9.3",
"@types/react": "^18.3.12",
"@types/react-dom": "^18.3.1",
"@typescript-eslint/eslint-plugin": "^8.15.0",
Expand Down
9 changes: 3 additions & 6 deletions packages/plugins/eslint-plugin/src/configs/recommended.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,32 +2,29 @@ import type { RulePreset } from "@eslint-react/types";
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";

import * as core from "./core";
import * as dom from "./dom";
import * as webApi from "./web-api";

export const name = "@eslint-react/recommended";

export const rules = {
...core.rules,
...dom.rules,
...webApi.rules,
"@eslint-react/hooks-extra/no-direct-set-state-in-use-effect": "warn",
"@eslint-react/hooks-extra/no-redundant-custom-hook": "warn",
"@eslint-react/hooks-extra/prefer-use-state-lazy-initialization": "warn",
"@eslint-react/web-api/no-leaked-event-listener": "warn",
"@eslint-react/web-api/no-leaked-interval": "warn",
"@eslint-react/web-api/no-leaked-resize-observer": "warn",
"@eslint-react/web-api/no-leaked-timeout": "warn",
} as const satisfies RulePreset;

export const plugins = {
...core.plugins,
...dom.plugins,
...webApi.plugins,
"@eslint-react/debug": reactDebug,
"@eslint-react/hooks-extra": reactHooksExtra,
"@eslint-react/naming-convention": reactNamingConvention,
"@eslint-react/web-api": reactWebApi,
};

export const settings = {
Expand Down
Loading

0 comments on commit 2123b29

Please sign in to comment.