-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
112 lines (107 loc) · 2.92 KB
/
eslint.config.js
File metadata and controls
112 lines (107 loc) · 2.92 KB
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
const js = require('@eslint/js');
const { defineConfig } = require('eslint/config');
const prettierConfig = require('eslint-config-prettier');
const pluginPrettier = require('eslint-plugin-prettier');
const react = require('eslint-plugin-react');
const pluginReactHooks = require('eslint-plugin-react-hooks');
const globals = require('globals');
const tseslint = require('typescript-eslint');
const pluginNext = require('@next/eslint-plugin-next');
const pluginQuery = require('@tanstack/eslint-plugin-query');
/** @type {import('eslint').Linter.Config[]} */
module.exports = defineConfig(
js.configs.recommended,
...tseslint.configs.recommended,
{
plugins: {
react
},
rules: {
...react.configs.recommended.rules,
...react.configs['jsx-runtime'].rules,
'react/react-in-jsx-scope': 'off',
'react/prop-types': 'off',
'react/no-unescaped-entities': 'off',
'react/no-unknown-property': [2, { ignore: ['jsx'] }]
},
settings: {
react: { version: 'detect' }
}
},
{
plugins: {
'@typescript-eslint': tseslint.plugin
},
languageOptions: {
parser: tseslint.parser,
globals: {
...globals.browser,
...globals.commonjs,
...globals.node
},
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
ecmaFeatures: {
jsx: true,
arrowFunctions: true
}
}
},
rules: {
'@typescript-eslint/no-unused-vars': [
'warn',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true
}
],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-require-imports': 'off',
'@typescript-eslint/no-empty-function': 'off',
'@typescript-eslint/no-console': 'off'
},
settings: {
react: {
version: 'detect'
},
tailwindcss: {
callees: ['classNames', 'className', 'classname', 'cn', 'clsx', 'ctl', 'cva', 'tv']
}
}
},
{
plugins: {
'@next/next': pluginNext
},
rules: {
...pluginNext.configs.recommended.rules,
...pluginNext.configs['core-web-vitals'].rules,
'@next/next/no-img-element': 'off',
'@next/next/no-html-link-for-pages': 'off'
}
},
{
files: ['**/*.{js,jsx,ts,tsx,mjs,mts,mdx,md}'],
plugins: {
'react-hooks': pluginReactHooks,
prettier: pluginPrettier,
'@tanstack/query': pluginQuery
},
rules: {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'off',
'prettier/prettier': 'warn',
...pluginQuery.configs.recommended.rules
}
},
{
ignores: ['node_modules/*', '.next/', '.turbo/', '.out/', '**/build', '**/coverage']
},
prettierConfig
);