-
Notifications
You must be signed in to change notification settings - Fork 9
Expand file tree
/
Copy patheslint.config.mjs
More file actions
66 lines (65 loc) · 1.94 KB
/
eslint.config.mjs
File metadata and controls
66 lines (65 loc) · 1.94 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
import js from '@eslint/js';
import { fixupPluginRules } from '@eslint/compat';
import globals from 'globals';
import tsParser from '@typescript-eslint/parser';
import tsPlugin from '@typescript-eslint/eslint-plugin';
import reactPlugin from 'eslint-plugin-react';
import reactHooksPlugin from 'eslint-plugin-react-hooks';
import importPlugin from 'eslint-plugin-import';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
import prettierConfig from 'eslint-config-prettier';
export default [
{
ignores: [
'dist/**',
'**/dist/**',
'node_modules/**',
'.eslintcache',
'eslint.config.mjs',
],
},
{
files: ['src/**/*.{ts,tsx}'],
languageOptions: {
parser: tsParser,
ecmaVersion: 'latest',
sourceType: 'module',
parserOptions: {
ecmaFeatures: {
jsx: true,
},
},
globals: {
...globals.browser,
...globals.node,
},
},
plugins: {
'@typescript-eslint': fixupPluginRules(tsPlugin),
react: fixupPluginRules(reactPlugin),
'react-hooks': fixupPluginRules(reactHooksPlugin),
import: fixupPluginRules(importPlugin),
'jsx-a11y': fixupPluginRules(jsxA11yPlugin),
},
settings: {
react: {
version: 'detect',
},
},
rules: {
...js.configs.recommended.rules,
...tsPlugin.configs.recommended.rules,
...reactPlugin.configs.recommended.rules,
...reactHooksPlugin.configs.recommended.rules,
...importPlugin.configs.recommended.rules,
...jsxA11yPlugin.configs.recommended.rules,
...prettierConfig.rules,
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-empty-object-type': 'off',
'@typescript-eslint/no-non-null-asserted-optional-chain': 'off',
'react/require-default-props': 'off',
'react/jsx-props-no-spreading': 'off',
'react/jsx-filename-extension': [1, { extensions: ['.tsx', '.jsx'] }],
},
},
];