-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy path.eslintrc.cjs
67 lines (67 loc) · 1.85 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
/* eslint-env node */
module.exports = {
root: true,
env: {
browser: true,
es2022: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaFeatures: { jsx: true },
tsconfigRootDir: __dirname,
project: ['./tsconfig.json', './tsconfig.node.json'],
},
plugins: ['@typescript-eslint', 'promise'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:@typescript-eslint/strict',
'plugin:react/recommended',
'plugin:react/jsx-runtime',
'plugin:jsx-a11y/recommended',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
],
settings: {
react: {
version: 'detect',
},
},
rules: {
'prefer-template': 'error',
'react/destructuring-assignment': 'error',
'react/no-danger': 'error',
'react/self-closing-comp': 'error',
'react/function-component-definition': ['error', { namedComponents: 'function-declaration' }],
'@typescript-eslint/no-misused-promises': [
'error',
{
checksVoidReturn: false,
},
],
'@typescript-eslint/consistent-indexed-object-style': ['warn', 'index-signature'],
'@typescript-eslint/no-dynamic-delete': 'off',
'@typescript-eslint/no-unnecessary-condition': 'off',
'@typescript-eslint/sort-type-constituents': 'error',
'@typescript-eslint/consistent-type-exports': 'error',
'@typescript-eslint/consistent-type-imports': 'error',
'@typescript-eslint/consistent-type-definitions': ['error', 'type'],
'@typescript-eslint/member-ordering': [
'error',
{
default: {
order: 'alphabetically',
},
},
],
},
overrides: [
{
files: ['*.config.js'],
rules: {
'@typescript-eslint/no-var-requires': 'off',
},
},
],
};