Skip to content

Commit

Permalink
Fix crash with TS 5.5.x
Browse files Browse the repository at this point in the history
Resolves #2789
  • Loading branch information
Gerrit0 committed Nov 29, 2024
1 parent c3842c1 commit 7d38048
Show file tree
Hide file tree
Showing 12 changed files with 38 additions and 23 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ title: Changelog

## Unreleased

### Bug Fixes

- Fix crash with TypeScript 5.5.x, #2789.

## v0.27.1 (2024-11-28)

### Bug Fixes
Expand Down
11 changes: 11 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@ const config = {
"@typescript-eslint/no-non-null-assertion": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",

// https://astexplorer.net/#/gist/82d22728cda8283bf38e956640420af4/4d5e6fbcbceed981f9897a859322ade5f1cb86ee
"no-restricted-syntax": [
"warn",
{
Expand All @@ -114,6 +115,16 @@ const config = {
message:
"Use type.getSymbol() instead, Type.symbol is not properly typed.",
},
{
selector:
"ImportDeclaration[source.value=typescript] ImportNamespaceSpecifier",
message: "TS before 5.7 does not have non-default exports.",
},
{
selector:
"ImportDeclaration[source.value=typescript] ImportDeclaration",
message: "TS before 5.7 does not have non-default exports.",
},
],

"no-fallthrough": ["error", { allowEmptyCase: true }],
Expand Down
26 changes: 13 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"node": ">= 18"
},
"dependencies": {
"@gerrit0/mini-shiki": "^1.23.2",
"@gerrit0/mini-shiki": "^1.24.0",
"lunr": "^2.3.9",
"markdown-it": "^14.1.0",
"minimatch": "^9.0.5",
Expand Down
2 changes: 1 addition & 1 deletion src/lib/converter/comments/lineLexer.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as ts from "typescript";
import type ts from "typescript";
import { type Token, TokenSyntaxKind } from "./lexer.js";

export function* lexLineComments(
Expand Down
2 changes: 1 addition & 1 deletion src/lib/models/reflections/declaration.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as ts from "typescript";
import type ts from "typescript";
import { type ReferenceType, ReflectionType, type SomeType } from "../types.js";
import { type TraverseCallback, TraverseProperty } from "./abstract.js";
import { ContainerReflection } from "./container.js";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/models/reflections/project.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as ts from "typescript";
import type ts from "typescript";
import { type Reflection, TraverseProperty } from "./abstract.js";
import { ContainerReflection } from "./container.js";
import { ReferenceReflection } from "./reference.js";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/models/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import * as ts from "typescript";
import ts from "typescript";
import type { Context } from "../converter/index.js";
import type { Reflection } from "./reflections/abstract.js";
import type { DeclarationReflection } from "./reflections/declaration.js";
Expand Down
2 changes: 1 addition & 1 deletion src/lib/types/ts-internal/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as ts from "typescript";
import type ts from "typescript";

/**
* Expose the internal TypeScript APIs that are used by TypeDoc
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/options/options.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type * as ts from "typescript";
import type ts from "typescript";
import { resolve } from "path";
import { ParameterType } from "./declaration.js";
import type { NeverIfInternal, OutputSpecification } from "../index.js";
Expand Down
2 changes: 1 addition & 1 deletion src/test/converter/declaration/external.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import * as ts from "typescript";
import ts from "typescript";

export const ActionSet: ts.server.ActionSet;
4 changes: 2 additions & 2 deletions src/test/converter2/issues/gh2552.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
*/

// TS 5.5 @import comments
/** @import * as ts from "typescript" */
/** @import ts from "typescript" */

/**
* This is an awesome module.
* @module good-module
*/

/** @import * as ts2 from "typescript" */
/** @import ts2 from "typescript" */
export const something = 1;

0 comments on commit 7d38048

Please sign in to comment.