57 lines
1.6 KiB
JavaScript
57 lines
1.6 KiB
JavaScript
|
|
import js from "@eslint/js";
|
||
|
|
import globals from "globals";
|
||
|
|
import tseslint from "typescript-eslint";
|
||
|
|
import pluginReact from "eslint-plugin-react";
|
||
|
|
import { defineConfig } from "eslint/config";
|
||
|
|
import reactHooks from 'eslint-plugin-react-hooks';
|
||
|
|
import prettierConfig from "eslint-config-prettier";
|
||
|
|
import prettier from "eslint-plugin-prettier";
|
||
|
|
export default defineConfig([
|
||
|
|
tseslint.configs.recommended,
|
||
|
|
pluginReact.configs.flat.recommended,
|
||
|
|
js.configs.recommended,
|
||
|
|
prettierConfig,
|
||
|
|
|
||
|
|
{ files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
|
||
|
|
plugins: { js,
|
||
|
|
'react': pluginReact,
|
||
|
|
"@typescript-eslint": tseslint.plugin,
|
||
|
|
'react-hooks': reactHooks,
|
||
|
|
prettier,
|
||
|
|
},
|
||
|
|
settings: {
|
||
|
|
react: { version: 'detect' },
|
||
|
|
},
|
||
|
|
rules: {
|
||
|
|
...pluginReact.configs.recommended.rules,
|
||
|
|
...reactHooks.configs.recommended.rules,
|
||
|
|
"react/jsx-key": "error",
|
||
|
|
'react/react-in-jsx-scope': 'off',
|
||
|
|
'@typescript-eslint/no-unused-vars': ['warn'],
|
||
|
|
'prettier/prettier': 'warn',
|
||
|
|
"@typescript-eslint/no-explicit-any": "off",
|
||
|
|
"no-unused-vars":"off",
|
||
|
|
"no-async-promise-executor": "off",
|
||
|
|
"no-undef": "off",
|
||
|
|
"@typescript-eslint/ban-ts-comment": "off",
|
||
|
|
"no-debugger":"off",
|
||
|
|
"react/prop-types": "off",
|
||
|
|
"@typescript-eslint/ban-types": "off",
|
||
|
|
"@typescript-eslint/no-empty-object-type": "off",
|
||
|
|
"prefer-const": "off",
|
||
|
|
},
|
||
|
|
languageOptions: { globals: globals.browser }
|
||
|
|
},
|
||
|
|
{
|
||
|
|
ignores: [
|
||
|
|
"node_modules/**",
|
||
|
|
"dist/**",
|
||
|
|
"*.config.js",
|
||
|
|
"*.config.ts",
|
||
|
|
"vite.config.ts"
|
||
|
|
]
|
||
|
|
}
|
||
|
|
|
||
|
|
|
||
|
|
]);
|