Skip to content

Commit

Permalink
fix(linter): ensure ast file detection supports tsx files (#15345)
Browse files Browse the repository at this point in the history
  • Loading branch information
meeroslav committed Mar 1, 2023
1 parent b7ef261 commit e767fa4
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions packages/eslint-plugin-nx/src/utils/ast-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,13 @@ export function getRelativeImportPath(exportedMember, filePath, basePath) {
dirname(filePath),
`${modulePath}.ts`
);
if (!existsSync(moduleFilePath)) {
// might be a tsx file
moduleFilePath = joinPathFragments(
dirname(filePath),
`${modulePath}.tsx`
);
}
if (!existsSync(moduleFilePath)) {
// might be a index.ts
moduleFilePath = joinPathFragments(
Expand Down

0 comments on commit e767fa4

Please sign in to comment.