-
Notifications
You must be signed in to change notification settings - Fork 0
/
.eslintrc.js
95 lines (90 loc) · 2.32 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
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
89
90
91
92
93
94
95
module.exports = {
extends: [
"airbnb",
"plugin:@typescript-eslint/recommended",
"plugin:jest/recommended",
"plugin:prettier/recommended",
],
plugins: [
"@typescript-eslint",
"jest",
// CircleCI で warn も検知可能にするため、全て error にする
"only-error",
],
parser: "@typescript-eslint/parser",
parserOptions: {
sourceType: "module",
project: "./tsconfig.json",
},
env: {
browser: true,
es6: true,
"jest/globals": true,
},
rules: {
"arrow-body-style": "off",
"import/first": "off",
"import/no-default-export": "error",
"import/prefer-default-export": "off",
"no-alert": "off",
"no-restricted-globals": [
"error",
{
name: "document",
message: "Use getDocument().",
},
],
"no-restricted-properties": [
"error",
{
property: "innerText",
message:
"Use 'textContent' instead. Because 'innerText' is (almost) not recommended.",
},
],
"no-underscore-dangle": [
"error",
{
allowAfterSuper: true,
allowAfterThis: true,
},
],
"prefer-arrow-callback": [
"error",
{
allowNamedFunctions: false,
allowUnboundThis: false,
},
],
"prettier/prettier": [
"error",
{
arrowParens: "always",
semi: false,
trailingComma: "all",
},
],
/**
* ts と eslint の相性不良周りを解消するための設定
*/
"import/no-unresolved": "off",
// plugin:@typescript-eslint/recommended と prettier の相性不良?
"@typescript-eslint/indent": "off",
"@typescript-eslint/member-delimiter-style": "off",
// constructor のショートハンド(メンバーの省略記法)を使いたいため
"@typescript-eslint/no-parameter-properties": "off",
"@typescript-eslint/explicit-member-accessibility": "off",
"no-useless-constructor": "off",
"no-empty-function": "off",
"@typescript-eslint/explicit-function-return-type": [
"error",
{ allowExpressions: true },
],
/**
* ts で許容されてるルールは、ts側を優先して許可する
*/
// ホイスティング
"no-use-before-define": "off",
"@typescript-eslint/no-use-before-define": "off",
},
}