mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2025-12-19 17:01:13 +00:00
fixed eslint of ScriptTabBase and NotebookV2Tab
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -54,7 +54,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
|
||||
});
|
||||
}
|
||||
|
||||
public onCloseTabButtonClick(): Q.Promise<any> {
|
||||
public onCloseTabButtonClick(): Q.Promise<void> {
|
||||
const cleanup = () => {
|
||||
this.notebookComponentAdapter.notebookShutdown();
|
||||
super.onCloseTabButtonClick();
|
||||
@@ -78,7 +78,7 @@ export default class NotebookTabV2 extends NotebookTabBase {
|
||||
}
|
||||
}
|
||||
|
||||
public async reconfigureServiceEndpoints() {
|
||||
public async reconfigureServiceEndpoints(): Promise<void> {
|
||||
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();
|
||||
|
||||
@@ -25,11 +25,12 @@ export default abstract class ScriptTabBase extends TabsBase implements ViewMode
|
||||
public errors: ko.ObservableArray<ViewModels.QueryError>;
|
||||
public statusMessge: ko.Observable<string>;
|
||||
public statusIcon: ko.Observable<string>;
|
||||
public formFields: ko.ObservableArray<ViewModels.Editable<any>>;
|
||||
public formFields: ko.ObservableArray<ViewModels.Editable<unknown>>;
|
||||
public formIsValid: ko.Computed<boolean>;
|
||||
public formIsDirty: ko.Computed<boolean>;
|
||||
public isNew: ko.Observable<boolean>;
|
||||
// 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<any>;
|
||||
public isTemplateReady: ko.Observable<boolean>;
|
||||
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<any>;
|
||||
public abstract onUpdateClick: () => Promise<void>;
|
||||
|
||||
public onDiscard = (): Q.Promise<any> => {
|
||||
public onDiscard = (): Q.Promise<void> => {
|
||||
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<void> {
|
||||
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());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user