-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
57 lines (57 loc) · 1.84 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
module.exports = {
root: true,
env: {
browser: false,
es2021: true,
node: true,
},
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
// cannot make it work with subfolders tsconfig path mapping at the moment
// 'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript',
'prettier',
],
ignorePatterns: ['dist/**/*', 'node_modules/**/*', 'reports/**/*'],
parser: '@babel/eslint-parser',
parserOptions: {
sourceType: 'module',
},
plugins: ['@typescript-eslint', 'import', 'prettier'],
settings: {
// 'import/extensions': ['.ts', '.tsx', '.d.s', '.js', '.jsx', '.json'],
// 'import/parsers': {
// '@typescript-eslint/parser': ['.ts', '.tsx'],
// },
// 'import/resolvers': {
// typescript: {
// // always try to resolve types under `<roo/>@types` directory even it doesn't contain any source code, like `@types/unist`
// // alwaysTryTypes: true,
// project: 'tsconfig.json'
// }
// }
},
rules: {
'func-names': ['error', 'never'],
// cannot make it work with subfolders tsconfig path mapping at the moment
// 'import/no-unresolved': [2, { caseSensitive: true, commonjs: true }],
'prefer-destructuring': 0,
// disable the rule for all files by default
// @see https://github.com/typescript-eslint/typescript-eslint/issues/964
'@typescript-eslint/explicit-function-return-type': 'off',
},
overrides: [
{
// enable the rule specifically for TypeScript files
// @see https://github.com/typescript-eslint/typescript-eslint/issues/964
files: ['*.ts', '*.tsx'],
parser: '@typescript-eslint/parser',
rules: {
'@typescript-eslint/explicit-function-return-type': ['error'],
},
},
],
};