This repository has been archived by the owner on Oct 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.eslintrc.js
86 lines (86 loc) · 2.77 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
module.exports = {
root: true,
parser: "@typescript-eslint/parser",
env: {
node: true,
jest: true,
},
extends: [
"eslint:recommended",
"plugin:@typescript-eslint/eslint-recommended",
"plugin:@typescript-eslint/recommended",
"plugin:@typescript-eslint/recommended-requiring-type-checking",
"plugin:prettier/recommended",
"prettier",
"prettier/@typescript-eslint",
],
parserOptions: {
project: "packages/*/tsconfig.json",
sourceType: "module",
},
plugins: ["@typescript-eslint"],
rules: {
"@typescript-eslint/array-type": [
"error",
{
default: "generic",
},
],
"@typescript-eslint/await-thenable": "error",
// "@typescript-eslint/return-await": ["error", "always"], // なんかasync関数じゃないのにfixしたらawaitつけてくる…
"@typescript-eslint/no-empty-function": "off",
"@typescript-eslint/no-empty-interface": "off",
"@typescript-eslint/no-floating-promises": "error",
"@typescript-eslint/prefer-for-of": "error",
"@typescript-eslint/prefer-function-type": "error",
complexity: "warn", // 便利そう
eqeqeq: ["error"],
"guard-for-in": "error",
"new-parens": "error",
"no-bitwise": "error",
"no-caller": "error",
"no-console": "warn", // そのうち
"no-fallthrough": "error",
"no-new-wrappers": "error",
"no-shadow": [
"error",
{
builtinGlobals: false, // そのうち
hoist: "all",
},
],
"no-constant-condition": [
"error",
{
checkLoops: false,
},
],
"no-unsafe-finally": "error",
"no-unused-expressions": "off",
"@typescript-eslint/no-unused-expressions": "error",
"no-var": "error",
"prefer-const": "error",
// strict-type-predicates入れたい: https://github.com/typescript-eslint/typescript-eslint/pull/738
"@typescript-eslint/no-unused-vars": ["error", { argsIgnorePattern: "^_" }],
// unused-importがほしい: https://github.com/typescript-eslint/typescript-eslint/issues/371
"@typescript-eslint/no-use-before-define": [
"warn",
{
functions: false,
},
],
"@typescript-eslint/require-await": "warn",
"@typescript-eslint/explicit-function-return-type": "off",
"@typescript-eslint/explicit-module-boundary-types": [
"warn", // そのうちerrorに
{
allowHigherOrderFunctions: true,
},
],
"@typescript-eslint/no-unsafe-member-access": "warn", // そのうち
"no-shadow": "warn", // とりあえず
"@typescript-eslint/no-unsafe-assignment": "warn", // port周りで使いまくってるので
"@typescript-eslint/no-unsafe-return": "warn", // そのうち
"@typescript-eslint/ban-types": "off", // {}とか使えんのはきっつい
},
};