Skip to content

Commit 5364494

Browse files
authored
mark the ImportAssertions as deprecated (#57012)
1 parent 744f77a commit 5364494

File tree

3 files changed

+14
-7
lines changed

3 files changed

+14
-7
lines changed

src/harness/fourslashInterfaceImpl.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1043,6 +1043,12 @@ export namespace Completion {
10431043
kindModifiers: "declare",
10441044
sortText: SortText.GlobalsOrKeywords,
10451045
});
1046+
const deprecatedInterfaceEntry = (name: string): ExpectedCompletionEntryObject => ({
1047+
name,
1048+
kind: "interface",
1049+
kindModifiers: "deprecated,declare",
1050+
sortText: "z15" as SortText,
1051+
});
10461052
const typeEntry = (name: string): ExpectedCompletionEntryObject => ({
10471053
name,
10481054
kind: "type",
@@ -1128,7 +1134,7 @@ export namespace Completion {
11281134
interfaceEntry("TemplateStringsArray"),
11291135
interfaceEntry("ImportMeta"),
11301136
interfaceEntry("ImportCallOptions"),
1131-
interfaceEntry("ImportAssertions"),
1137+
deprecatedInterfaceEntry("ImportAssertions"),
11321138
interfaceEntry("ImportAttributes"),
11331139
varEntry("Math"),
11341140
varEntry("Date"),

src/lib/es5.d.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,7 @@ interface ImportCallOptions {
626626

627627
/**
628628
* The type for the `assert` property of the optional second argument to `import()`.
629+
* @deprecated
629630
*/
630631
interface ImportAssertions {
631632
[key: string]: string;

tests/baselines/reference/tsserver/fourslashServer/autoImportProvider_namespaceSameNameAsIntrinsic.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -584,12 +584,6 @@ Info seq [hh:mm:ss:mss] response:
584584
"kindModifiers": "declare",
585585
"sortText": "15"
586586
},
587-
{
588-
"name": "ImportAssertions",
589-
"kind": "interface",
590-
"kindModifiers": "declare",
591-
"sortText": "15"
592-
},
593587
{
594588
"name": "ImportAttributes",
595589
"kind": "interface",
@@ -1161,6 +1155,12 @@ Info seq [hh:mm:ss:mss] response:
11611155
"fileName": "/node_modules/fp-ts/index.d.ts",
11621156
"isPackageJsonImport": true
11631157
}
1158+
},
1159+
{
1160+
"name": "ImportAssertions",
1161+
"kind": "interface",
1162+
"kindModifiers": "deprecated,declare",
1163+
"sortText": "z15"
11641164
}
11651165
]
11661166
}

0 commit comments

Comments
 (0)