Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Fix error in test
  • Loading branch information
jakebailey committed Feb 18, 2025
commit 32ca1b741816f30fddeab64d86b8d90e5181f327
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
esm.d.mts(1,1): error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.
index.d.ts(1,1): error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.


Expand Down Expand Up @@ -68,9 +67,7 @@ index.d.ts(1,1): error TS1046: Top-level declarations in .d.ts files must start
export = foo;


==== esm.d.mts (1 errors) ====
const foo = 1234;
~~~~~
!!! error TS1046: Top-level declarations in .d.ts files must start with either a 'declare' or 'export' modifier.
==== esm.d.mts (0 errors) ====
declare const foo = 1234;
export default foo;

Original file line number Diff line number Diff line change
Expand Up @@ -114,9 +114,9 @@ export = foo;


=== esm.d.mts ===
const foo = 1234;
>foo : Symbol(foo, Decl(esm.d.mts, 0, 5))
declare const foo = 1234;
>foo : Symbol(foo, Decl(esm.d.mts, 0, 13))

export default foo;
>foo : Symbol(foo, Decl(esm.d.mts, 0, 5))
>foo : Symbol(foo, Decl(esm.d.mts, 0, 13))

Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ export = foo;


=== esm.d.mts ===
const foo = 1234;
declare const foo = 1234;
>foo : 1234
> : ^^^^
>1234 : 1234
Expand Down
2 changes: 1 addition & 1 deletion tests/cases/compiler/erasableSyntaxOnlyDeclaration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,5 +69,5 @@ export = foo;


// @filename: esm.d.mts
const foo = 1234;
declare const foo = 1234;
export default foo;