Skip to content

Commit

Permalink
Cleanup eslint common files
Browse files Browse the repository at this point in the history
  • Loading branch information
mrlika committed Nov 17, 2024
1 parent 882f210 commit 31871a8
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 13 deletions.
2 changes: 0 additions & 2 deletions eslint.common.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import globals from "globals";
import eslint from "@eslint/js";
import tsEslint from "typescript-eslint";
Expand Down
14 changes: 3 additions & 11 deletions eslint.common.react.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
// @ts-check

import { CommonConfig } from "./eslint.common.config.js";
import reactRefresh from "eslint-plugin-react-refresh";
import reactHooks from "eslint-plugin-react-hooks";
Expand All @@ -8,22 +6,16 @@ import react from "@eslint-react/eslint-plugin";

export const CommonReactConfig = /** @type {typeof CommonConfig} */ ([
...CommonConfig,
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
reactPlugin.configs.flat?.recommended, // This is not a plugin object, but a shareable config object
reactPlugin.configs.flat?.["jsx-runtime"], // Add this if you are using React 17+
reactPlugin.configs.flat?.recommended,
reactPlugin.configs.flat?.["jsx-runtime"],
react.configs.all,
{
plugins: {
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
"react-hooks": reactHooks,
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
"react-refresh": reactRefresh,
},
rules: {
.../** @type {Record<string, string>} */ (
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
reactHooks.configs.recommended.rules
),
...reactHooks.configs.recommended.rules,
"import/extensions": "off",
"@eslint-react/avoid-shorthand-fragment": "off",
"@eslint-react/avoid-shorthand-boolean": "off",
Expand Down

0 comments on commit 31871a8

Please sign in to comment.