Skip to content

Commit

Permalink
fix(utils): use tsconfigRootDir as root dir when specified (#1260)
Browse files Browse the repository at this point in the history
  • Loading branch information
nathan-xiao1 authored Jan 14, 2023
1 parent 16827e4 commit 19fe26c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion packages/utils/src/rules-tester.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,10 @@ export class RuleTester extends TSESLint.RuleTester {
});

if (options.parserOptions?.project) {
this.filename = path.join(getFixturesRootDir(), 'file.ts');
this.filename = path.join(
options.parserOptions?.tsconfigRootDir ?? getFixturesRootDir(),
'file.ts',
);
}

// make sure that the parser doesn't hold onto file handles between tests
Expand Down

0 comments on commit 19fe26c

Please sign in to comment.