mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-30 10:29:18 -05:00
Fix lint errors
This commit is contained in:
@@ -56,7 +56,9 @@ namespace ts {
|
||||
|
||||
it("Sort - invalid vs invalid", () => {
|
||||
assertSortsBefore(
|
||||
// tslint:disable-next-line no-invalid-template-strings
|
||||
"import y from `${'lib1'}`;",
|
||||
// tslint:disable-next-line no-invalid-template-strings
|
||||
"import x from `${'lib2'}`;");
|
||||
});
|
||||
|
||||
@@ -69,12 +71,14 @@ namespace ts {
|
||||
it("Sort - non-relative vs invalid", () => {
|
||||
assertSortsBefore(
|
||||
`import y from "lib";`,
|
||||
// tslint:disable-next-line no-invalid-template-strings
|
||||
"import x from `${'lib'}`;");
|
||||
});
|
||||
|
||||
it("Sort - relative vs invalid", () => {
|
||||
assertSortsBefore(
|
||||
`import y from "./lib";`,
|
||||
// tslint:disable-next-line no-invalid-template-strings
|
||||
"import x from `${'lib'}`;");
|
||||
});
|
||||
|
||||
@@ -357,7 +361,7 @@ F2();
|
||||
|
||||
assert.equal(node1.kind, node2.kind);
|
||||
|
||||
switch(node1.kind) {
|
||||
switch (node1.kind) {
|
||||
case SyntaxKind.ImportDeclaration:
|
||||
const decl1 = node1 as ImportDeclaration;
|
||||
const decl2 = node2 as ImportDeclaration;
|
||||
@@ -369,6 +373,7 @@ F2();
|
||||
const clause2 = node2 as ImportClause;
|
||||
assertEqual(clause1.name, clause2.name);
|
||||
assertEqual(clause1.namedBindings, clause2.namedBindings);
|
||||
break;
|
||||
case SyntaxKind.NamespaceImport:
|
||||
const nsi1 = node1 as NamespaceImport;
|
||||
const nsi2 = node2 as NamespaceImport;
|
||||
|
||||
@@ -2368,7 +2368,7 @@ namespace ts {
|
||||
const name = getExternalModuleName(specifier);
|
||||
if (name) {
|
||||
const isRelative = isExternalModuleNameRelative(name);
|
||||
return { importDeclaration, name, kind: isRelative ? ModuleNameKind.Relative : ModuleNameKind.NonRelative }
|
||||
return { importDeclaration, name, kind: isRelative ? ModuleNameKind.Relative : ModuleNameKind.NonRelative };
|
||||
}
|
||||
|
||||
return { importDeclaration, name: specifier.getText(), kind: ModuleNameKind.Invalid };
|
||||
@@ -2505,7 +2505,7 @@ namespace ts {
|
||||
|
||||
const sortedImportSpecifiers = stableSort(newImportSpecifiers, (s1, s2) => {
|
||||
const nameComparison = compareIdentifiers(s1.propertyName || s1.name, s2.propertyName || s2.name);
|
||||
return nameComparison != Comparison.EqualTo
|
||||
return nameComparison !== Comparison.EqualTo
|
||||
? nameComparison
|
||||
: compareIdentifiers(s1.name, s2.name);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user