generated from V-ed/node-api-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
90 lines (90 loc) · 3.04 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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
// project: 'tsconfig.json',
sourceType: 'module',
},
plugins: ['@typescript-eslint/eslint-plugin'],
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
// 'plugin:prettier/recommended',
],
root: true,
env: {
node: true,
jest: true,
},
ignorePatterns: ['.eslintrc.js', 'gulpfile.ts', 'dist'],
rules: {
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
// '@typescript-eslint/no-explicit-any': 'off',
'no-trailing-spaces': ['error', { 'skipBlankLines': true }],
'array-bracket-newline': ['error', { 'multiline': true }],
'indent': 'off',
// 'indent': ['error', 'tab', { 'VariableDeclarator': { 'var': 2, 'let': 2, 'const': 3 }, 'SwitchCase': 1}],
'no-tabs': ['error', { 'allowIndentationTabs': true }],
'implicit-arrow-linebreak': ['error', 'beside'],
'no-whitespace-before-property': 'error',
'no-multi-spaces': 'error',
'no-multiple-empty-lines': ['error', { 'max': 1, 'maxEOF': 0 }],
'camelcase': 'error',
'brace-style': ['error', '1tbs', { 'allowSingleLine': true }],
'no-confusing-arrow': 'error',
'padded-blocks': ['error', 'never', { 'allowSingleLineBlocks': true }],
'eol-last': ['error', 'always'],
'no-lonely-if': 'error',
'no-underscore-dangle': 'error',
'quotes': ['error', 'single', { 'allowTemplateLiterals': true }],
'semi-style': ['error', 'last'],
'padding-line-between-statements': [
'error',
{ 'blankLine': 'always', 'prev': ['const', 'let', 'var'], 'next': '*' },
{ 'blankLine': 'any', 'prev': ['const', 'let', 'var'], 'next': ['const', 'let', 'var'] },
{ 'blankLine': 'always', 'prev': 'directive', 'next': '*' },
{ 'blankLine': 'any', 'prev': 'directive', 'next': 'directive' },
],
'no-unused-vars': 'off',
'keyword-spacing': ['error', { 'before': true }],
'space-before-blocks': 'error',
'arrow-spacing': 'error',
'space-infix-ops': ['error', { 'int32Hint': false }],
'semi': 'off',
'@typescript-eslint/semi': ['error', 'always'],
'no-empty-function': 'off',
'@typescript-eslint/no-empty-function': ['error', { 'allow': ['private-constructors'] }],
'@typescript-eslint/no-unused-vars': ['error', { 'argsIgnorePattern': '^_' }],
'@typescript-eslint/no-magic-numbers': ['warn', { 'ignoreArrayIndexes': true, 'ignoreReadonlyClassProperties': true, 'ignore': [-1, 0, 1] }],
'@typescript-eslint/no-non-null-assertion': 'off',
},
overrides: [
{
files: 'tests/**/*.ts',
rules: {
'@typescript-eslint/no-magic-numbers': 'off',
},
},
{
files: 'prisma/**/*.ts',
rules: {
'@typescript-eslint/no-magic-numbers': 'off',
},
},
{
files: ["*.ts"],
rules: {
"@typescript-eslint/explicit-function-return-type": "error",
}
},
{
files: ["*.js"],
rules: {
"@typescript-eslint/no-var-requires": "off",
"@typescript-eslint/no-magic-numbers": "off",
}
},
],
};