Skip to content

Commit 19fe26c

Browse files
authored
fix(utils): use tsconfigRootDir as root dir when specified (#1260)
1 parent 16827e4 commit 19fe26c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

packages/utils/src/rules-tester.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,10 @@ export class RuleTester extends TSESLint.RuleTester {
3333
});
3434

3535
if (options.parserOptions?.project) {
36-
this.filename = path.join(getFixturesRootDir(), 'file.ts');
36+
this.filename = path.join(
37+
options.parserOptions?.tsconfigRootDir ?? getFixturesRootDir(),
38+
'file.ts',
39+
);
3740
}
3841

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

0 commit comments

Comments
 (0)