Skip to content

Commit b5ff840

Browse files
committed
lint-fix
1 parent 4b957a1 commit b5ff840

File tree

3 files changed

+21
-5
lines changed

3 files changed

+21
-5
lines changed

src/esm.ts

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,19 @@ export namespace NodeLoaderHooksAPI2 {
6969
url: string,
7070
context: { format: NodeLoaderHooksFormat | null | undefined },
7171
defaultLoad: NodeLoaderHooksAPI2['load']
72-
) => Promise<{ format: NodeLoaderHooksFormat; source: string | Buffer | undefined }>;
72+
) => Promise<{
73+
format: NodeLoaderHooksFormat;
74+
source: string | Buffer | undefined;
75+
}>;
7376
}
7477

75-
export type NodeLoaderHooksFormat = 'builtin' | 'commonjs' | 'dynamic' | 'json' | 'module' | 'wasm';
78+
export type NodeLoaderHooksFormat =
79+
| 'builtin'
80+
| 'commonjs'
81+
| 'dynamic'
82+
| 'json'
83+
| 'module'
84+
| 'wasm';
7685

7786
/** @internal */
7887
export function registerAndCreateEsmHooks(opts?: RegisterOptions) {
@@ -152,7 +161,10 @@ export function createEsmHooks(tsNodeService: Service) {
152161
url: string,
153162
context: { format: NodeLoaderHooksFormat | null | undefined },
154163
defaultLoad: typeof load
155-
): Promise<{ format: NodeLoaderHooksFormat; source: string | Buffer | undefined }> {
164+
): Promise<{
165+
format: NodeLoaderHooksFormat;
166+
source: string | Buffer | undefined;
167+
}> {
156168
// If we get a format hint from resolve() on the context then use it
157169
// otherwise call the old getFormat() hook using node's old built-in defaultGetFormat() that ships with ts-node
158170
const format =

src/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,11 @@ export type {
4040
TranspileOptions,
4141
Transpiler,
4242
} from './transpilers/types';
43-
export type {NodeLoaderHooksAPI1, NodeLoaderHooksAPI2, NodeLoaderHooksFormat} from './esm';
43+
export type {
44+
NodeLoaderHooksAPI1,
45+
NodeLoaderHooksAPI2,
46+
NodeLoaderHooksFormat,
47+
} from './esm';
4448

4549
/**
4650
* Does this version of node obey the package.json "type" field

src/test/esm-loader.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ test.suite('createEsmHooks', (test) => {
4545
test.suite('hooks', (_test) => {
4646
const test = _test.context(async (t) => {
4747
const service = t.context.tsNodeUnderTest.create({
48-
cwd: TEST_DIR
48+
cwd: TEST_DIR,
4949
});
5050
t.teardown(() => {
5151
resetNodeEnvironment();

0 commit comments

Comments
 (0)