-
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(interfaces):
ResolvePathsOptions
Signed-off-by: Lexus Drumgold <unicornware@flexdevelopment.llc>
- Loading branch information
1 parent
2e839e5
commit 08ace44
Showing
3 changed files
with
83 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/** | ||
* @file Type Tests - ResolvePathsOptions | ||
* @module tsconfig-utils/interfaces/tests/unit-d/ResolvePathsOptions | ||
*/ | ||
|
||
import type mlly from '@flex-development/mlly' | ||
import type LoadTsconfigOptions from '../options-load-tsconfig' | ||
import type TestSubject from '../options-resolve-paths' | ||
|
||
describe('unit-d:interfaces/ResolvePathsOptions', () => { | ||
it('should extend LoadTsconfigOptions', () => { | ||
expectTypeOf<TestSubject>().toMatchTypeOf<LoadTsconfigOptions>() | ||
}) | ||
|
||
it('should extend Omit<mlly.ResolveAliasOptions, "aliases" | "cwd">', () => { | ||
expectTypeOf<TestSubject>().toMatchTypeOf< | ||
Omit<mlly.ResolveAliasOptions, 'aliases' | 'cwd'> | ||
>() | ||
}) | ||
|
||
it('should match [parent: mlly.ModuleId]', () => { | ||
expectTypeOf<TestSubject>() | ||
.toHaveProperty('parent') | ||
.toEqualTypeOf<mlly.ModuleId>() | ||
}) | ||
|
||
it('should match [tsconfig?: mlly.ModuleId]', () => { | ||
expectTypeOf<TestSubject>() | ||
.toHaveProperty('tsconfig') | ||
.toEqualTypeOf<mlly.ModuleId | undefined>() | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/** | ||
* @file Interfaces - ResolvePathsOptions | ||
* @module tsconfig-utils/interfaces/ResolvePathsOptions | ||
*/ | ||
|
||
import type mlly from '@flex-development/mlly' | ||
import type LoadTsconfigOptions from './options-load-tsconfig' | ||
|
||
/** | ||
* Options for resolving path aliases in `export`, `import`, and `require` | ||
* statements. | ||
* | ||
* @see {@linkcode LoadTsconfigOptions} | ||
* @see {@linkcode mlly.ResolveAliasOptions} | ||
* | ||
* @extends {LoadTsconfigOptions} | ||
* @extends {Omit<mlly.ResolveAliasOptions,'aliases'|'cwd'>} | ||
*/ | ||
interface ResolvePathsOptions | ||
extends LoadTsconfigOptions, | ||
Omit<mlly.ResolveAliasOptions, 'aliases' | 'cwd'> { | ||
/** | ||
* Return resolved module URLs as absolute specifiers ([`file:` URLs][1]). | ||
* | ||
* If `false`, return resolved module URLs as bare or relative specifiers. | ||
* | ||
* [1]: https://nodejs.org/api/esm.html#file-urls | ||
* | ||
* @see https://nodejs.org/api/esm.html#terminology | ||
* | ||
* @default false | ||
*/ | ||
absolute?: boolean | undefined | ||
|
||
/** | ||
* Id of module to resolve from. | ||
*/ | ||
parent: mlly.ModuleId | ||
|
||
/** | ||
* Module id of [tsconfig][1] file. | ||
* | ||
* [1]: https://www.typescriptlang.org/tsconfig | ||
* | ||
* @default mlly.toURL('tsconfig.json') | ||
*/ | ||
tsconfig?: mlly.ModuleId | undefined | ||
} | ||
|
||
export type { ResolvePathsOptions as default } |