Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion src/compiler/moduleSpecifiers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1107,7 +1107,7 @@ function tryGetModuleNameFromExportsOrImports(
else if (typeof exports === "object" && exports !== null) { // eslint-disable-line no-restricted-syntax
// conditional mapping
for (const key of getOwnKeys(exports as MapLike<unknown>)) {
if (key === "default" || conditions.indexOf(key) >= 0 || isApplicableVersionedTypesKey(conditions, key)) {
if (key === "default" || conditions.includes(key) || isApplicableVersionedTypesKey(conditions, key)) {
const subTarget = (exports as MapLike<unknown>)[key];
const result = tryGetModuleNameFromExportsOrImports(options, host, targetFilePath, packageDirectory, packageName, subTarget, conditions, mode, isImports, preferTsExtension);
if (result) {
Expand Down
6 changes: 3 additions & 3 deletions src/services/codefixes/importFixes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -607,7 +607,7 @@ function createImportAdderWorker(sourceFile: SourceFile | FutureSourceFile, prog
// has named bindings
d.importClause?.namedBindings &&
// is not being fully removed
emptyImportDeclarations.indexOf(d) === -1 &&
!emptyImportDeclarations.includes(d) &&
// is not gaining named imports
!addToExisting.get(d.importClause)?.namedImports &&
// all named imports are being removed
Expand All @@ -632,8 +632,8 @@ function createImportAdderWorker(sourceFile: SourceFile | FutureSourceFile, prog
const importDeclaration = findAncestor(declaration, isImportDeclaration);
if (
importDeclaration &&
emptyImportDeclarations.indexOf(importDeclaration) === -1 &&
namedBindingsToDelete.indexOf(importDeclaration) === -1
!emptyImportDeclarations.includes(importDeclaration) &&
!namedBindingsToDelete.includes(importDeclaration)
) {
if (declaration.kind === SyntaxKind.ImportClause) {
changeTracker.delete(sourceFile, declaration.name!);
Expand Down