Skip to content

Commit

Permalink
tmp: convert logger.ts → logger.js
Browse files Browse the repository at this point in the history
  • Loading branch information
JakobJingleheimer committed Aug 17, 2024
1 parent 207fb60 commit 6deda58
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
8 changes: 6 additions & 2 deletions logger.ts → logger.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
/**
* @param {'error' | 'log' | 'warn'} type
* @param {string} msg
*/
export const logger = (
type: 'error' | 'log' | 'warn',
msg: string,
type,
msg,
) => console[type](`[Codemod: correct-ts-extensions]: ${msg}`);
4 changes: 2 additions & 2 deletions map-imports.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { FSPath, Specifier } from './index.d.ts';
import { fexists } from './fexists.ts';
import { logger } from './logger.ts';
import { logger } from './logger.js';
import { replaceJSExtWithTSExt } from './replace-js-ext-with-ts-ext.ts';


Expand All @@ -23,7 +23,7 @@ export const mapImports = async (
if (await fexists(filePath, specifier)) {
logger('warn', [
`Import specifier '${specifier}' within ${filePath} contains a JS extension AND a file`,
`with the corresponding TS extension exists. Impossible to disambiguate (skipping).`,
`with the corresponding TS extension exists. Cannot disambiguate (skipping).`,
].join(' '));

return;
Expand Down

0 comments on commit 6deda58

Please sign in to comment.