diff --git a/.eslintignore b/.eslintignore index f8d1587bb..643cf9d54 100644 --- a/.eslintignore +++ b/.eslintignore @@ -101,11 +101,7 @@ src/Explorer/Tabs/DocumentsTab.test.ts src/Explorer/Tabs/DocumentsTab.ts src/Explorer/Tabs/GraphTab.ts src/Explorer/Tabs/MongoDocumentsTab.ts -src/Explorer/Tabs/NotebookV2Tab.ts -src/Explorer/Tabs/ScriptTabBase.ts -src/Explorer/Tabs/TabComponents.ts src/Explorer/Tabs/TabsBase.ts -src/Explorer/Tabs/TriggerTab.ts src/Explorer/Tabs/UserDefinedFunctionTab.ts src/Explorer/Tree/AccessibleVerticalList.ts src/Explorer/Tree/Collection.ts diff --git a/src/Explorer/Tabs/NotebookV2Tab.ts b/src/Explorer/Tabs/NotebookV2Tab.ts index 66d894cb3..cdbb87acc 100644 --- a/src/Explorer/Tabs/NotebookV2Tab.ts +++ b/src/Explorer/Tabs/NotebookV2Tab.ts @@ -54,7 +54,7 @@ export default class NotebookTabV2 extends NotebookTabBase { }); } - public onCloseTabButtonClick(): Q.Promise { + public onCloseTabButtonClick(): Q.Promise { const cleanup = () => { this.notebookComponentAdapter.notebookShutdown(); super.onCloseTabButtonClick(); @@ -78,7 +78,7 @@ export default class NotebookTabV2 extends NotebookTabBase { } } - public async reconfigureServiceEndpoints() { + public async reconfigureServiceEndpoints(): Promise { if (!this.notebookComponentAdapter) { return; } @@ -136,7 +136,7 @@ export default class NotebookTabV2 extends NotebookTabBase { ariaLabel: publishLabel, }); - let buttons: CommandButtonComponentProps[] = [ + const buttons: CommandButtonComponentProps[] = [ { iconSrc: SaveIcon, iconAlt: saveLabel, @@ -160,7 +160,7 @@ export default class NotebookTabV2 extends NotebookTabBase { { iconSrc: null, iconAlt: kernelLabel, - onCommandClick: () => {}, + onCommandClick: () => undefined, commandButtonLabel: null, hasPopup: false, disabled: availableKernels.length < 1, @@ -271,7 +271,7 @@ export default class NotebookTabV2 extends NotebookTabBase { { iconSrc: null, iconAlt: null, - onCommandClick: () => {}, + onCommandClick: () => undefined, commandButtonLabel: null, ariaLabel: cellTypeLabel, hasPopup: false, @@ -361,7 +361,7 @@ export default class NotebookTabV2 extends NotebookTabBase { } private onKernelUpdate = async () => { - await this.configureServiceEndpoints(this.notebookComponentAdapter.getCurrentKernelName()).catch((reason) => { + await this.configureServiceEndpoints(this.notebookComponentAdapter.getCurrentKernelName()).catch(() => { /* Erroring is ok here */ }); this.updateNavbarWithTabsButtons(); diff --git a/src/Explorer/Tabs/ScriptTabBase.ts b/src/Explorer/Tabs/ScriptTabBase.ts index 02116a07b..a830f07a4 100644 --- a/src/Explorer/Tabs/ScriptTabBase.ts +++ b/src/Explorer/Tabs/ScriptTabBase.ts @@ -25,11 +25,12 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode public errors: ko.ObservableArray; public statusMessge: ko.Observable; public statusIcon: ko.Observable; - public formFields: ko.ObservableArray>; + public formFields: ko.ObservableArray>; public formIsValid: ko.Computed; public formIsDirty: ko.Computed; public isNew: ko.Observable; // TODO: Remove any. The SDK types for all the script.body are slightly incorrect which makes this REALLY hard to type correct. + // eslint-disable-next-line @typescript-eslint/no-explicit-any public resource: ko.Observable; public isTemplateReady: ko.Observable; protected _partitionKey: DataModels.PartitionKey; @@ -85,7 +86,6 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode this.editorState(ViewModels.ScriptEditorState.exisitingDirtyInvalid); } break; - case ViewModels.ScriptEditorState.exisitingDirtyValid: default: break; } @@ -182,7 +182,7 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode this.editorContent.setBaseline(resource.body); } - public setBaselines() { + public setBaselines(): void { this._setBaselines(); } @@ -194,9 +194,9 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode } public abstract onSaveClick: () => void; - public abstract onUpdateClick: () => Promise; + public abstract onUpdateClick: () => Promise; - public onDiscard = (): Q.Promise => { + public onDiscard = (): Q.Promise => { this.setBaselines(); const original = this.editorContent.getEditableOriginalValue(); const editorModel = this.editor() && this.editor().getModel(); @@ -289,7 +289,7 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode return !!value; } - protected async _createBodyEditor() { + protected async _createBodyEditor(): Promise { const id = this.editorId; const container = document.getElementById(id); const options = { @@ -308,7 +308,7 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode editorModel.onDidChangeContent(this._onBodyContentChange.bind(this)); } - private _onBodyContentChange(e: monaco.editor.IModelContentChangedEvent) { + private _onBodyContentChange() { const editorModel = this.editor().getModel(); this.editorContent(editorModel.getValue()); }