From b5ff840f529efca9562a72602262cbcee227a149 Mon Sep 17 00:00:00 2001 From: Andrew Bradley Date: Thu, 21 Oct 2021 22:45:26 -0400 Subject: [PATCH] lint-fix --- src/esm.ts | 18 +++++++++++++++--- src/index.ts | 6 +++++- src/test/esm-loader.spec.ts | 2 +- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/src/esm.ts b/src/esm.ts index 70dc70850..c83fd22c4 100644 --- a/src/esm.ts +++ b/src/esm.ts @@ -69,10 +69,19 @@ export namespace NodeLoaderHooksAPI2 { url: string, context: { format: NodeLoaderHooksFormat | null | undefined }, defaultLoad: NodeLoaderHooksAPI2['load'] - ) => Promise<{ format: NodeLoaderHooksFormat; source: string | Buffer | undefined }>; + ) => Promise<{ + format: NodeLoaderHooksFormat; + source: string | Buffer | undefined; + }>; } -export type NodeLoaderHooksFormat = 'builtin' | 'commonjs' | 'dynamic' | 'json' | 'module' | 'wasm'; +export type NodeLoaderHooksFormat = + | 'builtin' + | 'commonjs' + | 'dynamic' + | 'json' + | 'module' + | 'wasm'; /** @internal */ export function registerAndCreateEsmHooks(opts?: RegisterOptions) { @@ -152,7 +161,10 @@ export function createEsmHooks(tsNodeService: Service) { url: string, context: { format: NodeLoaderHooksFormat | null | undefined }, defaultLoad: typeof load - ): Promise<{ format: NodeLoaderHooksFormat; source: string | Buffer | undefined }> { + ): Promise<{ + format: NodeLoaderHooksFormat; + source: string | Buffer | undefined; + }> { // If we get a format hint from resolve() on the context then use it // otherwise call the old getFormat() hook using node's old built-in defaultGetFormat() that ships with ts-node const format = diff --git a/src/index.ts b/src/index.ts index 0fe3e16e8..977922ea5 100644 --- a/src/index.ts +++ b/src/index.ts @@ -40,7 +40,11 @@ export type { TranspileOptions, Transpiler, } from './transpilers/types'; -export type {NodeLoaderHooksAPI1, NodeLoaderHooksAPI2, NodeLoaderHooksFormat} from './esm'; +export type { + NodeLoaderHooksAPI1, + NodeLoaderHooksAPI2, + NodeLoaderHooksFormat, +} from './esm'; /** * Does this version of node obey the package.json "type" field diff --git a/src/test/esm-loader.spec.ts b/src/test/esm-loader.spec.ts index b4ca5862a..6c3c1c51a 100644 --- a/src/test/esm-loader.spec.ts +++ b/src/test/esm-loader.spec.ts @@ -45,7 +45,7 @@ test.suite('createEsmHooks', (test) => { test.suite('hooks', (_test) => { const test = _test.context(async (t) => { const service = t.context.tsNodeUnderTest.create({ - cwd: TEST_DIR + cwd: TEST_DIR, }); t.teardown(() => { resetNodeEnvironment();