-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.js
57 lines (55 loc) · 1.62 KB
/
index.js
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
const { fixupConfigRules } = require("@eslint/compat");
const { FlatCompat } = require("@eslint/eslintrc");
const js = require("@eslint/js");
const stylistic = require("@stylistic/eslint-plugin");
const tsParser = require("@typescript-eslint/parser");
const importPlugin = require("eslint-plugin-import");
const perfectionist = require("eslint-plugin-perfectionist");
const eslintPluginPrettierRecommended = require("eslint-plugin-prettier/recommended");
const reactPlugin = require("eslint-plugin-react");
const tseslint = require("typescript-eslint");
const rules = require("./rules");
const compat = new FlatCompat({
baseDirectory: __dirname,
});
module.exports = tseslint.config(
js.configs.recommended,
...tseslint.configs.recommended,
...tseslint.configs.stylistic,
importPlugin.flatConfigs.recommended,
importPlugin.flatConfigs.typescript,
reactPlugin.configs.flat.recommended,
reactPlugin.configs.flat["jsx-runtime"],
...fixupConfigRules(compat.extends("plugin:react-hooks/recommended")),
perfectionist.configs["recommended-natural"],
stylistic.configs["disable-legacy"],
eslintPluginPrettierRecommended,
{
files: ["**/*.{js,mjs,cjs,jsx,mjsx,ts,tsx,mtsx}"],
languageOptions: {
ecmaVersion: "latest",
parser: tsParser,
sourceType: "module",
},
},
{
settings: {
"import/resolver": {
node: {
extensions: [".js", ".jsx", ".ts", ".tsx"],
},
typescript: true,
},
react: {
version: "detect",
},
},
},
...rules,
{
files: ["**/*.js"],
rules: {
"@typescript-eslint/no-require-imports": "off",
},
},
);