Skip to content

Conversation

nathan-xiao1
Copy link
Contributor

Currently, when options.parserOptions.project is specified, we set the filename to be path.join(process.cwd(), 'tests/fixtures/'). This can be problematic when we run the test from a higher-up parent directory as it will use that as the base directory and look for 'tests/fixtures/file.ts from there.

Instead, we should use options.parserOptions.tsconfigRootDir as the base directory when specified and resolve file.ts from there. This is similar to how @typescript-eslint does it: https://github.com/typescript-eslint/typescript-eslint/blob/main/packages/utils/src/eslint-utils/rule-tester/RuleTester.ts#L122-L137

@nx-cloud
Copy link

nx-cloud bot commented Dec 14, 2022

@JamesHenry JamesHenry force-pushed the use-tsconfigRootDir-as-root-dir branch from 87a22f9 to 5e075af Compare January 14, 2023 14:31
@JamesHenry JamesHenry merged commit 19fe26c into angular-eslint:main Jan 14, 2023
@JamesHenry
Copy link
Member

Thank you @nathan-xiao1!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants