-
Notifications
You must be signed in to change notification settings - Fork 5
/
.eslintrc.json
56 lines (56 loc) · 1.78 KB
/
.eslintrc.json
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
{
"env": {
"browser": true,
"jest": true,
"es6": true,
"node": true
},
"extends": [
// "airbnb",
"eslint:recommended",
"plugin:react/recommended",
"plugin:prettier/recommended"
],
"globals": {
"Atomics": "readonly",
"SharedArrayBuffer": "readonly"
},
"parser": "@typescript-eslint/parser",
"parserOptions": {
"ecmaFeatures": {
"jsx": true
},
"ecmaVersion": 2018,
"sourceType": "module",
"project": "./tsconfig.json"
},
"plugins": ["@typescript-eslint", "react", "import", "unused-imports"],
"rules": {
"react/jsx-filename-extension": [1, { "extensions": [".ts", ".tsx"] }],
"import/extensions": 0,
// "unused-imports/no-unused-imports-ts": "error",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"warn",
{ "argsIgnorePattern": "^_" }
], // TypeScript用のno-unused-varsを有効にしている。
"no-console": ["warn", { "allow": ["log", "error"] }], // 本番はlogをallowから消して,no-consoleにする
"react/prop-types": "off", // TypeScriptではprop-types不要。というかoffらないとlintに引っかかる
"linebreak-style": [2, "unix"] // 改行コードはLFにそろえる
},
"settings": {
"react": {
"version": "detect" // デフォルトっぽい設定だけど入れないとwarningが出た。。。どこか間違ったのだろうか。。。
},
"import/parsers": {
"@typescript-eslint/parser": [".ts", ".tsx"]
},
"import/resolver": {
// use <root>/tsconfig.json
"typescript": {
"alwaysTryTypes": true, // always try to resolve types under `<roo/>@types` directory even it doesn't contain any source code, like `@types/unist`
"directory": "./tsconfig.json"
}
}
}
}