-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.mjs
87 lines (79 loc) · 2.31 KB
/
eslint.config.mjs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
import importLint from "eslint-plugin-import";
import jsLint from "@eslint/js";
import tsLint from "typescript-eslint";
import tsParser from "@typescript-eslint/parser";
import prettierConfig from "eslint-plugin-prettier/recommended";
import eslintPluginReact from "eslint-plugin-react";
import eslintPluginReactHooks from "eslint-plugin-react-hooks";
import { fixupConfigRules } from "@eslint/compat";
import globals from "globals";
eslintPluginReactHooks.configs.recommended.plugins = {
"react-hooks": eslintPluginReactHooks,
};
export default [
jsLint.configs.recommended,
...fixupConfigRules(tsLint.configs.recommended),
...fixupConfigRules(eslintPluginReact.configs.flat.recommended),
...fixupConfigRules(importLint.flatConfigs.recommended),
...fixupConfigRules(importLint.flatConfigs.typescript),
...fixupConfigRules(eslintPluginReactHooks.configs.recommended),
...fixupConfigRules(prettierConfig),
{
files: ["**/*.{js,mjs,cjs,ts,mts,jsx,tsx}"],
plugins: {},
languageOptions: {
parser: tsParser,
ecmaVersion: 2022,
sourceType: "module",
globals: {
...globals.browser,
},
parserOptions: {
ecmaFeatures: {
jsx: true,
},
tsconfigRootDir: ".",
project: ["./tsconfig.json"],
},
},
settings: {
react: {
version: "detect",
},
},
rules: {
"no-console": "off",
"no-debugger": "warn",
"no-eval": "error",
"import/first": "error",
"import/no-named-as-default-member": "off",
"import/no-named-as-default": "off",
"import/no-unresolved": "off",
"prettier/prettier": "warn",
"react/prop-types": "off",
"@typescript-eslint/no-redundant-type-constituents": "off",
"@typescript-eslint/no-unused-vars": [
"error",
{
args: "all",
argsIgnorePattern: "^_",
caughtErrors: "all",
caughtErrorsIgnorePattern: "^_",
destructuredArrayIgnorePattern: "^_",
varsIgnorePattern: "^_",
ignoreRestSiblings: true,
},
],
"@typescript-eslint/no-misused-promises": [
"error",
{
checksVoidReturn: {
arguments: false,
attributes: false,
properties: false,
},
},
],
},
},
];