-
Notifications
You must be signed in to change notification settings - Fork 4
/
eslint.config.mjs
47 lines (46 loc) · 1.51 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
import globals from 'globals';
import js from '@eslint/js';
import tsEslint from 'typescript-eslint';
import pluginReact from 'eslint-plugin-react';
import prettier from 'eslint-config-prettier';
import reactHooks from 'eslint-plugin-react-hooks';
import reactRefresh from 'eslint-plugin-react-refresh';
/** @type {import('eslint').Linter.Config[]} */
export default [
{ settings: { react: { version: 'detect' } } },
{ ignores: ['packages/**/dist'] },
{ files: ['**/*.{mjs,cjs,ts,tsx}'] },
{ files: ['**/*.js'], languageOptions: { sourceType: 'commonjs' } },
{ languageOptions: { globals: { ...globals.browser, ...globals.node }, ecmaVersion: 2020 } },
js.configs.recommended,
...tsEslint.configs.recommended,
pluginReact.configs.flat.recommended,
prettier,
{
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
},
{
rules: {
'@typescript-eslint/no-unused-vars': [
'error',
{
args: 'all',
argsIgnorePattern: '^_',
caughtErrors: 'all',
caughtErrorsIgnorePattern: '^_',
destructuredArrayIgnorePattern: '^_',
varsIgnorePattern: '^_',
ignoreRestSiblings: true,
},
],
...reactHooks.configs.recommended.rules,
'no-console': ['error', { allow: ['warn', 'error'] }],
'@typescript-eslint/no-explicit-any': 'off',
'react-hooks/exhaustive-deps': 'off',
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
},
},
];