Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update TsConfigJson.CompilerOptions to latest TypeScript #529

Merged
merged 3 commits into from Dec 25, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
42 changes: 41 additions & 1 deletion source/tsconfig-json.d.ts
Expand Up @@ -221,6 +221,21 @@ declare namespace TsConfigJson {
| 'useFsEventsOnParentDirectory'
| 'fixedChunkSizePolling';

export type ModuleResolution =
| 'classic'
| 'node'
| 'node16'
| 'nodenext'
// Pascal-cased alternatives
| 'Classic'
| 'Node'
| 'Node16'
| 'NodeNext';

export type ModuleDetection =
| 'auto'
| 'legacy'
| 'force';
}

export type CompilerOptions = {
Expand Down Expand Up @@ -395,7 +410,7 @@ declare namespace TsConfigJson {

@default ['AMD', 'System', 'ES6'].includes(module) ? 'classic' : 'node'
*/
moduleResolution?: 'classic' | 'node';
moduleResolution?: CompilerOptions.ModuleResolution;

/**
Specifies the end of line sequence to be used when emitting files: 'crlf' (Windows) or 'lf' (Unix).
Expand Down Expand Up @@ -997,6 +1012,31 @@ declare namespace TsConfigJson {
@default false
*/
explainFiles?: boolean;

/**
Preserve unused imported values in the JavaScript output that would otherwise be removed.

Requires TypeScript version 4.7 or later.

@default true
*/
preserveValueImports?: boolean;

/**
List of file name suffixes to search when resolving a module.

Requires TypeScript version 4.5 or later.
*/
moduleSuffixes?: string[];

/**
Control what method is used to detect module-format JS files.

Requires TypeScript version 4.7 or later.
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

type-fest requires TS 4.7, so this is moot.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get it. Why is that?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because the only way to get this type is to already be on TS 4.7, so the message of requiring TS 4.7 is not needed.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh. Sorry, I thought you were speaking of the whole PR. 🤪

Anyway, I would respectfully disagree. Users of this type are tsconfig consumers or producers and I think their editor telling them if a property is available in the version of TypeScript they are targeting (vs the one they're using) is a nice thing to have.


@default 'auto'
*/
moduleDetection?: CompilerOptions.ModuleDetection;
};

namespace WatchOptions {
Expand Down