forked from koii-network/koii-node
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy path.eslintrc.js
More file actions
122 lines (121 loc) · 3.41 KB
/
.eslintrc.js
File metadata and controls
122 lines (121 loc) · 3.41 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
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
111
112
113
114
115
116
117
118
119
120
121
122
module.exports = {
env: {
browser: true,
es6: true,
node: true,
},
parserOptions: {
ecmaVersion: 2020,
sourceType: 'module',
project: './tsconfig.json',
tsconfigRootDir: __dirname,
createDefaultProgram: true,
},
extends: [
'erb',
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:import/recommended',
'plugin:import/electron',
'plugin:import/typescript',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
'plugin:@cspell/recommended',
],
plugins: ['unused-imports'],
rules: {
'@cspell/spellchecker': [
'error',
{
autoFix: false,
checkIdentifiers: false,
checkComments: false,
ignoreImports: true,
ignoreImportProperties: true,
customWordListFile: './spellcheckignore.txt',
},
],
semi: ['error', 'always'],
quotes: ['error', 'single', { avoidEscape: true }],
'jsx-quotes': ['error', 'prefer-double'],
'import/extensions': ['error', 'never', { svg: 'always', json: 'always' }],
'import/newline-after-import': ['error', { count: 1 }],
'import/order': [
'error',
{
groups: [
'builtin',
'external',
'internal',
'parent',
'sibling',
'index',
'object',
'type',
],
'newlines-between': 'always',
alphabetize: {
order: 'asc',
caseInsensitive: true,
},
},
],
'unused-imports/no-unused-imports': 'error',
'@typescript-eslint/no-var-requires': 'off',
'import/prefer-default-export': 'off',
'no-console': 'off',
'react/jsx-filename-extension': 'off',
'promise/always-return': 'off',
'no-use-before-define': 'off',
'no-else-return': 'off',
'react/require-default-props': 'off',
'react/no-unused-prop-types': 'warn',
'no-shadow': 'off',
'jsx-a11y/click-events-have-key-events': 'warn',
'prefer-template': 'warn',
'jsx-a11y/label-has-associated-control': [
'error',
{
required: {
some: ['nesting', 'id'],
},
},
],
'no-nested-ternary': 'off',
'react/no-array-index-key': 'off',
'jsx-a11y/tabindex-no-positive': 'warn',
'react/function-component-definition': 'warn',
'react/button-has-type': 'off',
'jsx-a11y/anchor-is-valid': 'warn',
'jsx-a11y/no-static-element-interactions': 'warn',
'no-return-wrap': 'off',
'promise/catch-or-return': 'off',
'react/jsx-no-constructed-context-values': 'warn',
'import/no-extraneous-dependencies': 'off',
'react/jsx-props-no-spreading': 'off',
'no-unused-expressions': 'warn',
'jsx-a11y/no-noninteractive-tabindex': 'warn',
'no-new': 'off',
camelcase: 'warn',
'consistent-return': 'warn',
'no-restricted-syntax': 'off',
'no-await-in-loop': 'off',
'@typescript-eslint/no-empty-interface': 'warn',
},
parser: '@typescript-eslint/parser',
settings: {
'import/resolver': {
// See https://github.com/benmosher/eslint-plugin-import/issues/1396#issuecomment-575727774 for line below
node: {},
webpack: {
config: require.resolve('./.erb/configs/webpack.config.eslint.ts'),
},
typescript: {},
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
},
};