Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3bdab60

Browse files
authored
Add .js to imports in types (#1033)
1 parent 8fbb643 commit 3bdab60

27 files changed

+100
-103
lines changed

index.d.ts

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,13 @@ export type {
33
StdinSyncOption,
44
StdoutStderrOption,
55
StdoutStderrSyncOption,
6-
} from './types/stdio/type';
7-
export type {Options, SyncOptions} from './types/arguments/options';
8-
export type {Result, SyncResult} from './types/return/result';
9-
export type {ResultPromise, Subprocess} from './types/subprocess/subprocess';
10-
/* eslint-disable import/extensions */
11-
export {ExecaError, ExecaSyncError} from './types/return/final-error';
12-
export {execa} from './types/methods/main-async';
13-
export {execaSync} from './types/methods/main-sync';
14-
export {execaCommand, execaCommandSync} from './types/methods/command';
15-
export {$} from './types/methods/script';
16-
export {execaNode} from './types/methods/node';
17-
/* eslint-enable import/extensions */
6+
} from './types/stdio/type.js';
7+
export type {Options, SyncOptions} from './types/arguments/options.js';
8+
export type {Result, SyncResult} from './types/return/result.js';
9+
export type {ResultPromise, Subprocess} from './types/subprocess/subprocess.js';
10+
export {ExecaError, ExecaSyncError} from './types/return/final-error.js';
11+
export {execa} from './types/methods/main-async.js';
12+
export {execaSync} from './types/methods/main-sync.js';
13+
export {execaCommand, execaCommandSync} from './types/methods/command.js';
14+
export {$} from './types/methods/script.js';
15+
export {execaNode} from './types/methods/node.js';

types/arguments/options.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import type {Readable} from 'node:stream';
2-
import type {Unless} from '../utils';
3-
import type {StdinOptionCommon, StdoutStderrOptionCommon, StdioOptionsProperty} from '../stdio/type';
4-
import type {FdGenericOption} from './specific';
5-
import type {EncodingOption} from './encoding-option';
2+
import type {Unless} from '../utils.js';
3+
import type {StdinOptionCommon, StdoutStderrOptionCommon, StdioOptionsProperty} from '../stdio/type.js';
4+
import type {FdGenericOption} from './specific.js';
5+
import type {EncodingOption} from './encoding-option.js';
66

77
export type CommonOptions<IsSync extends boolean = boolean> = {
88
/**

types/arguments/specific.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {FromOption} from './fd-options';
1+
import type {FromOption} from './fd-options.js';
22

33
// Options which can be fd-specific like `{verbose: {stdout: 'none', stderr: 'full'}}`
44
export type FdGenericOption<OptionType = unknown> = OptionType | GenericOptionObject<OptionType>;

types/convert.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type {BinaryEncodingOption} from './arguments/encoding-option';
2-
import type {Options} from './arguments/options';
3-
import type {FromOption, ToOption} from './arguments/fd-options';
1+
import type {BinaryEncodingOption} from './arguments/encoding-option.js';
2+
import type {Options} from './arguments/options.js';
3+
import type {FromOption, ToOption} from './arguments/fd-options.js';
44

55
// `subprocess.readable|duplex|iterable()` options
66
export type ReadableOptions = {

types/methods/command.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import type {Options, SyncOptions} from '../arguments/options';
2-
import type {SyncResult} from '../return/result';
3-
import type {ResultPromise} from '../subprocess/subprocess';
4-
import type {SimpleTemplateString} from './template';
1+
import type {Options, SyncOptions} from '../arguments/options.js';
2+
import type {SyncResult} from '../return/result.js';
3+
import type {ResultPromise} from '../subprocess/subprocess.js';
4+
import type {SimpleTemplateString} from './template.js';
55

66
type ExecaCommand<OptionsType extends Options> = {
77
<NewOptionsType extends Options = {}>(options: NewOptionsType): ExecaCommand<OptionsType & NewOptionsType>;

types/methods/main-async.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type {Options} from '../arguments/options';
2-
import type {ResultPromise} from '../subprocess/subprocess';
3-
import type {TemplateString} from './template';
1+
import type {Options} from '../arguments/options.js';
2+
import type {ResultPromise} from '../subprocess/subprocess.js';
3+
import type {TemplateString} from './template.js';
44

55
type Execa<OptionsType extends Options> = {
66
<NewOptionsType extends Options = {}>(options: NewOptionsType): Execa<OptionsType & NewOptionsType>;

types/methods/main-sync.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type {SyncOptions} from '../arguments/options';
2-
import type {SyncResult} from '../return/result';
3-
import type {TemplateString} from './template';
1+
import type {SyncOptions} from '../arguments/options.js';
2+
import type {SyncResult} from '../return/result.js';
3+
import type {TemplateString} from './template.js';
44

55
type ExecaSync<OptionsType extends SyncOptions> = {
66
<NewOptionsType extends SyncOptions = {}>(options: NewOptionsType): ExecaSync<OptionsType & NewOptionsType>;

types/methods/node.d.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import type {Options} from '../arguments/options';
2-
import type {ResultPromise} from '../subprocess/subprocess';
3-
import type {TemplateString} from './template';
1+
import type {Options} from '../arguments/options.js';
2+
import type {ResultPromise} from '../subprocess/subprocess.js';
3+
import type {TemplateString} from './template.js';
44

55
type ExecaNode<OptionsType extends Options> = {
66
<NewOptionsType extends Options = {}>(options: NewOptionsType): ExecaNode<OptionsType & NewOptionsType>;

types/methods/script.d.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@ import type {
33
Options,
44
SyncOptions,
55
StricterOptions,
6-
} from '../arguments/options';
7-
import type {SyncResult} from '../return/result';
8-
import type {ResultPromise} from '../subprocess/subprocess';
9-
import type {TemplateString} from './template';
6+
} from '../arguments/options.js';
7+
import type {SyncResult} from '../return/result.js';
8+
import type {ResultPromise} from '../subprocess/subprocess.js';
9+
import type {TemplateString} from './template.js';
1010

1111
type ExecaScriptCommon<OptionsType extends CommonOptions> = {
1212
<NewOptionsType extends CommonOptions = {}>(options: NewOptionsType): ExecaScript<OptionsType & NewOptionsType>;

types/methods/template.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type {CommonResultInstance} from '../return/result';
1+
import type {CommonResultInstance} from '../return/result.js';
22

33
// Values allowed inside `...${...}...` template syntax
44
export type TemplateExpression =

0 commit comments

Comments
 (0)