-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint.config.mjs
101 lines (100 loc) · 3.19 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
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
import globals from 'globals';
import pluginJs from '@eslint/js';
import pluginReactConfig from 'eslint-plugin-react';
import typescriptPlugin from '@typescript-eslint/eslint-plugin';
import typescriptParser from '@typescript-eslint/parser';
import jsxA11yPlugin from 'eslint-plugin-jsx-a11y';
export default [
pluginJs.configs.recommended,
{
files: ['**/*.ts', '**/*.tsx'],
ignores: ['**/vite.config.ts', '**/.storybook/*.ts'],
languageOptions: {
globals: {
...globals.browser,
...globals.jest,
...globals.node,
},
parser: typescriptParser,
parserOptions: {
project: './tsconfig.json',
},
ecmaVersion: 8,
},
plugins: {
'@typescript-eslint': typescriptPlugin,
react: pluginReactConfig,
'jsx-a11y': jsxA11yPlugin,
},
settings: { react: { version: 'detect' } },
rules: {
...typescriptPlugin.configs.recommended.rules,
...pluginReactConfig.configs.recommended.rules,
...typescriptPlugin.configs.recommended.rules,
...pluginReactConfig.configs.recommended.rules,
...jsxA11yPlugin.configs.recommended.rules,
'react/display-name': 'off',
'react/react-in-jsx-scope': 'off',
'react/no-unescaped-entities': 'off',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/explicit-module-boundary-types': [
'error',
{ allowTypedFunctionExpressions: true },
],
'@typescript-eslint/typedef': [
'error',
{
parameter: true,
arrowParameter: true,
propertyDeclaration: true,
memberVariableDeclaration: true,
},
],
'jsx-a11y/aria-role': 'warn',
'jsx-a11y/aria-props': 'warn',
'jsx-a11y/label-has-associated-control': 'warn',
'jsx-a11y/alt-text': 'warn',
'jsx-a11y/interactive-supports-focus': 'warn',
'jsx-a11y/anchor-is-valid': 'warn',
'jsx-a11y/media-has-caption': 'warn',
'jsx-a11y/no-autofocus': 'warn',
'jsx-a11y/no-noninteractive-element-to-interactive-role': 'warn',
'jsx-a11y/no-static-element-interactions': 'warn',
'jsx-a11y/no-noninteractive-tabindex': 'warn',
'jsx-a11y/heading-has-content': 'warn',
'jsx-a11y/label-has-for': 'warn',
'jsx-a11y/no-redundant-roles': 'warn',
'jsx-a11y/role-has-required-aria-props': 'warn',
'jsx-a11y/role-supports-aria-props': 'warn',
'jsx-a11y/click-events-have-key-events': 'warn',
'jsx-a11y/no-distracting-elements': 'warn',
},
},
{
files: ['**/*.styles.ts', '**/*.styles.tsx'],
rules: {
'react/react-in-jsx-scope': 'off',
'react/no-unescaped-entities': 'off',
'@typescript-eslint/no-explicit-any': 'error',
'@typescript-eslint/explicit-module-boundary-types': [
'error',
{ allowTypedFunctionExpressions: true },
],
'@typescript-eslint/typedef': [
'error',
{
parameter: true,
arrowParameter: true,
propertyDeclaration: true,
memberVariableDeclaration: true,
},
],
},
},
{
files: ['**/*.styles.ts', '**/*.styles.tsx'],
rules: {
'@typescript-eslint/typedef': 'off',
},
},
];