@yoshinani/style-guide 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/eslint/base.js +17 -1
- package/package.json +3 -1
package/eslint/base.js
CHANGED
|
@@ -11,18 +11,28 @@ module.exports = {
|
|
|
11
11
|
},
|
|
12
12
|
},
|
|
13
13
|
},
|
|
14
|
-
plugins: ["@typescript-eslint", "eslint-plugin-import"],
|
|
14
|
+
plugins: ["@typescript-eslint", "eslint-plugin-import", "eslint-comments", "functional"],
|
|
15
15
|
rules: {
|
|
16
|
+
// [比較演算子禁止](https://www.notion.so/yoshinani-note/1dff5577f5838145acfcca9176913b79)
|
|
16
17
|
eqeqeq: ["error", "always", { null: "ignore" }],
|
|
18
|
+
// [any禁止](https://www.notion.so/yoshinani-note/any-1dff5577f5838174907ae6b2cfaf72ea)
|
|
19
|
+
"@typescript-eslint/no-explicit-any": "error",
|
|
20
|
+
// [混乱を招くvoidの使用禁止](https://www.notion.so/yoshinani-note/void-1dff5577f5838144bf0dc90e4bdffcb3)
|
|
17
21
|
"@typescript-eslint/no-confusing-void-expression": [
|
|
18
22
|
"error",
|
|
19
23
|
{ ignoreArrowShorthand: true },
|
|
20
24
|
],
|
|
25
|
+
// [awaitつけ忘れ防止](https://www.notion.so/yoshinani-note/await-1dff5577f58381e5ab40f29d8d3f0be4)
|
|
26
|
+
"@typescript-eslint/no-floating-promises": "error",
|
|
21
27
|
"@typescript-eslint/no-shadow": "off",
|
|
28
|
+
// [誤ったpromiseの使用禁止](https://www.notion.so/yoshinani-note/promise-1dff5577f58381ae86c0d8c5b83f052a)
|
|
22
29
|
"@typescript-eslint/no-misused-promises": [
|
|
23
30
|
"error",
|
|
24
31
|
{ checksVoidReturn: { attributes: false } },
|
|
25
32
|
],
|
|
33
|
+
// [不要なオプショナルチェーン禁止](https://www.notion.so/yoshinani-note/1dff5577f583816e8b5eec9963add23d)
|
|
34
|
+
"@typescript-eslint/no-unnecessary-condition": "error",
|
|
35
|
+
// [nullなどをそのまま文字列にするのを禁止](https://www.notion.so/yoshinani-note/null-1dff5577f5838104b3b9db6eee64f106)
|
|
26
36
|
"@typescript-eslint/restrict-template-expressions": [
|
|
27
37
|
"error",
|
|
28
38
|
{
|
|
@@ -33,6 +43,9 @@ module.exports = {
|
|
|
33
43
|
allowNever: false,
|
|
34
44
|
},
|
|
35
45
|
],
|
|
46
|
+
// [ルール無効化の際に理由を添える](https://www.notion.so/yoshinani-note/1dff5577f583818b913fec991d5e8b46)
|
|
47
|
+
"eslint-comments/require-description": ["error", {"ignore": []}],
|
|
48
|
+
"functional/immutable-data": "error",
|
|
36
49
|
// sort import statements
|
|
37
50
|
"import/order": [
|
|
38
51
|
"warn",
|
|
@@ -53,6 +66,7 @@ module.exports = {
|
|
|
53
66
|
"sort-imports": ["warn", { ignoreDeclarationSort: true }],
|
|
54
67
|
"no-restricted-syntax": [
|
|
55
68
|
"error",
|
|
69
|
+
// [enum禁止](https://www.notion.so/yoshinani-note/enum-1dff5577f58381a2b809d81ddc486701)
|
|
56
70
|
{
|
|
57
71
|
selector: "TSEnumDeclaration",
|
|
58
72
|
message:
|
|
@@ -77,7 +91,9 @@ module.exports = {
|
|
|
77
91
|
"`with` is disallowed in strict mode because it makes code impossible to predict and optimize.",
|
|
78
92
|
},
|
|
79
93
|
],
|
|
94
|
+
// [process.envの乱用禁止](https://www.notion.so/yoshinani-note/process-env-1dff5577f58381f4ba04f06cac13d334)
|
|
80
95
|
"no-process-env": "error",
|
|
96
|
+
// [インポートを制限](https://www.notion.so/yoshinani-note/1dff5577f58381a7bd81ef0805696e2b)
|
|
81
97
|
"no-restricted-imports": [
|
|
82
98
|
"warn",
|
|
83
99
|
{
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@yoshinani/style-guide",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "Yoshinani's Style Guide",
|
|
5
5
|
"homepage": "https://github.com/yoshinani-dev/style-guide#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -25,6 +25,8 @@
|
|
|
25
25
|
"@typescript-eslint/parser": "^8.18.2",
|
|
26
26
|
"@vercel/style-guide": "^6.0.0",
|
|
27
27
|
"eslint-config-prettier": "^9.1.0",
|
|
28
|
+
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
29
|
+
"eslint-plugin-functional": "6.6.3",
|
|
28
30
|
"eslint-plugin-import": "^2.31.0",
|
|
29
31
|
"eslint-plugin-only-warn": "^1.1.0",
|
|
30
32
|
"eslint-plugin-tailwindcss": "^3.17.5"
|