From 12914eacc5300c5cd9a0aa44df4bef85591288be Mon Sep 17 00:00:00 2001 From: Andy Hanson Date: Thu, 26 May 2016 09:01:56 -0700 Subject: [PATCH] Fix lint errors --- src/harness/fourslash.ts | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/src/harness/fourslash.ts b/src/harness/fourslash.ts index c33c9107ad7..53aaa8c7d6e 100644 --- a/src/harness/fourslash.ts +++ b/src/harness/fourslash.ts @@ -1963,7 +1963,7 @@ namespace FourSlash { let items = this.languageService.getNavigationBarItems(this.activeFile.fileName); items = this.simplifyNavigationBar(items); if (JSON.stringify(items) !== JSON.stringify(json)) { - this.raiseError(`verifyNavigationBar failed - expected: ${JSON.stringify(json, undefined, 2)}, got: ${JSON.stringify(items, undefined, 2)}`) + this.raiseError(`verifyNavigationBar failed - expected: ${JSON.stringify(json, undefined, 2)}, got: ${JSON.stringify(items, undefined, 2)}`); } } @@ -1971,30 +1971,35 @@ namespace FourSlash { private simplifyNavigationBar(items: ts.NavigationBarItem[]): any { return items.map(item => { item = ts.clone(item); - if (item.kindModifiers === "") + if (item.kindModifiers === "") { delete item.kindModifiers; + } + // We won't check this. delete item.spans; item.childItems = item.childItems.map(child => { child = ts.clone(child); - ts.Debug.assert(child.childItems.length === 0); - ts.Debug.assert(child.indent === 0); - ts.Debug.assert(child.bolded === false); - ts.Debug.assert(child.grayed === false); - delete child.childItems; - delete child.indent; - delete child.bolded; - delete child.grayed; delete child.spans; - if (child.kindModifiers === "") + ts.Debug.assert(child.childItems.length === 0); + delete child.childItems; + ts.Debug.assert(child.indent === 0); + delete child.indent; + ts.Debug.assert(child.bolded === false); + delete child.bolded; + ts.Debug.assert(child.grayed === false); + delete child.grayed; + if (child.kindModifiers === "") { delete child.kindModifiers; + } return child; }); - if (item.bolded === false) + if (item.bolded === false) { delete item.bolded; - if (item.grayed === false) + } + if (item.grayed === false) { delete item.grayed; + } return item; - }) + }); } public printNavigationItems(searchValue: string) {