-
Notifications
You must be signed in to change notification settings - Fork 2
/
.eslintrc.js
97 lines (95 loc) · 1.84 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
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
/** @type {import('eslint').Linter.BaseConfig} */
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
sourceType: 'module',
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:ava/recommended',
],
plugins: [
'@typescript-eslint',
'ava',
],
env: {
node: true,
es2021: true,
},
rules: {
// allow @ts-ignore comment
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/no-explicit-any': 'off',
// ignore rule because of @typescript-eslint/no-unused-vars
'no-unused-vars': 'off',
// disallow __proto__
'no-proto': 'error',
// disallow return await
'no-return-await': 'error',
// disallow eval
'no-eval': 'error',
// max line length
'max-len': [
'error',
{
code: 120,
},
],
// require empty line in the end of file
'eol-last': 'error',
// allow single quotes and backticks with ${}
'quotes': [
'error',
'single',
{
avoidEscape: true,
},
],
// disallow ;
'semi': [
'error',
'never',
],
// require trailing comma only when entity has multiline format
'comma-dangle': [
'error',
'always-multiline',
],
// disallow func( 'arg' ), only func('arg')
'space-in-parens': [
'error',
'never',
],
// disallow if, for, ... without brackets
'curly': 'error',
// disallow empty block like if (...) {}. Allow only empty catch {}
'no-empty': [
'error',
{
allowEmptyCatch: true,
},
],
// allow tabs
'indent': [
'error',
'tab',
{SwitchCase: 1},
],
// disallow spaces between import {a} from ''
// const {a} = obj and others
'object-curly-spacing': [
'error',
'never',
],
// disallow var keyword
'no-var': 'error',
// allow only strict equality "==="
'eqeqeq': [
'error',
'always',
],
// allow only camelCase names
camelcase: 'error',
},
}