-
Notifications
You must be signed in to change notification settings - Fork 0
/
eslint-config.js
56 lines (56 loc) 路 1.51 KB
/
eslint-config.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
module.exports = {
parser: '@typescript-eslint/parser',
extends: [
'standard',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'prettier',
'prettier/@typescript-eslint',
'plugin:prettier/recommended',
],
plugins: ['@typescript-eslint', 'prettier'],
rules: {
'@typescript-eslint/no-use-before-define': [
'error',
{
functions: false,
// Because sometimes we define functions using const func = ...
variables: false,
},
],
'@typescript-eslint/explicit-function-return-type': [
'warn',
{
allowExpressions: true,
allowHigherOrderFunctions: true,
},
],
'@typescript-eslint/ban-ts-ignore': 'warn',
'@typescript-eslint/await-thenable': 'warn',
'@typescript-eslint/no-floating-promises': 'error',
'@typescript-eslint/restrict-plus-operands': 'error',
'@typescript-eslint/prefer-nullish-coalescing': 'error',
'@typescript-eslint/prefer-optional-chain': 'error',
'@typescript-eslint/strict-boolean-expressions': [
'error',
{
allowString: false,
allowNullableBoolean: true,
},
],
'@typescript-eslint/no-unused-vars': [
'warn',
{
// For things like
// const { content, ...rest } = node
// return rest
ignoreRestSiblings: true,
},
],
},
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 2018,
sourceType: 'module',
},
}