-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.cjs
87 lines (87 loc) · 2.58 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
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'prettier',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
overrides: [
{
extends: ['plugin:typescript-sort-keys/recommended'],
files: ['./**/*.ts?(x)'],
parser: '@typescript-eslint/parser',
rules: {
'react/no-unstable-nested-components': 'warn',
'react/no-unstable-nested-components': 'warn',
'@typescript-eslint/ban-ts-comment': ['warn', { 'ts-ignore': 'allow-with-description' }],
'@typescript-eslint/ban-ts-ignore': 'off',
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'@typescript-eslint/no-use-before-define': 'off',
'no-unused-vars': 'off',
'typescript-sort-keys/interface': 'warn',
'typescript-sort-keys/string-enum': 'warn',
},
},
],
plugins: [
'prettier',
'no-only-tests',
'react-refresh',
'sort-destructure-keys',
'typescript-sort-keys',
'eslint-plugin-sort-keys-fix',
'eslint-plugin-no-inline-styles',
'jsx-a11y',
'import',
],
rules: {
'react/react-in-jsx-scope': 'off',
'react-refresh/only-export-components': ['warn', { allowConstantExport: true }],
'@typescript-eslint/no-unused-vars': ['warn', { argsIgnorePattern: '^_' }],
'import/order': [
'warn',
{
alphabetize: {
caseInsensitive: true,
order: 'asc',
},
groups: ['builtin', 'external', 'internal', 'parent', 'sibling', 'index'],
'newlines-between': 'always',
},
],
'jsx-a11y/click-events-have-key-events': 'warn',
'jsx-a11y/no-noninteractive-element-interactions': 'warn',
'no-unused-vars': 'off',
'prefer-const': 'warn',
'prefer-template': 'warn',
'prettier/prettier': 'warn',
'react/boolean-prop-naming': ['warn', { rule: '^(is|has)[A-Z]([A-Za-z0-9]?)+' }],
'react/jsx-handler-names': 'warn',
'react/jsx-sort-props': [
'warn',
{
callbacksLast: true,
reservedFirst: ['ref'],
shorthandFirst: true,
},
],
'sort-destructure-keys/sort-destructure-keys': 'warn',
'sort-keys-fix/sort-keys-fix': 'warn',
},
settings: {
'import/external-module-folders': ['node_modules'],
// "import/resolver": {
// node: {
// paths: ["./src", "./lib"],
// },
// },
react: {
version: 'detect',
},
},
};