/
.eslintrc.js
56 lines (44 loc) · 1.33 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
module.exports = {
parser: '@typescript-eslint/parser',
parserOptions: {
project: './tsconfig.json',
},
plugins: ['@typescript-eslint', 'prettier'],
extends: [
'eslint:recommended',
// JavaScript Standard Coding Style
'standard',
// eslint-plugin-import
'plugin:import/errors',
'plugin:import/warnings',
'plugin:import/typescript', // for @typescript-eslint/parser
// @typescript-eslint
'plugin:@typescript-eslint/eslint-recommended',
'plugin:@typescript-eslint/recommended',
'plugin:@typescript-eslint/recommended-requiring-type-checking',
// eslint-plugin-jest
'plugin:jest/recommended',
// Prettier: 一番最後に設定すること(ESLintがPrettierと競合しないように、ESLintの設定を最後に上書きするため)
'plugin:prettier/recommended',
'prettier',
],
rules: {
// ESLint
'no-console': 'off',
},
settings: {
// eslint-plugin-import
'import/resolver': {
node: {
extensions: ['.js', '.jsx', '.ts', '.tsx'],
},
// eslint-import-resolver-typescript
typescript: {
alwaysTryTypes: true, // import で `<root>@types` ディレクトリ直下の型解決を可能にする
},
},
'import/parsers': {
'@typescript-eslint/parser': ['.ts', '.tsx'],
},
},
};