Skip to content

fix(deps): update devdependency typescript to ^5.9.2 #882

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

Merged
merged 2 commits into from
Aug 5, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions docs/configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ Specifies preferences for the internal `tsserver` process. Those options depend

**autoImportFileExcludePatterns** [array of strings] Glob patterns of files to exclude from auto imports. Relative paths are resolved relative to the workspace root. Since TypeScript 4.8.2+. **Default**: `[]`

**autoImportSpecifierExcludeRegexes** [array of strings] Regexp patterns of files to exclude from auto imports. **Default**: `[]`

**disableSuggestions** [boolean] **Default**: `false`

**quotePreference** [string] Supported values `'auto'`, `'double'`, `'single'`. **Default**: `'auto'`
Expand Down Expand Up @@ -84,17 +86,23 @@ Specifies preferences for the internal `tsserver` process. Those options depend

**lazyConfiguredProjectsFromExternalProject** [boolean] **Default**: `false`

**maximumHoverLength** [number] A positive integer indicating the maximum length of a hover text before it is truncated. **Default**: `500`

<a name="organizeImportsIgnoreCase"></a> **organizeImportsIgnoreCase** [string or boolean] Indicates whether imports should be organized in a case-insensitive manner. Supported values: `'auto'`, `boolean`. **Default**: `'auto'`

