Skip to content

Commit 979b146

Browse files
committed
Fix lint errors
1 parent 5656f35 commit 979b146

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/harness/unittests/organizeImports.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,9 @@ namespace ts {
5656

5757
it("Sort - invalid vs invalid", () => {
5858
assertSortsBefore(
59+
// tslint:disable-next-line no-invalid-template-strings
5960
"import y from `${'lib1'}`;",
61+
// tslint:disable-next-line no-invalid-template-strings
6062
"import x from `${'lib2'}`;");
6163
});
6264

@@ -69,12 +71,14 @@ namespace ts {
6971
it("Sort - non-relative vs invalid", () => {
7072
assertSortsBefore(
7173
`import y from "lib";`,
74+
// tslint:disable-next-line no-invalid-template-strings
7275
"import x from `${'lib'}`;");
7376
});
7477

7578
it("Sort - relative vs invalid", () => {
7679
assertSortsBefore(
7780
`import y from "./lib";`,
81+
// tslint:disable-next-line no-invalid-template-strings
7882
"import x from `${'lib'}`;");
7983
});
8084

@@ -357,7 +361,7 @@ F2();
357361

358362
assert.equal(node1.kind, node2.kind);
359363

360-
switch(node1.kind) {
364+
switch (node1.kind) {
361365
case SyntaxKind.ImportDeclaration:
362366
const decl1 = node1 as ImportDeclaration;
363367
const decl2 = node2 as ImportDeclaration;
@@ -369,6 +373,7 @@ F2();
369373
const clause2 = node2 as ImportClause;
370374
assertEqual(clause1.name, clause2.name);
371375
assertEqual(clause1.namedBindings, clause2.namedBindings);
376+
break;
372377
case SyntaxKind.NamespaceImport:
373378
const nsi1 = node1 as NamespaceImport;
374379
const nsi2 = node2 as NamespaceImport;

src/services/services.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -2368,7 +2368,7 @@ namespace ts {
23682368
const name = getExternalModuleName(specifier);
23692369
if (name) {
23702370
const isRelative = isExternalModuleNameRelative(name);
2371-
return { importDeclaration, name, kind: isRelative ? ModuleNameKind.Relative : ModuleNameKind.NonRelative }
2371+
return { importDeclaration, name, kind: isRelative ? ModuleNameKind.Relative : ModuleNameKind.NonRelative };
23722372
}
23732373

23742374
return { importDeclaration, name: specifier.getText(), kind: ModuleNameKind.Invalid };
@@ -2505,7 +2505,7 @@ namespace ts {
25052505

25062506
const sortedImportSpecifiers = stableSort(newImportSpecifiers, (s1, s2) => {
25072507
const nameComparison = compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name);
2508-
return nameComparison != Comparison.EqualTo
2508+
return nameComparison !== Comparison.EqualTo
25092509
? nameComparison
25102510
: compareIdentifiers(s1.name, s2.name);
25112511
});

0 commit comments

Comments
 (0)