-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
85 lines (82 loc) · 2.53 KB
/
eslint.config.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
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
import eslintPluginTypeScript from "@typescript-eslint/eslint-plugin";
import eslintParserTypeScript from "@typescript-eslint/parser";
import eslintConfigPrettier from "eslint-config-prettier";
import eslintPluginImport from "eslint-plugin-import";
import eslintPluginPrettier from "eslint-plugin-prettier";
import eslintPluginReact from "eslint-plugin-react";
import eslintPluginReactHooks from "eslint-plugin-react-hooks";
import eslintPluginSimpleImportSort from "eslint-plugin-simple-import-sort";
import eslintPluginTailwind from "eslint-plugin-tailwindcss";
export default [
{
ignores: [
"node_modules/**",
"**/dist/**",
"**/.prettierrc.*",
"src-tauri/**",
],
},
{
files: ["**/*.{js,jsx,ts,tsx}"],
languageOptions: {
ecmaVersion: "latest",
sourceType: "module",
parser: eslintParserTypeScript,
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
},
plugins: {
react: eslintPluginReact,
"@typescript-eslint": eslintPluginTypeScript,
prettier: eslintPluginPrettier,
import: eslintPluginImport,
"simple-import-sort": eslintPluginSimpleImportSort,
"react-hooks": eslintPluginReactHooks,
},
rules: {
...eslintPluginReact.configs.recommended.rules,
...eslintPluginTypeScript.configs.recommended.rules,
"prettier/prettier": ["error"],
"react/react-in-jsx-scope": "off",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": ["error"],
"@typescript-eslint/no-unused-expressions": "off",
"import/named": "off",
"import/no-extraneous-dependencies": "off",
"import/no-unresolved": "off",
"simple-import-sort/imports": [
"error",
{
groups: [
["^react", "^@?\\w"],
["^\\.\\.(?!/?$)", "^\\.\\./?$"],
["^\\./(?=.*/)(?!/?$)", "^\\.(?!/?$)", "^\\./?$"],
["^.+\\.s?css$"],
],
},
],
"simple-import-sort/exports": "error",
"react/jsx-indent": ["error", 2],
"react/jsx-indent-props": ["error", 2],
"no-multiple-empty-lines": ["error", { max: 1, maxEOF: 1 }],
"react-hooks/rules-of-hooks": "error",
"react-hooks/exhaustive-deps": "warn",
},
settings: {
react: {
version: "detect",
},
"import/resolver": {
typescript: {
alwaysTryTypes: true,
project: "./tsconfig.json",
},
},
},
},
eslintConfigPrettier,
...eslintPluginTailwind.configs["flat/recommended"],
];