Skip to content

Commit 7d38048

Browse files
committed
Fix crash with TS 5.5.x
Resolves #2789
1 parent c3842c1 commit 7d38048

File tree

12 files changed

+38
-23
lines changed

12 files changed

+38
-23
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ title: Changelog
44

55
## Unreleased
66

7+
### Bug Fixes
8+
9+
- Fix crash with TypeScript 5.5.x, #2789.
10+
711
## v0.27.1 (2024-11-28)
812

913
### Bug Fixes

eslint.config.mjs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ const config = {
102102
"@typescript-eslint/no-non-null-assertion": "off",
103103
"@typescript-eslint/explicit-module-boundary-types": "off",
104104

105+
// https://astexplorer.net/#/gist/82d22728cda8283bf38e956640420af4/4d5e6fbcbceed981f9897a859322ade5f1cb86ee
105106
"no-restricted-syntax": [
106107
"warn",
107108
{
@@ -114,6 +115,16 @@ const config = {
114115
message:
115116
"Use type.getSymbol() instead, Type.symbol is not properly typed.",
116117
},
118+
{
119+
selector:
120+
"ImportDeclaration[source.value=typescript] ImportNamespaceSpecifier",
121+
message: "TS before 5.7 does not have non-default exports.",
122+
},
123+
{
124+
selector:
125+
"ImportDeclaration[source.value=typescript] ImportDeclaration",
126+
message: "TS before 5.7 does not have non-default exports.",
127+
},
117128
],
118129

119130
"no-fallthrough": ["error", { allowEmptyCase: true }],

package-lock.json

Lines changed: 13 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
"node": ">= 18"
2626
},
2727
"dependencies": {
28-
"@gerrit0/mini-shiki": "^1.23.2",
28+
"@gerrit0/mini-shiki": "^1.24.0",
2929
"lunr": "^2.3.9",
3030
"markdown-it": "^14.1.0",
3131
"minimatch": "^9.0.5",

src/lib/converter/comments/lineLexer.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type * as ts from "typescript";
1+
import type ts from "typescript";
22
import { type Token, TokenSyntaxKind } from "./lexer.js";
33

44
export function* lexLineComments(

src/lib/models/reflections/declaration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type * as ts from "typescript";
1+
import type ts from "typescript";
22
import { type ReferenceType, ReflectionType, type SomeType } from "../types.js";
33
import { type TraverseCallback, TraverseProperty } from "./abstract.js";
44
import { ContainerReflection } from "./container.js";

src/lib/models/reflections/project.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type * as ts from "typescript";
1+
import type ts from "typescript";
22
import { type Reflection, TraverseProperty } from "./abstract.js";
33
import { ContainerReflection } from "./container.js";
44
import { ReferenceReflection } from "./reference.js";

src/lib/models/types.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import * as ts from "typescript";
1+
import ts from "typescript";
22
import type { Context } from "../converter/index.js";
33
import type { Reflection } from "./reflections/abstract.js";
44
import type { DeclarationReflection } from "./reflections/declaration.js";

src/lib/types/ts-internal/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type * as ts from "typescript";
1+
import type ts from "typescript";
22

33
/**
44
* Expose the internal TypeScript APIs that are used by TypeDoc

src/lib/utils/options/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import type * as ts from "typescript";
1+
import type ts from "typescript";
22
import { resolve } from "path";
33
import { ParameterType } from "./declaration.js";
44
import type { NeverIfInternal, OutputSpecification } from "../index.js";
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
import * as ts from "typescript";
1+
import ts from "typescript";
22

33
export const ActionSet: ts.server.ActionSet;

src/test/converter2/issues/gh2552.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,12 @@
66
*/
77

88
// TS 5.5 @import comments
9-
/** @import * as ts from "typescript" */
9+
/** @import ts from "typescript" */
1010

1111
/**
1212
* This is an awesome module.
1313
* @module good-module
1414
*/
1515

16-
/** @import * as ts2 from "typescript" */
16+
/** @import ts2 from "typescript" */
1717
export const something = 1;

0 commit comments

Comments
 (0)