/
.eslintrc.cjs
110 lines (93 loc) · 2.92 KB
/
.eslintrc.cjs
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
102
103
104
105
106
107
108
109
110
module.exports = {
parserOptions: {
tsconfigRootDir: __dirname,
project: true,
},
// Comments link to blockers for flat config
plugins: [
// https://github.com/import-js/eslint-plugin-import/pull/2873
// https://github.com/import-js/eslint-plugin-import/issues/2948
// https://github.com/un-ts/eslint-plugin-import-x/issues/29
'import',
// https://github.com/levibuzolic/eslint-plugin-no-only-tests/issues/43
'no-only-tests',
'simple-import-sort',
'unused-imports',
],
extends: [
'eslint:recommended',
// https://github.com/jsx-eslint/eslint-plugin-react/issues/3699
'plugin:react/recommended',
'plugin:react/jsx-runtime',
// https://github.com/facebook/react/issues/28313
'plugin:react-hooks/recommended',
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/pull/891
// https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/issues/978
'plugin:jsx-a11y/recommended',
'plugin:playwright/recommended',
// https://github.com/typescript-eslint/typescript-eslint/milestone/9
'plugin:@typescript-eslint/recommended-type-checked',
'plugin:@typescript-eslint/stylistic-type-checked',
'plugin:unicorn/recommended',
'prettier',
],
rules: {
'object-shorthand': 'warn',
quotes: ['warn', 'single', { avoidEscape: true }],
'require-unicode-regexp': 'warn',
'import/first': 'warn',
'import/newline-after-import': 'warn',
'import/no-duplicates': 'warn',
'simple-import-sort/imports': 'warn',
'simple-import-sort/exports': 'warn',
'playwright/expect-expect': [
'warn',
{
assertFunctionNames: [
'expectAudioIsPlaying',
'expectAudioIsNotPlaying',
'expectAudioCurrentTimeToAlmostEqual',
],
},
],
'@typescript-eslint/no-unused-vars': 'off',
'unused-imports/no-unused-imports': 'warn',
'unused-imports/no-unused-vars': 'warn',
'@typescript-eslint/consistent-type-exports': 'warn',
'@typescript-eslint/consistent-type-imports': 'warn',
'@typescript-eslint/prefer-nullish-coalescing': 'off',
'unicorn/filename-case': 'off',
'unicorn/no-array-callback-reference': 'off',
'unicorn/no-null': 'off',
'unicorn/no-useless-undefined': 'off',
'unicorn/prefer-module': 'off',
'unicorn/prefer-switch': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/switch-case-braces': 'off',
'react/jsx-no-leaked-render': ['warn', { validStrategies: ['ternary'] }],
},
settings: {
react: {
version: 'detect',
},
formComponents: ['Form'],
linkComponents: [
{ name: 'Link', linkAttribute: 'to' },
{ name: 'NavLink', linkAttribute: 'to' },
],
},
overrides: [
{
files: ['.eslintrc.cjs', 'stylelint.config.js'],
env: {
node: true,
},
},
{
files: ['playwright/**/*.ts'],
rules: {
'no-empty-pattern': 'off',
},
},
],
};