-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy patheslint.config.js
101 lines (100 loc) · 2.59 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
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
import js from "@eslint/js";
import globals from "globals";
import prettier from "eslint-plugin-prettier/recommended";
import reactHooks from "eslint-plugin-react-hooks";
import reactRefresh from "eslint-plugin-react-refresh";
import perfectionist from "eslint-plugin-perfectionist";
import unicorn from "eslint-plugin-unicorn";
import tailwind from "eslint-plugin-tailwindcss";
import tseslint from "typescript-eslint";
import vitest from "@vitest/eslint-plugin";
import pluginQuery from "@tanstack/eslint-plugin-query";
export default tseslint.config(
{ ignores: ["dist"] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ["**/*.{ts,tsx}"],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
"react-hooks": reactHooks,
"react-refresh": reactRefresh,
unicorn,
tailwindcss: tailwind,
"@tanstack/query": pluginQuery,
perfectionist,
},
rules: {
...reactHooks.configs.recommended.rules,
...unicorn.configs.recommended.rules,
...tailwind.configs.recommended.rules,
...pluginQuery.configs.recommended.rules,
...perfectionist.configs["recommended-natural"].rules,
"react-refresh/only-export-components": [
"warn",
{ allowConstantExport: true },
],
"unicorn/custom-error-definition": "error",
"unicorn/empty-brace-spaces": "error",
"unicorn/no-array-for-each": "off",
"unicorn/no-array-reduce": "off",
"unicorn/no-console-spaces": "error",
"unicorn/no-null": "off",
"unicorn/filename-case": [
"error",
{
cases: {
kebabCase: true,
pascalCase: true,
},
},
],
"unicorn/prevent-abbreviations": [
"error",
{
replacements: {
db: false,
arg: false,
args: false,
env: false,
fn: false,
func: {
fn: true,
function: false,
},
prop: false,
props: false,
ref: false,
refs: false,
},
ignore: ["semVer", "SemVer"],
},
],
},
},
{
files: ["**/*.spec.{ts,tsx}"],
plugins: {
vitest,
},
rules: {
...vitest.configs.recommended.rules,
},
settings: {
vitest: {
typecheck: true,
},
},
languageOptions: {
globals: {
...vitest.environments.env.globals,
},
parserOptions: {
project: "tsconfig.app.json",
},
},
},
prettier,
);