<a name="organizeImportsCollation"></a> **organizeImportsCollation** [string] Indicates whether imports should be organized via an "ordinal" (binary) comparison using the numeric value of their code points, or via "unicode" collation (via the [Unicode Collation Algorithm](https://unicode.org/reports/tr10/#Scope)) using rules associated with the locale specified in [organizeImportsCollationLocale](#organizeImportsCollationLocale). Supported values: `'ordinal'`, `'unicode'`. **Default**: `'ordinal'`
<a name="organizeImportsCollation"></a> **organizeImportsCollation** [string] Indicates whether imports should be organized via an "ordinal" (binary) comparison using the numeric value of their code points, or via "unicode" collation (via the [Unicode Collation Algorithm](https://unicode.org/reports/tr10/#Scope)) using rules associated with the locale specified in [organizeImportsLocale](#organizeImportsLocale). Supported values: `'ordinal'`, `'unicode'`. **Default**: `'ordinal'`

<a name="organizeImportsCollationLocale"></a> **organizeImportsCollationLocale** [string] Indicates the locale to use for "unicode" collation. If not specified, the locale `"en"` is used as an invariant for the sake of consistent sorting. Use `"auto"` to use the detected UI locale. This preference is ignored if [organizeImportsCollation](#organizeImportsNumericCollation) is not `"unicode"`. **Default**: `'en'`
<a name="organizeImportsLocale"></a> **organizeImportsLocale** [string] Indicates the locale to use for "unicode" collation. If not specified, the locale `"en"` is used as an invariant for the sake of consistent sorting. Use `"auto"` to use the detected UI locale. This preference is ignored if [organizeImportsCollation](#organizeImportsNumericCollation) is not `"unicode"`. **Default**: `'en'`

<a name="organizeImportsNumericCollation"></a> **organizeImportsNumericCollation** [boolean] Indicates whether numeric collation should be used for digit sequences in strings. When `true`, will collate strings such that `a1z < a2z < a100z`. When `false`, will collate strings such that `a1z < a100z < a2z`. This preference is ignored if [organizeImportsCollation](#organizeImportsCollation) is not `"unicode"`. **Default**: `false`

**organizeImportsAccentCollation** [boolean] Indicates whether accents and other diacritic marks are considered unequal for the purpose of collation. When `true`, characters with accents and other diacritics will be collated in the order defined by the locale specified in [organizeImportsCollationLocale](#organizeImportsCollationLocale). This preference is ignored if [organizeImportsCollation](#organizeImportsCollation) is not `"unicode"`. **Default**: `true`
**organizeImportsAccentCollation** [boolean] Indicates whether accents and other diacritic marks are considered unequal for the purpose of collation. When `true`, characters with accents and other diacritics will be collated in the order defined by the locale specified in [organizeImportsLocale](#organizeImportsLocale). This preference is ignored if [organizeImportsCollation](#organizeImportsCollation) is not `"unicode"`. **Default**: `true`

**organizeImportsCaseFirst** [string or boolean] Indicates whether upper case or lower case should sort first. When `false`, the default order for the locale specified in [organizeImportsLocale](#organizeImportsLocale) is used. This preference is ignored if [organizeImportsCollation](#organizeImportsCollation) is not `"unicode"`. This preference is also ignored if we are using case-insensitive sorting, which occurs when [organizeImportsIgnoreCase](#organizeImportsIgnoreCase) is `true`, or if [organizeImportsIgnoreCase](#organizeImportsIgnoreCase) is `"auto"` and the auto-detected case sensitivity is determined to be case-insensitive. Supported values: `'upper'`, `'lower'`, `false`. **Default**: `false`

**organizeImportsTypeOrder** ["last" | "inline" | "first"] Indicates where named type-only imports should sort. "inline" sorts named imports without regard to if the import is type-only. **Default**: `"last"`

**organizeImportsCaseFirst** [string or boolean] Indicates whether upper case or lower case should sort first. When `false`, the default order for the locale specified in [organizeImportsCollationLocale](#organizeImportsCollationLocale) is used. This preference is ignored if [organizeImportsCollation](#organizeImportsCollation) is not `"unicode"`. This preference is also ignored if we are using case-insensitive sorting, which occurs when [organizeImportsIgnoreCase](#organizeImportsIgnoreCase) is `true`, or if [organizeImportsIgnoreCase](#organizeImportsIgnoreCase) is `"auto"` and the auto-detected case sensitivity is determined to be case-insensitive. Supported values: `'upper'`, `'lower'`, `false`. **Default**: `false`
**preferTypeOnlyAutoImports** [boolean] **Default**: `false`

**providePrefixAndSuffixTextForRename** [boolean] **Default**: `true`

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
"size-limit": "^11.2.0",
"source-map-support": "^0.5.21",
"tempy": "^3.1.0",
"typescript": "^5.3.3",
"typescript": "^5.9.2",
"typescript-eslint": "^8.39.0",
"vitest": "^1.6.1",
"vscode-jsonrpc": "^8.2.1",
Expand Down
6 changes: 5 additions & 1 deletion src/features/fileConfigurationManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ const DEFAULT_TSSERVER_PREFERENCES: Required<ts.server.protocol.UserPreferences>
allowRenameOfImportPath: true,
allowTextChangesInNewFiles: true,
autoImportFileExcludePatterns: [],
autoImportSpecifierExcludeRegexes: [],
disableLineTextInReferences: true,
disableSuggestions: false,
displayPartsForJSDoc: true,
Expand All @@ -53,12 +54,15 @@ const DEFAULT_TSSERVER_PREFERENCES: Required<ts.server.protocol.UserPreferences>
interactiveInlayHints: true,
jsxAttributeCompletionStyle: 'auto',
lazyConfiguredProjectsFromExternalProject: false,
maximumHoverLength: 500,
organizeImportsAccentCollation: true,
organizeImportsCaseFirst: false,
organizeImportsCollation: 'ordinal',
organizeImportsCollationLocale: 'en',
organizeImportsLocale: 'en',
organizeImportsIgnoreCase: 'auto',
organizeImportsNumericCollation: false,
organizeImportsTypeOrder: 'last',
preferTypeOnlyAutoImports: false,
providePrefixAndSuffixTextForRename: true,
provideRefactorNotApplicableReason: true,
quotePreference: 'auto',
Expand Down
3 changes: 3 additions & 0 deletions src/features/inlay-hints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,11 @@ function areInlayHintsEnabledForFile(fileConfigurationManager: FileConfiguration

function fromProtocolInlayHintKind(kind: ts.server.protocol.InlayHintKind): lsp.InlayHintKind | undefined {
switch (kind) {
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
case 'Parameter': return lsp.InlayHintKind.Parameter;
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
case 'Type': return lsp.InlayHintKind.Type;
// eslint-disable-next-line @typescript-eslint/no-unsafe-enum-comparison
case 'Enum': return undefined;
default: return undefined;
}
Expand Down
2 changes: 1 addition & 1 deletion src/lsp-server.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1583,7 +1583,7 @@ accessSync('t');`,
edits: [
{
// Prefers import that is declared in package.json.
newText: 'import { existsSync } from "fs-extra";\n\n',
newText: 'import { existsSync } from "fs";\n\n',
range: {
end: {
character: 0,
Expand Down
73 changes: 46 additions & 27 deletions src/ts-protocol.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,27 +107,43 @@ export enum HighlightSpanKind {
}

export enum JsxEmit {
None = 'None',
Preserve = 'Preserve',
ReactNative = 'ReactNative',
React = 'React'
None = 'none',
Preserve = 'preserve',
ReactNative = 'react-native',
React = 'react',
ReactJSX = 'react-jsx',
ReactJSXDev = 'react-jsxdev',
}

export enum ModuleKind {
None = 'None',
CommonJS = 'CommonJS',
AMD = 'AMD',
UMD = 'UMD',
System = 'System',
ES6 = 'ES6',
ES2015 = 'ES2015',
ESNext = 'ESNext'
None = 'none',
CommonJS = 'commonjs',
AMD = 'amd',
UMD = 'umd',
System = 'system',
ES6 = 'es6',
ES2015 = 'es2015',
ES2020 = 'es2020',
ES2022 = 'es2022',
ESNext = 'esnext',
Node16 = 'node16',
Node18 = 'node18',
Node20 = 'node20',
NodeNext = 'nodenext',
Preserve = 'preserve',
}

export enum ModuleResolutionKind {
Classic = 'Classic',
Node = 'Node',
// Bundler = 'Bundler'
Classic = 'classic',
/** @deprecated Renamed to `Node10` */
Node = 'node',
/** @deprecated Renamed to `Node10` */
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
NodeJs = 'node',
Node10 = 'node10',
Node16 = 'node16',
NodeNext = 'nodenext',
Bundler = 'bundler',
}

export enum SemicolonPreference {
Expand Down Expand Up @@ -205,18 +221,21 @@ export enum ScriptElementKindModifier {
}

export enum ScriptTarget {
ES3 = 'ES3',
ES5 = 'ES5',
ES6 = 'ES6',
ES2015 = 'ES2015',
ES2016 = 'ES2016',
ES2017 = 'ES2017',
ES2018 = 'ES2018',
ES2019 = 'ES2019',
ES2020 = 'ES2020',
ES2021 = 'ES2021',
ES2022 = 'ES2022',
ESNext = 'ESNext'
ES3 = 'es3',
ES5 = 'es5',
ES6 = 'es6',
ES2015 = 'es2015',
ES2016 = 'es2016',
ES2017 = 'es2017',
ES2018 = 'es2018',
ES2019 = 'es2019',
ES2020 = 'es2020',
ES2021 = 'es2021',
ES2022 = 'es2022',
ESNext = 'esnext',
JSON = 'json',
// eslint-disable-next-line @typescript-eslint/no-duplicate-enum-values
Latest = 'esnext',
}

export enum SymbolDisplayPartKind {
Expand Down
2 changes: 1 addition & 1 deletion src/tsServer/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ class RequestRouter {
request
.then(result => {
requestStates[serverIndex] = RequestState.Resolved;
const erroredRequest = requestStates.find(state => state.type === RequestState.Type.Errored) as RequestState.Errored | undefined;
const erroredRequest = requestStates.find(state => state.type === RequestState.Type.Errored);
if (erroredRequest) {
// We've gone out of sync
this.delegate.onFatalError(command, erroredRequest.err);
Expand Down
1 change: 1 addition & 0 deletions src/utils/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ export default class API {
public static readonly v490 = API.fromSimpleString('4.9.0');
public static readonly v500 = API.fromSimpleString('5.0.0');
public static readonly v510 = API.fromSimpleString('5.1.0');
public static readonly v540 = API.fromSimpleString('5.4.0');

public static fromVersionString(versionString: string): API {
let version = semver.valid(versionString);
Expand Down
6 changes: 3 additions & 3 deletions src/utils/tsconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,10 @@ export function getInferredProjectCompilerOptions(
workspaceConfig: WorkspaceConfigurationImplicitProjectConfigurationOptions,
): ts.server.protocol.ExternalProjectCompilerOptions {
const projectConfig: ts.server.protocol.ExternalProjectCompilerOptions = {
module: ModuleKind.ESNext,
moduleResolution: ModuleResolutionKind.Node,
module: version.gte(API.v540) ? ModuleKind.Preserve : ModuleKind.ESNext,
moduleResolution: version.gte(API.v540) ? ModuleResolutionKind.Bundler : ModuleResolutionKind.Node,
target: ScriptTarget.ES2022,
jsx: JsxEmit.React,
jsx: JsxEmit.ReactJSX,
};

if (version.gte(API.v500)) {
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2392,10 +2392,10 @@ typescript-eslint@^8.39.0:
"@typescript-eslint/typescript-estree" "8.39.0"
"@typescript-eslint/utils" "8.39.0"

typescript@^5.3.3:
version "5.3.3"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.3.3.tgz#b3ce6ba258e72e6305ba66f5c9b452aaee3ffe37"
integrity sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==
typescript@^5.9.2:
version "5.9.2"
resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.9.2.tgz#d93450cddec5154a2d5cabe3b8102b83316fb2a6"
integrity sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==

ufo@^1.5.4:
version "1.6.1"
Expand Down
Loading