Skip to content

Commit

Permalink
lint-fix
Browse files Browse the repository at this point in the history
  • Loading branch information
cspotcode committed May 17, 2022
1 parent d4df204 commit a865be3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/index.ts
Expand Up @@ -1574,11 +1574,11 @@ function registerExtensions(
) {
const exts = new Set(extensions);
// Can't add these extensions cuz would allow omitting file extension; node requires ext for .cjs and .mjs
// Unless they're already registered by something else; then we *must* hook them or else our transformer
// will not be called.
for(const cannotAdd of ['.mts', '.cts', '.mjs', '.cjs']) {
// Other file exts can still be transformed via the .js extension.
if(exts.has(cannotAdd) && !hasOwnProperty(require.extensions, cannotAdd)) {
// Unless they're already registered by something else (nyc does this):
// then we *must* hook them or else our transformer will not be called.
for (const cannotAdd of ['.mts', '.cts', '.mjs', '.cjs']) {
if (exts.has(cannotAdd) && !hasOwnProperty(require.extensions, cannotAdd)) {
// Unrecognized file exts can be transformed via the `.js` handler.
exts.add('.js');
exts.delete(cannotAdd);
}
Expand Down

0 comments on commit a865be3

Please sign in to comment.