-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy patheslint.config.js
128 lines (126 loc) · 3.6 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
import { FlatCompat } from '@eslint/eslintrc'
import js from '@eslint/js'
import tanstackQueryPlugin from '@tanstack/eslint-plugin-query'
import promisePlugin from 'eslint-plugin-promise'
import reactPlugin from 'eslint-plugin-react'
import globals from 'globals'
import path from 'node:path'
import { fileURLToPath } from 'node:url'
import tseslint from 'typescript-eslint'
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
const compat = new FlatCompat({
baseDirectory: __dirname,
})
export default tseslint.config([
js.configs.recommended,
reactPlugin.configs.flat.recommended,
reactPlugin.configs.flat['jsx-runtime'],
promisePlugin.configs['flat/recommended'],
tseslint.configs.recommendedTypeChecked,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
...tanstackQueryPlugin.configs['flat/recommended'],
...compat.extends('plugin:react-hooks/recommended'),
...compat.config({ extends: ['next', 'next/core-web-vitals', 'next/typescript'] }),
{
plugins: {
react: reactPlugin,
},
languageOptions: {
globals: {
...globals.browser,
...globals.node,
React: false,
},
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
"no-alert": 0,
"no-console": 0,
"no-debugger": 1,
"no-empty-function": [
1,
{
"allow": [
"arrowFunctions"
]
}
],
"no-lone-blocks": 1,
"no-param-reassign": 0,
"no-underscore-dangle": 0,
"no-unexpected-multiline": 1,
"no-unreachable": 1,
"no-useless-escape": 0,
"no-var": 1,
"prefer-const": 1,
"react-hooks/rules-of-hooks": 2,
"react-hooks/exhaustive-deps": "warn",
"react/no-unescaped-entities": 0,
"strict": 0,
"react/jsx-props-no-spreading": 0,
"react/react-in-jsx-scope": 0,
"react/prop-types": 0,
"jsx-a11y/anchor-is-valid": 1,
"jsx-a11y/label-has-associated-control": 1,
"no-unused-vars": "off",
"promise/catch-or-return": [
1,
{
"allowFinally": true
}
],
}
},
{
files: ['**/*.ts', '**/*.tsx'],
ignores: ['**/*.js'],
plugins: {
'@typescript-eslint': tseslint.plugin,
},
languageOptions: {
parser: tseslint.parser,
ecmaVersion: 'latest',
parserOptions: {
project: './tsconfig.json',
},
},
rules: {
"@typescript-eslint/ban-ts-comment": 0,
"@typescript-eslint/no-unused-vars": [
1,
{
"args": "all",
"caughtErrors": "none",
"ignoreRestSiblings": true,
"vars": "all",
"argsIgnorePattern": "^_",
"destructuredArrayIgnorePattern": "^_"
}
],
"@typescript-eslint/no-unsafe-assignment": 0,
"@typescript-eslint/no-unsafe-member-access": 0,
"@typescript-eslint/restrict-template-expressions": 0,
"@typescript-eslint/no-unsafe-call": 0,
"@typescript-eslint/no-unsafe-return": 0,
"@typescript-eslint/no-explicit-any": 0,
"@typescript-eslint/no-unsafe-argument": 0,
"@typescript-eslint/no-var-requires": 0,
"@typescript-eslint/no-floating-promises": 0,
"@typescript-eslint/no-require-imports": 0,
"@typescript-eslint/no-base-to-string": 0,
"@typescript-eslint/no-misused-promises": 0
}
},
{
ignores: ['package-lock.json', 'eslint.config.js', 'postcss.config.js', 'tailwind.config.js', 'node_modules', '.next', 'playwright-report'],
},
])