2023-07-15 20:55:17 +08:00
|
|
|
module.exports = {
|
2023-12-23 15:20:36 +08:00
|
|
|
env: {
|
|
|
|
browser: true,
|
|
|
|
es2021: true,
|
|
|
|
},
|
2023-07-16 19:33:43 +08:00
|
|
|
extends: [
|
|
|
|
"eslint:recommended",
|
|
|
|
"plugin:@typescript-eslint/recommended",
|
|
|
|
"plugin:@typescript-eslint/recommended-requiring-type-checking",
|
2023-12-23 15:20:36 +08:00
|
|
|
"plugin:react/recommended",
|
2023-07-16 19:33:43 +08:00
|
|
|
"plugin:react-hooks/recommended",
|
2023-12-23 15:20:36 +08:00
|
|
|
"eslint-config-prettier",
|
|
|
|
],
|
|
|
|
overrides: [
|
|
|
|
{
|
|
|
|
env: { node: true },
|
|
|
|
files: [".eslintrc.{js,cjs}"],
|
|
|
|
parserOptions: { sourceType: "script" },
|
|
|
|
},
|
2023-07-15 20:55:17 +08:00
|
|
|
],
|
2023-12-23 15:20:36 +08:00
|
|
|
settings: { react: { version: "detect" } },
|
2023-07-16 19:33:43 +08:00
|
|
|
parser: "@typescript-eslint/parser",
|
|
|
|
parserOptions: {
|
|
|
|
ecmaVersion: "latest",
|
|
|
|
sourceType: "module",
|
|
|
|
project: true,
|
2023-12-23 15:20:36 +08:00
|
|
|
tsconfigRootDir: __dirname,
|
2023-07-16 19:33:43 +08:00
|
|
|
},
|
2023-12-23 15:20:36 +08:00
|
|
|
plugins: ["@typescript-eslint", "react", "react-refresh", "prettier"],
|
2023-07-16 19:33:43 +08:00
|
|
|
rules: {
|
2023-12-23 15:20:36 +08:00
|
|
|
"linebreak-style": ["error", "unix"],
|
|
|
|
"quotes": ["error", "double"],
|
|
|
|
"react/react-in-jsx-scope": ["off"],
|
2023-07-22 14:01:51 +08:00
|
|
|
"@typescript-eslint/no-unused-vars": [
|
|
|
|
"warn",
|
|
|
|
{
|
|
|
|
"argsIgnorePattern": "^_",
|
|
|
|
"varsIgnorePattern": "^_",
|
2023-12-23 15:20:36 +08:00
|
|
|
"caughtErrorsIgnorePattern": "^_",
|
|
|
|
},
|
|
|
|
],
|
|
|
|
"prettier/prettier": ["error"],
|
|
|
|
},
|
2023-07-16 19:33:43 +08:00
|
|
|
};
|