-
Notifications
You must be signed in to change notification settings - Fork 1
/
base.js
88 lines (77 loc) · 1.94 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
const resolve = require('resolve');
const path = require('path');
const fs = require('fs');
const overrides = [];
// Lint tsx only if typescript is installed
try {
resolve.sync('typescript', {
basedir: path.resolve(fs.realpathSync(process.cwd()), 'node_modules'),
});
overrides.push({
files: ['*.{ts,tsx}'],
parser: '@typescript-eslint/parser',
parserOptions: {
ecmaVersion: 2018,
sourceType: 'module',
warnOnUnsupportedTypeScriptVersion: true,
},
extends: ['plugin:@typescript-eslint/recommended'],
plugins: ['@typescript-eslint'],
});
} catch (error) {
if (error.code !== 'MODULE_NOT_FOUND') {
throw error;
}
}
module.exports = {
root: true,
parser: 'babel-eslint',
extends: [
'airbnb-base',
'plugin:promise/recommended',
'plugin:jest/recommended',
'plugin:unicorn/recommended',
'prettier',
],
plugins: ['promise', 'jest', 'unicorn'],
parserOptions: {
sourceType: 'script',
},
env: {
jest: true,
},
overrides,
rules: {
strict: 0,
'no-var': 2,
'no-shadow': 0,
'no-param-reassign': 0,
'no-restricted-syntax': 0,
'global-require': 0,
'class-methods-use-this': 0,
'unicorn/import-index': 'off',
'unicorn/filename-case': 'off',
'unicorn/empty-brace-spaces': 0,
'unicorn/no-nested-ternary': 0,
'unicorn/prefer-math-trunc': 0,
'unicorn/no-null': 0,
'unicorn/number-literal-case': 0,
'unicorn/prefer-includes': 'off',
'unicorn/prefer-dom-node-remove': 'off',
'unicorn/prevent-abbreviations': 'off',
'unicorn/prefer-module': 0,
'unicorn/prefer-dom-node-append': 0,
'unicorn/no-array-reduce': 0,
'import/no-extraneous-dependencies': 0,
'no-plusplus': ['error', { allowForLoopAfterthoughts: true }],
'no-underscore-dangle': 0,
'promise/avoid-new': 0,
'prefer-destructuring': [
'error',
{
object: true,
array: false,
},
],
},
};