Skip to content

Commit 800ee0f

Browse files
benceruleanluarjansingh
authored andcommitted
chore(eslint): allow default project for Playwright configs to fix pre-commit linting (#5901)
Summary - Adds playwright.config.ts and playwright.i18n.config.ts to typescript-eslint projectService.allowDefaultProject in eslint.config.ts. Why - Pre-commit runs lint-staged, which lints staged TypeScript files including Playwright config files. - These configs are not included in any tsconfig, so typescript-eslint’s project service can’t find a project and fails with: "Parsing error: .../playwright.config.ts was not found by the project service. Consider either including it in the tsconfig.json or including it in allowDefaultProject". What this changes - Whitelists the two Playwright config files to use the default project (isolated file parsing) so ESLint can parse and lint them without being part of a tsconfig. - Does not affect application code linting, which remains fully type-aware via existing tsconfigs. Alternatives considered - Include these configs in a dedicated ESLint tsconfig (e.g., tsconfig.eslint.json) and point ESLint to it. - Exclude Playwright config files from lint-staged (would reduce lint coverage for them). - Keep as TypeScript but non-type-aware: current approach is minimal and avoids touching tsconfig scopes. Verification - Reproduced pre-commit failure when changing playwright.config.ts. - After this change, `pnpm exec eslint --cache --fix playwright.config.ts` succeeds. - `pnpm typecheck` passes. Notes - No changes to Playwright runtime behavior. This only affects linting. ┆Issue is synchronized with this [Notion page](https://www.notion.so/PR-5901-chore-eslint-allow-default-project-for-Playwright-configs-to-fix-pre-commit-linting-2816d73d36508156b94dfeff79a91c7f) by [Unito](https://www.unito.io)
1 parent 9cd7b49 commit 800ee0f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

eslint.config.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,10 @@ export default defineConfig([
5252
projectService: {
5353
allowDefaultProject: [
5454
'vite.config.mts',
55+
'vite.electron.config.mts',
5556
'vite.types.config.mts',
56-
'vitest.litegraph.config.ts'
57+
'playwright.config.ts',
58+
'playwright.i18n.config.ts'
5759
]
5860
},
5961
tsConfigRootDir: import.meta.dirname,

tsconfig.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,6 @@
5757
"src/types/**/*.d.ts",
5858
"tailwind.config.ts",
5959
"tests-ui/**/*",
60-
"vitest.config.ts",
60+
"vitest.config.ts"
6161
]
6262
}

0 commit comments

Comments
 (0)