-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path.eslintrc.js
58 lines (56 loc) · 1.56 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
const path = require('path');
const ts = (jestRules) => ({
files: jestRules ? '**/__tests__/**/*.ts' : '*.ts',
parser: '@typescript-eslint/parser',
parserOptions: {
tsconfigRootDir: __dirname,
project: ['./tsconfig.json'],
},
settings: {
'import/external-module-folders': ['./node_modules', './node_modules/@types'],
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.d.ts', '.tsx'],
moduleDirectory: [
'node_modules',
'node_modules/@types',
path.resolve(path.join(__dirname, 'node_modules')),
path.resolve(path.join(__dirname, 'node_modules', '@types')),
'src',
],
},
},
},
extends: [
'airbnb-typescript/base',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'prettier',
].concat(jestRules ? ['plugin:jest/all'] : []),
rules: {
'no-param-reassign': 'off',
'arrow-body-style': ['error', 'always'],
'jest/no-conditional-expect': 'off',
'jest/prefer-to-be': 'off',
'@typescript-eslint/no-unused-vars': [
'error',
{ varsIgnorePattern: '^Expected*', argsIgnorePattern: '^_' },
],
},
});
module.exports = {
root: true,
plugins: ['tsc', 'prettier', 'import', 'jest'],
overrides: [
{
files: '*.js',
extends: ['eslint-config-airbnb/base', 'prettier'],
},
ts(),
ts(true),
],
};