-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy patheslint.config.js
104 lines (103 loc) · 2.54 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
import globals from 'globals'
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import prettierConfig from 'eslint-config-prettier'
import reactPlugin from 'eslint-plugin-react'
import reactHooksPlugin from 'eslint-plugin-react-hooks'
import nextPlugin from '@next/eslint-plugin-next'
import { configs as ReactQueryConfigs, rules as ReactQueryRules } from '@tanstack/eslint-plugin-query'
export default tseslint.config(
eslint.configs.recommended,
...tseslint.configs.recommended,
prettierConfig,
{
plugins: {
react: reactPlugin,
},
rules: {
...reactPlugin.configs.recommended.rules,
},
settings: {
react: {
version: 'detect', // Fixes "Warning: React version not specified in eslint-plugin-react settings."
},
},
},
{
plugins: {
'react-hooks': reactHooksPlugin,
},
rules: {
...reactHooksPlugin.configs.recommended.rules,
'react/prop-types': 'off',
'react/no-unknown-property': [
'error',
{
ignore: ['jsx', 'global'],
},
],
'react-hooks/exhaustive-deps': 'off',
},
},
{
plugins: {
'@tanstack/eslint-plugin-query': { rules: ReactQueryRules, configs: ReactQueryConfigs },
},
rules: {
'@tanstack/eslint-plugin-query/exhaustive-deps': 'error',
'@tanstack/eslint-plugin-query/no-rest-destructuring': 'warn',
'@tanstack/eslint-plugin-query/stable-query-client': 'error',
},
},
{
plugins: {
'@next/next': nextPlugin,
},
rules: {
...nextPlugin.configs.recommended.rules,
...nextPlugin.configs['core-web-vitals'].rules,
'@next/next/no-img-element': 'off',
},
settings: {
next: {
rootDir: 'packages/ui',
},
},
},
{
rules: {
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'no-console': [
'warn',
{
allow: ['debug', 'info', 'warn', 'error'],
},
],
},
},
{
ignores: ['packages/ui/out', 'packages/ui/.next', 'packages/cdk/cdk.out'],
},
{
ignores: ['packages/ui/**', '!packages/ui/jest.config.js', '!packages/ui/next.config.js'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.node,
},
},
},
{
files: ['packages/ui/**'],
languageOptions: {
ecmaVersion: 2022,
sourceType: 'module',
globals: {
...globals.browser,
},
},
},
)