Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@
"checkJs": false,
},
"include": ["src/**/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules", "src/__tests__/**"]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

Type-aware ESLint will likely break for test files with this exclusion.

Because ESLint uses parserOptions.project: "./tsconfig.json" while lint targets src/**/*.ts, excluding src/__tests__/** here can cause parser project-inclusion errors on test files during npm run lint. Keep this exclusion for tsc, but add a dedicated ESLint tsconfig that includes tests (or point ESLint to a separate project file).

Suggested config split
# tsconfig.json (typecheck/build)
 "exclude": ["node_modules", "src/__tests__/**"]
// tsconfig.eslint.json (new)
{
  "extends": "./tsconfig.json",
  "include": ["src/**/*.ts"],
  "exclude": ["node_modules"]
}
# eslint.config.mts
 parserOptions: {
-  project: "./tsconfig.json",
+  project: "./tsconfig.eslint.json",
 },
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@tsconfig.json` at line 38, The tsconfig.json currently excludes
"src/__tests__/**", which breaks type-aware ESLint because parserOptions.project
points at tsconfig.json while lint targets src/**/*.ts; create a separate ESLint
TS config (e.g., tsconfig.eslint.json) that extends "./tsconfig.json", sets
"include": ["src/**/*.ts"] and removes the tests exclusion (keep only
"node_modules" in "exclude"), then update ESLint's parserOptions.project to
point to this new tsconfig so tests are included for linting while the original
tsconfig keeps the exclusion for tsc.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2: Excluding src/__tests__/** from tsconfig.json will break type-aware ESLint linting for test files if ESLint is configured with parserOptions.project pointing to this tsconfig. Files excluded from the tsconfig cannot be parsed by typescript-eslint's type-aware rules, resulting in "TSConfig does not include this file" errors.

Consider creating a separate tsconfig.eslint.json that extends this config but removes the test exclusion, and point ESLint's parserOptions.project at it instead.

Prompt for AI agents
Check if this issue is valid — if so, understand the root cause and fix it. At tsconfig.json, line 38:

<comment>Excluding `src/__tests__/**` from tsconfig.json will break type-aware ESLint linting for test files if ESLint is configured with `parserOptions.project` pointing to this tsconfig. Files excluded from the tsconfig cannot be parsed by typescript-eslint's type-aware rules, resulting in "TSConfig does not include this file" errors.

Consider creating a separate `tsconfig.eslint.json` that extends this config but removes the test exclusion, and point ESLint's `parserOptions.project` at it instead.</comment>

<file context>
@@ -35,5 +35,5 @@
   },
   "include": ["src/**/*.ts"],
-  "exclude": ["node_modules"]
+  "exclude": ["node_modules", "src/__tests__/**"]
 }
</file context>

}
Loading