-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
106 lines (102 loc) · 2.76 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
98
99
100
101
102
103
104
105
106
const fs = require('fs');
/**
* Detect tsconfig file
*/
function getProjectFile() {
if (fs.existsSync('./tsconfig.build.json')) return './tsconfig.build.json';
if (fs.existsSync('./tsconfig.json')) return './tsconfig.json';
return undefined;
}
module.exports = {
root: true,
parser: '@typescript-eslint/parser',
plugins: ['json', 'jest', '@typescript-eslint', 'eslint-plugin', 'import'],
env: {
es6: true,
node: true,
'jest/globals': true,
},
globals: {
BigInt: true,
},
parserOptions: {
sourceType: 'module',
createDefaultProgram: true,
project: getProjectFile(),
},
extends: [
'airbnb/base',
'plugin:@typescript-eslint/recommended',
'eslint:recommended',
'prettier',
],
rules: {
'prefer-const': 'error',
'mocha/handle-done-callback': 'off',
'max-len': [
'error',
{
code: 125,
},
],
indent: 'off',
'import/named': 'off',
'import/extensions': 'off',
'no-empty-function': 'off',
'no-plusplus': 'off',
'prefer-promise-reject-errors': 'off',
'implicit-arrow-linebreak': 'off',
'function-paren-newline': 'off',
'arrow-parens': 'off',
'import/prefer-default-export': 'off',
'import/no-cycle': 'off',
'import/no-unresolved': 0,
'import/no-import-module-exports': 0,
'import/no-extraneous-dependencies': 0,
'no-unused-expressions': 0,
'no-nested-ternary': 0,
'object-curly-newline': 0,
'comma-dangle': 0,
'dot-notation': 0,
'no-useless-constructor': 'off',
'no-useless-escape': 'off',
semi: ['error', 'always'],
'operator-linebreak': 'off',
'space-before-function-paren': 'off',
'no-await-in-loop': 'warn',
'no-var-requires': 'off',
'max-classes-per-file': 'off',
'no-shadow': 'off',
'no-cond-assign': 'warn',
'class-methods-use-this': 'off',
'no-bitwise': 'warn',
camelcase: 'off',
'no-promise-executor-return': 'warn',
'no-underscore-dangle': 'off',
/* TypeScript rules */
'@typescript-eslint/no-shadow': ['error'],
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/prefer-for-of': 'off',
'@typescript-eslint/interface-name-prefix': 'off',
'@typescript-eslint/explicit-function-return-type': 'off',
'@typescript-eslint/explicit-module-boundary-types': 'off',
'@typescript-eslint/no-var-requires': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{
vars: 'all',
args: 'none', // none - do not check arguments
ignoreRestSiblings: false,
},
], // tslint:no-unused-variable
},
overrides: [
{
files: ['**/*.js'],
rules: {
'@typescript-eslint/no-unused-vars': 'off',
'@typescript-eslint/no-misused-promises': 'off',
},
},
],
};