-
Notifications
You must be signed in to change notification settings - Fork 0
/
base.js
74 lines (72 loc) · 2.17 KB
/
base.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
// @ts-check
/**
* @type {import("eslint").Linter.Config}
*/
module.exports = {
extends: [
// https://github.com/eslint/eslint/blob/main/packages/js/src/configs/eslint-recommended.js
'eslint:recommended',
],
plugins: ['@stylistic'],
env: {
node: true,
es6: true,
es2021: true,
},
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
rules: {
'array-callback-return': 'warn',
curly: ['warn', 'all'],
eqeqeq: ['warn', 'always'],
'line-comment-position': ['warn', 'above'],
'no-console': ['warn', { allow: ['error'] }],
'no-constant-binary-expression': 'warn',
'no-constant-condition': ['warn', { checkLoops: false }],
'no-debugger': 'warn',
'no-else-return': 'warn',
'no-inline-comments': 'warn',
'no-multi-assign': 'warn',
'no-multi-str': 'warn',
'no-nested-ternary': 'warn',
'no-return-assign': 'warn',
'no-undef': 'warn',
'no-unneeded-ternary': ['warn', { defaultAssignment: false }],
'no-unreachable': 'warn',
'no-unused-vars': ['warn', { vars: 'all', args: 'after-used' }],
'no-useless-constructor': 'warn',
'no-var': 'warn',
'no-warning-comments': [
'warn',
{ terms: ['fixme', 'todo', 'hack', 'review', 'xxx'] },
],
'no-throw-literal': 'warn',
'require-await': 'warn',
'require-yield': 'warn',
'prefer-const': 'warn',
'prefer-template': 'warn',
'no-implicit-coercion': 'warn',
/**
* ESLint Stylistic
*/
'@stylistic/lines-between-class-members': [
'warn',
'always',
{ exceptAfterSingleLine: true },
],
'@stylistic/padding-line-between-statements': [
'warn',
{ blankLine: 'always', prev: '*', next: 'return' },
{ blankLine: 'always', prev: ['const', 'let'], next: '*' },
{ blankLine: 'any', prev: ['const', 'let'], next: ['const', 'let'] },
{ blankLine: 'always', prev: '*', next: 'try' },
{ blankLine: 'always', prev: '*', next: 'if' },
{ blankLine: 'any', prev: 'if', next: 'if' },
],
'@stylistic/spaced-comment': ['warn', 'always', { exceptions: ['-'] }],
},
reportUnusedDisableDirectives: true,
};