Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
1d14a5b
Add support for `import defer` proposal
ryzokuken Jul 8, 2024
7136718
Update AST to unify `type` with other modifiers
nicolo-ribaudo Dec 19, 2024
6967224
Add test for comments around `defer`
nicolo-ribaudo Dec 19, 2024
2346fa5
Remove unnecessary backwards compat check
nicolo-ribaudo Jan 16, 2025
e3a1a18
Add support for `import.defer(...)`
nicolo-ribaudo Jan 16, 2025
c3bcd0b
Also support `module: NodeNext`
nicolo-ribaudo Jan 17, 2025
8d4fd08
`aren't` -> `are not`
nicolo-ribaudo Jan 17, 2025
7cdc422
ImportPhaseModifier -> ImportPhaseModifierSyntaxKind
nicolo-ribaudo Jan 17, 2025
994ec08
Move import clause checks to checker.ts
nicolo-ribaudo Jan 17, 2025
95183c4
Report `'(' expected` for import.defer
nicolo-ribaudo Jan 17, 2025
33309e8
Make meta property error localizable
nicolo-ribaudo Jan 17, 2025
00adf6e
Move `import.defer` checks to checker.ts
nicolo-ribaudo Jan 17, 2025
cd045bb
Unify tests testing different values of `module`
nicolo-ribaudo Jan 17, 2025
fc0908f
Move `errorType` for `import.defer` handling
nicolo-ribaudo Jan 17, 2025
dec1011
Do not consider `import.defer` in `import.defer(...)` as an expression
nicolo-ribaudo Jan 17, 2025
8d2451a
fmt
nicolo-ribaudo Jan 17, 2025
c485777
Sort tokens alphabetically
nicolo-ribaudo Jan 17, 2025
706bb58
Remove unused baselines
nicolo-ribaudo Jan 20, 2025
bfbcc3f
Properly resolve specifiers in `import.defer(...)`
nicolo-ribaudo Jan 20, 2025
bad45a3
rbuckton review
nicolo-ribaudo Feb 5, 2025
5f54ced
Add test for jsdoc (unsupported)
nicolo-ribaudo Jun 5, 2025
1e445bf
Strip `defer` from dts
nicolo-ribaudo Jun 5, 2025
1886e24
Use `LastKeyword` for `LastContextualKeyword`
nicolo-ribaudo Jun 5, 2025
ffcfd9a
Add test for `typeof import.defer` (unsupported)
nicolo-ribaudo Jun 5, 2025
b352c0d
Drop support for `nodenext`, and allow when `preserve`
nicolo-ribaudo Jun 5, 2025
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
Prev Previous commit
Next Next commit
Add test for jsdoc (unsupported)
  • Loading branch information
nicolo-ribaudo committed Jun 5, 2025
commit 5f54cedb4b2d4cdd9c2736bbf490d9f5c5c43112
21 changes: 21 additions & 0 deletions tests/baselines/reference/importDeferJsdoc.errors.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/foo.js(2,18): error TS1005: 'from' expected.
/foo.js(6,12): error TS2503: Cannot find namespace 'ns'.


==== /types.ts (0 errors) ====
export type X = 1;

==== /foo.js (2 errors) ====
/**
* @import defer * as ns from "./types"
~
!!! error TS1005: 'from' expected.
*/

/**
* @type { ns.X }
~~
!!! error TS2503: Cannot find namespace 'ns'.
*/
let a = 2;

28 changes: 28 additions & 0 deletions tests/baselines/reference/importDeferJsdoc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
//// [tests/cases/conformance/jsdoc/importDeferJsdoc.ts] ////

//// [types.ts]
export type X = 1;

//// [foo.js]
/**
* @import defer * as ns from "./types"
*/

/**
* @type { ns.X }
*/
let a = 2;




//// [types.d.ts]
export type X = 1;
//// [foo.d.ts]
/**
* @import defer * as ns from "./types"
*/
/**
* @type { ns.X }
*/
declare let a: ns.X;
17 changes: 17 additions & 0 deletions tests/baselines/reference/importDeferJsdoc.symbols
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
//// [tests/cases/conformance/jsdoc/importDeferJsdoc.ts] ////

=== /types.ts ===
export type X = 1;
>X : Symbol(X, Decl(types.ts, 0, 0))

=== /foo.js ===
/**
* @import defer * as ns from "./types"
*/

/**
* @type { ns.X }
*/
let a = 2;
>a : Symbol(a, Decl(foo.js, 7, 3))

21 changes: 21 additions & 0 deletions tests/baselines/reference/importDeferJsdoc.types
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
//// [tests/cases/conformance/jsdoc/importDeferJsdoc.ts] ////

=== /types.ts ===
export type X = 1;
>X : 1
> : ^

=== /foo.js ===
/**
* @import defer * as ns from "./types"
*/

/**
* @type { ns.X }
*/
let a = 2;
>a : ns.X
> : ^^^^
>2 : 2
> : ^

17 changes: 17 additions & 0 deletions tests/cases/conformance/jsdoc/importDeferJsdoc.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// @checkJs: true
// @allowJs: true
// @declaration: true
// @emitDeclarationOnly: true

// @filename: /types.ts
export type X = 1;

// @filename: /foo.js
/**
* @import defer * as ns from "./types"
*/

/**
* @type { ns.X }
*/
let a = 2;