Skip to content

Commit 92a0383

Browse files
committed
fix(eslint): pin tsconfigRootDir so lint works from any CWD
Each workspace's eslint.config.mjs set parserOptions.project to a workspace-prefixed path (e.g. 'Common/tsconfig.cjs.json') on the assumption that typescript-eslint resolves it relative to the repo root. That assumption holds only for some versions of typescript-eslint and breaks outright when lint is invoked with CWD = workspace dir — which is exactly how .github/workflows/healthcheck-libraries.yml runs it (working-directory: Common, etc.). Pin parserOptions.tsconfigRootDir to import.meta.dirname so the relative project path is always resolved against the eslint config file's own directory, regardless of CWD or typescript-eslint version. Drop the workspace prefix from project accordingly.
1 parent 2dc492c commit 92a0383

7 files changed

Lines changed: 21 additions & 6 deletions

File tree

.changeset/quiet-foxes-dance.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
---
2+
"@epicgames-ps/lib-pixelstreamingcommon-ue5.7": patch
3+
"@epicgames-ps/lib-pixelstreamingsignalling-ue5.7": patch
4+
"@epicgames-ps/wilbur": patch
5+
"@epicgames-ps/lib-pixelstreamingfrontend-ue5.7": patch
6+
"@epicgames-ps/lib-pixelstreamingfrontend-ui-ue5.7": patch
7+
---
8+
9+
Make `npm run lint` work regardless of the directory it's invoked from. Each workspace's `eslint.config.mjs` now pins `parserOptions.tsconfigRootDir` to `import.meta.dirname`, so `parserOptions.project` resolves relative to the config file's own directory rather than whichever CWD `typescript-eslint` happens to pick by default. Previously the six workspace configs prefixed `project` with the workspace directory (e.g. `'Common/tsconfig.cjs.json'`), which only worked under one specific `typescript-eslint` version's resolution behavior and broke CI when run from within the workspace.

Common/eslint.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export default tseslint.config(
1313
languageOptions: {
1414
parser: tseslint.parser,
1515
parserOptions: {
16-
project: 'Common/tsconfig.cjs.json',
16+
project: 'tsconfig.cjs.json',
17+
tsconfigRootDir: import.meta.dirname,
1718
},
1819
},
1920
files: ["src/**/*.ts"],

Extras/JSStreamer/eslint.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export default tseslint.config(
1313
languageOptions: {
1414
parser: tseslint.parser,
1515
parserOptions: {
16-
project: 'Extras/JSStreamer/tsconfig.cjs.json',
16+
project: 'tsconfig.cjs.json',
17+
tsconfigRootDir: import.meta.dirname,
1718
},
1819
},
1920
files: ["src/**/*.ts"],

Frontend/library/eslint.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export default tseslint.config(
1212
languageOptions: {
1313
parser: tseslint.parser,
1414
parserOptions: {
15-
project: 'Frontend/library/tsconfig.json',
15+
project: 'tsconfig.json',
16+
tsconfigRootDir: import.meta.dirname,
1617
},
1718
},
1819
files: ["src/**/*.ts"],

Frontend/ui-library/eslint.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ export default tseslint.config(
1212
languageOptions: {
1313
parser: tseslint.parser,
1414
parserOptions: {
15-
project: 'Frontend/ui-library/tsconfig.json',
15+
project: 'tsconfig.json',
16+
tsconfigRootDir: import.meta.dirname,
1617
},
1718
},
1819
files: ["src/**/*.ts"],

Signalling/eslint.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,8 @@ export default tseslint.config(
1313
languageOptions: {
1414
parser: tseslint.parser,
1515
parserOptions: {
16-
project: 'Signalling/tsconfig.cjs.json',
16+
project: 'tsconfig.cjs.json',
17+
tsconfigRootDir: import.meta.dirname,
1718
},
1819
},
1920
files: ["src/**/*.ts"],

SignallingWebServer/eslint.config.mjs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ export default tseslint.config(
1414
languageOptions: {
1515
parser: tseslint.parser,
1616
parserOptions: {
17-
project: 'SignallingWebServer/tsconfig.json',
17+
project: 'tsconfig.json',
18+
tsconfigRootDir: import.meta.dirname,
1819
},
1920
},
2021
files: ["src/**/*.ts"],

0 commit comments

Comments
 (0)