-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
52 lines (51 loc) · 1.68 KB
/
eslint.config.mjs
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
import reactPlugin from 'eslint-plugin-react';
import importPlugin from 'eslint-plugin-import';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import hooksPlugin from 'eslint-plugin-react-hooks';
import prettierPlugin from 'eslint-plugin-prettier';
import pluginQuery from '@tanstack/eslint-plugin-query';
import typescriptParser from '@typescript-eslint/parser';
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
export default [
{
files: ['**/*.{js,jsx,ts,tsx}'],
languageOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
parser: typescriptParser,
parserOptions: {
project: './tsconfig.json',
},
},
settings: {
react: {
version: 'detect',
},
},
plugins: {
react: reactPlugin,
import: importPlugin,
prettier: prettierPlugin,
'jsx-a11y': jsxA11yPlugin,
'react-hooks': hooksPlugin,
'@tanstack/query': pluginQuery,
'@typescript-eslint': typescriptPlugin,
},
rules: {
...pluginQuery.configs.recommended.rules,
...hooksPlugin.configs.recommended.rules,
...jsxA11yPlugin.configs.recommended.rules,
'no-console': 'warn',
'react/prop-types': 'off',
'prettier/prettier': 'error',
'react/react-in-jsx-scope': 'off',
'react/require-default-props': 'off',
'@tanstack/query/exhaustive-deps': 'error',
'@typescript-eslint/no-explicit-any': 'off',
'no-unused-vars': ['error', { args: 'none' }],
'@tanstack/query/stable-query-client': 'error',
'@tanstack/query/no-rest-destructuring': 'warn',
'react/function-component-definition': [2, { namedComponents: 'arrow-function' }],
},
},
];