Skip to content

Commit

Permalink
fix(rule): keep file extension when not .js
Browse files Browse the repository at this point in the history
  • Loading branch information
JamieMason committed Oct 9, 2019
1 parent b1b0d30 commit 9f10493
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/move-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const withLeadingDot = (moduleId: string) =>
: `./${moduleId}`;

const withoutFileExtension = (filePath: string) =>
filePath.replace(/\.[^.]+$/, '');
filePath.endsWith('.js') ? filePath.replace(/\.js$/, '') : filePath;

const getNewDepId = (filePath: string) =>
withLeadingDot(withoutFileExtension(filePath));
Expand Down

0 comments on commit 9f10493

Please sign in to comment.