@yoshinani/style-guide 0.0.3 → 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/LICENSE.md +21 -0
- package/eslint/base.js +17 -1
- package/package.json +11 -1
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 YOSHINANI, Inc.
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
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,7 +1,15 @@
|
|
|
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
|
+
"homepage": "https://github.com/yoshinani-dev/style-guide#readme",
|
|
6
|
+
"bugs": {
|
|
7
|
+
"url": "https://github.com/yoshinani-dev/style-guide/issues"
|
|
8
|
+
},
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/yoshinani-dev/style-guide.git"
|
|
12
|
+
},
|
|
5
13
|
"exports": {
|
|
6
14
|
"./typescript": "./typescript/base.json",
|
|
7
15
|
"./typescript/nextjs": "./typescript/nextjs.json",
|
|
@@ -17,6 +25,8 @@
|
|
|
17
25
|
"@typescript-eslint/parser": "^8.18.2",
|
|
18
26
|
"@vercel/style-guide": "^6.0.0",
|
|
19
27
|
"eslint-config-prettier": "^9.1.0",
|
|
28
|
+
"eslint-plugin-eslint-comments": "^3.2.0",
|
|
29
|
+
"eslint-plugin-functional": "6.6.3",
|
|
20
30
|
"eslint-plugin-import": "^2.31.0",
|
|
21
31
|
"eslint-plugin-only-warn": "^1.1.0",
|
|
22
32
|
"eslint-plugin-tailwindcss": "^3.17.5"
|