Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(utils): use tsconfigRootDir as root dir when specified #1260

Merged

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

@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