-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
68 lines (68 loc) · 2.12 KB
/
.eslintrc.js
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
module.exports = {
env: {
browser: true,
es6: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:react/recommended',
'plugin:react-hooks/recommended',
'plugin:security/recommended',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
],
ignorePatterns: ['.dependabot/', '.git/', '.vscode/', 'node_modules/', 'public/', '*.js'],
parser: '@typescript-eslint/parser',
parserOptions: {
project: ['tsconfig.json', 'extension/tsconfig.json'],
sourceType: 'module',
},
plugins: [
'@typescript-eslint',
'@typescript-eslint/tslint',
'import',
'react',
'security',
'react-hooks',
],
rules: {
'@typescript-eslint/naming-convention': [
'error',
// Enforce that boolean variables are prefixed with an allowed verb
{
selector: 'variable',
types: ['boolean'],
format: ['PascalCase'],
prefix: ['is', 'should', 'has', 'can', 'did', 'will', 'does', 'was', 'were'],
},
],
'@typescript-eslint/no-unused-vars': 'error',
'@typescript-eslint/prefer-regexp-exec': 0,
'@typescript-eslint/no-unsafe-assignment': 0,
'@typescript-eslint/no-unsafe-member-access': 0,
'@typescript-eslint/no-unsafe-call': 0,
'@typescript-eslint/restrict-template-expressions': 0,
'@typescript-eslint/no-unsafe-return': 0,
'@typescript-eslint/no-unsafe-argument': 0,
'arrow-body-style': ['error', 'as-needed'],
'import/first': 'error',
'import/no-duplicates': 'error',
'import/no-named-as-default': 'error',
'no-prototype-builtins': 'error',
'import/order': ['error', { alphabetize: { order: 'asc' } }],
'no-case-declarations': 0,
'no-useless-escape': 'error',
'object-shorthand': 'error',
'sort-imports': ['error', { ignoreDeclarationSort: true }],
},
settings: {
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx', '.d.ts'],
},
react: { version: 'detect' },
},
};