-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.js
More file actions
55 lines (54 loc) · 1.77 KB
/
Copy patheslint.config.js
File metadata and controls
55 lines (54 loc) · 1.77 KB
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
// @ts-check
import js from "@eslint/js";
import tseslint from "typescript-eslint";
import importX from "eslint-plugin-import-x";
import prettier from "eslint-config-prettier";
import globals from "globals";
export default tseslint.config(
{
// 生成物・依存はリントしない。web/ は独立パッケージで自前の ESLint 設定を持つ。
ignores: ["dist/**", "coverage/**", "node_modules/**", "web/**"],
},
js.configs.recommended,
...tseslint.configs.recommended,
{
// 開発用スクリプト(Node ESM)。console での進捗表示を許可する。
files: ["scripts/**/*.mjs"],
languageOptions: {
ecmaVersion: 2023,
sourceType: "module",
globals: { ...globals.node },
},
},
{
files: ["**/*.ts"],
languageOptions: {
ecmaVersion: 2023,
sourceType: "module",
globals: { ...globals.node },
// ルートをこのリポジトリに固定する。pre-commit でルートと web/ の .ts が
// 混在して渡されても、TSConfigRootDir の曖昧さでパースエラーにならないようにする。
parserOptions: { tsconfigRootDir: import.meta.dirname },
},
plugins: {
"import-x": importX,
},
settings: {
// `.js` 拡張子付き ESM import を `.ts` ソースへ解決する
"import-x/resolver": {
typescript: true,
node: true,
},
},
rules: {
// 規約: console.* 禁止(ログは utils/logger 経由で stderr へ)
"no-console": "error",
// 規約: any 禁止
"@typescript-eslint/no-explicit-any": "error",
// 規約: 循環依存禁止
"import-x/no-cycle": "error",
},
},
// Prettier と競合するフォーマット系ルールを無効化(必ず最後)
prettier,
);