51 lines
1.6 KiB
JavaScript
51 lines
1.6 KiB
JavaScript
import js from "@eslint/js";
|
|
import eslintConfigPrettier from "eslint-config-prettier";
|
|
import * as pluginImport from "eslint-plugin-import";
|
|
import reactPlugin from "eslint-plugin-react";
|
|
import reactHooks from "eslint-plugin-react-hooks";
|
|
import reactRefresh from "eslint-plugin-react-refresh";
|
|
import globals from "globals";
|
|
import viteConfigObj from "./vite.config.js";
|
|
|
|
export default [
|
|
{ ignores: ["dist", "vite.config.js"] },
|
|
{
|
|
files: ["**/*.{js,jsx}"],
|
|
languageOptions: {
|
|
globals: globals.browser,
|
|
},
|
|
settings: {
|
|
react: {
|
|
version: "detect",
|
|
},
|
|
"import/resolver": {
|
|
node: {
|
|
extensions: [".js", ".jsx", ".ts", ".tsx"],
|
|
},
|
|
vite: {
|
|
viteConfig: viteConfigObj,
|
|
},
|
|
},
|
|
},
|
|
plugins: {
|
|
react: reactPlugin,
|
|
"react-hooks": reactHooks,
|
|
"react-refresh": reactRefresh,
|
|
import: pluginImport,
|
|
},
|
|
},
|
|
js.configs.recommended,
|
|
pluginImport.configs.recommended,
|
|
reactRefresh.configs.recommended,
|
|
reactPlugin.configs.recommended,
|
|
reactPlugin.configs["jsx-runtime"],
|
|
eslintConfigPrettier,
|
|
{
|
|
rules: {
|
|
...reactHooks.configs.recommended.rules,
|
|
"no-unused-vars": ["error", { varsIgnorePattern: "^[A-Z_]" }],
|
|
"react-refresh/only-export-components": ["warn", { allowConstantExport: true }],
|
|
"react/prop-types": ["off"],
|
|
},
|
|
},
|
|
]; |