generated from d2phap/npm-package-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
72 lines (71 loc) · 2.16 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
const isProduction = process.env.NODE_ENV === 'production';
module.exports = {
root: true,
env: {
browser: true,
es2021: true,
},
extends: [
'airbnb-typescript',
],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 12,
sourceType: 'module',
tsconfigRootDir: __dirname,
project: './tsconfig.json',
},
plugins: [
'import',
],
settings: {
// To kill annoyed React warning:
// https://github.com/DRD4-7R/eslint-config-7r-building/issues/1#issuecomment-714491844
react: {
version: '999.999.999',
},
},
rules: {
'react/jsx-filename-extension': 'off',
'no-multiple-empty-lines': ["error", {
max: 2,
maxEOF: 1,
maxBOF: 1,
}],
'@typescript-eslint/ban-types': 'off',
'@typescript-eslint/ban-ts-comment': 'off',
'@typescript-eslint/brace-style': 'off',
'@typescript-eslint/lines-between-class-members': 'off',
'@typescript-eslint/no-explicit-any': 'off',
'@typescript-eslint/no-unused-vars': isProduction ? 'error' : 'warn',
'arrow-parens': 'off',
'brace-style': ['error', 'stroustrup', { allowSingleLine: true }],
camelcase: 'off',
'class-methods-use-this': 'off',
'import/extensions': 'off',
'import/no-cycle': 'off',
'import/no-unresolved': 'off',
'linebreak-style': 'off',
'lines-between-class-members': 'off',
'max-classes-per-file': 'off',
'no-await-in-loop': 'off',
'no-console': [
isProduction ? 'error' : 'warn',
{
allow: ['info', 'warn', 'error'],
},
],
'no-continue': 'off',
'no-debugger': isProduction ? 'error' : 'warn',
'no-empty': 'off',
'no-param-reassign': 'off',
'no-plusplus': 'off',
'no-restricted-globals': 'off',
// https://github.com/typescript-eslint/typescript-eslint/blob/main/docs/linting/TROUBLESHOOTING.md#i-get-errors-from-the-no-undef-rule-about-global-variables-not-being-defined-even-though-there-are-no-typescript-errors
'no-undef': 'off',
'prefer-object-spread': 'off',
"indent": "off",
"@typescript-eslint/indent": ["error", 4],
"import/no-extraneous-dependencies": ["error", {"devDependencies": true}]
},
};