-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Expand file tree
/
Copy patheslint.config.mjs
More file actions
80 lines (79 loc) · 2.45 KB
/
eslint.config.mjs
File metadata and controls
80 lines (79 loc) · 2.45 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
import { defineConfig } from 'eslint/config'
import eslint from '@eslint/js'
import tseslint from 'typescript-eslint'
import eslintPluginPrettierRecommended from 'eslint-plugin-prettier/recommended'
import eslintConfigPrettier from 'eslint-config-prettier/flat'
import globals from 'globals'
import reactPlugin from 'eslint-plugin-react'
import reactHooks from 'eslint-plugin-react-hooks'
import jsxA11y from 'eslint-plugin-jsx-a11y'
export default defineConfig([
eslint.configs.recommended,
tseslint.configs.recommended,
tseslint.configs.stylistic,
reactPlugin.configs.flat.recommended,
reactPlugin.configs.flat['jsx-runtime'],
reactHooks.configs['recommended-latest'],
jsxA11y.flatConfigs.recommended,
{
files: [
'./packages/*/{src,tests}/**/*.{js,mjs,ts,tsx}',
],
languageOptions: {
globals: {
...globals.browser,
},
},
rules: {
semi: 'off',
'prefer-const': 'error',
'@typescript-eslint/no-explicit-any': 'warn',
'@typescript-eslint/consistent-type-definitions': 'warn',
'@typescript-eslint/array-type': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{
'args': 'all',
'argsIgnorePattern': '^_',
'caughtErrors': "all",
'caughtErrorsIgnorePattern': "^_",
'destructuredArrayIgnorePattern': "^_",
'varsIgnorePattern': "^_",
'ignoreRestSiblings': true
}
],
'react/prop-types': 'off',
'react/display-name': 'off',
'react-hooks/exhaustive-deps': 'error',
'jsx-a11y/click-events-have-key-events': 'warn',
'jsx-a11y/no-static-element-interactions': 'warn',
},
ignores: [
'/branding/',
'/stats/',
'/storybook-static/',
'node_modules/',
'packages/*/dist/',
],
settings: {
react: {
version: 'detect',
},
},
},
eslintPluginPrettierRecommended,
eslintConfigPrettier,
{
files: [
'./packages/*/tests/**/*.{js,mjs,ts,tsx}',
],
languageOptions: {
globals: {
it: 'readonly',
describe: 'readonly',
expect: 'readonly',
test: 'readonly',
},
},
},
])