@book000/eslint-config 1.14.61 → 1.14.62
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/index.mjs +11 -3
- package/package.json +1 -1
- package/test.mjs +9 -2
package/index.mjs
CHANGED
|
@@ -84,10 +84,18 @@ export default tseslint.config(
|
|
|
84
84
|
},
|
|
85
85
|
},
|
|
86
86
|
{
|
|
87
|
-
//
|
|
88
|
-
//
|
|
87
|
+
// unicorn v65 からファイル名に加えてディレクトリ名もチェック対象となったが、
|
|
88
|
+
// ignore オプションはマッチしたセグメントを含むファイル全体をスキップするため
|
|
89
|
+
// ファイル名チェック自体まで無効化してしまう。
|
|
90
|
+
// そのため checkDirectories: false でディレクトリ名チェックのみ無効化する。
|
|
91
|
+
// src 等の慣習的なディレクトリ名でエラーが起きる問題もこれで解消される。
|
|
92
|
+
// __tests__ や __mocks__ 等のダブルアンダースコアディレクトリは引き続き
|
|
93
|
+
// ignore で対象外とする(テストファイル等はファイル名チェックも不要なため)。
|
|
89
94
|
rules: {
|
|
90
|
-
"unicorn/filename-case": [
|
|
95
|
+
"unicorn/filename-case": [
|
|
96
|
+
"error",
|
|
97
|
+
{ checkDirectories: false, ignore: [/^__[\w-]+__$/] },
|
|
98
|
+
],
|
|
91
99
|
},
|
|
92
100
|
},
|
|
93
101
|
{
|
package/package.json
CHANGED
package/test.mjs
CHANGED
|
@@ -194,9 +194,16 @@ async function main() {
|
|
|
194
194
|
dir: "__mocks__",
|
|
195
195
|
},
|
|
196
196
|
{
|
|
197
|
-
name: "filename-case:
|
|
197
|
+
name: "filename-case: src ディレクトリはケースチェック対象外(OK)",
|
|
198
198
|
code: "export const a = 1;",
|
|
199
|
-
shouldError:
|
|
199
|
+
shouldError: false,
|
|
200
|
+
rules: ["unicorn/filename-case"],
|
|
201
|
+
dir: "src",
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: "filename-case: checkDirectories: false のため kebab-case でないディレクトリ名もエラーにならない(OK)",
|
|
205
|
+
code: "export const a = 1;",
|
|
206
|
+
shouldError: false,
|
|
200
207
|
rules: ["unicorn/filename-case"],
|
|
201
208
|
dir: "notKebabCaseDir",
|
|
202
209
|
},
|