eslint.config.mjs
import js from "@eslint/js";
import globals from "globals";
import eslintConfigPrettier from "eslint-config-prettier";
import react from "eslint-plugin-react";
import reactHooks from "eslint-plugin-react-hooks";
import tseslint from "typescript-eslint";
import { fixupPluginRules } from "@eslint/compat";
export default [
js.configs.recommended,
...tseslint.configs.recommended,
eslintConfigPrettier,
{
plugins: {
react: react,
'react-hooks': fixupPluginRules(reactHooks),
},
rules: {
...react.configs.recommended.rules,
...react.configs["jsx-runtime"].rules,
...reactHooks.configs.recommended.rules,
},
settings: {
react: {
version: 'detect',
},
},
},
{
languageOptions: {
globals: { ...globals.browser },
ecmaVersion: "latest",
sourceType: "module",
parserOptions: {
project: true
}
},
rules: {
"linebreak-style": ["error", "unix"],
quotes: ["error", "double", { avoidEscape: true }],
semi: ["error", "always"]
}
}
];