(core) Configure more comprehensive eslint rules for Typescript

Summary:
- Update rules to be more like we've had with tslint
- Switch tsserver plugin to eslint (tsserver makes for a much faster way to lint in editors)
- Apply suggested auto-fixes
- Fix all lint errors and warnings in core/, app/, test/

Test Plan: Some behavior may change subtly (e.g. added missing awaits), relying on existing tests to catch problems.

Reviewers: paulfitz

Reviewed By: paulfitz

Differential Revision: https://phab.getgrist.com/D2785
This commit is contained in:
Dmitry S
2021-04-26 17:54:09 -04:00
parent 91fdef58ac
commit 526b0ad33e
56 changed files with 147 additions and 125 deletions

View File

@@ -35,7 +35,6 @@ declare module "app/client/components/BaseView" {
import {Cursor, CursorPos} from 'app/client/components/Cursor';
import {GristDoc} from 'app/client/components/GristDoc';
import {Disposable} from 'app/client/lib/dispose';
import {KoArray} from "app/client/lib/koArray";
import * as BaseRowModel from "app/client/models/BaseRowModel";
import {DataRowModel} from 'app/client/models/DataRowModel';
import {LazyArrayModel} from "app/client/models/DataTableModel";
@@ -72,10 +71,8 @@ declare module "app/client/components/BaseView" {
}
declare module "app/client/components/RefSelect" {
import {GristDoc, TabContent} from 'app/client/components/GristDoc';
import {Disposable} from 'app/client/lib/dispose';
import {ColumnRec} from "app/client/models/DocModel";
import {DomArg} from 'grainjs';
import {DocModel} from "app/client/models/DocModel";
import {FieldBuilder} from "app/client/widgets/FieldBuilder";
@@ -161,11 +158,11 @@ declare module "app/client/models/BaseRowModel" {
class BaseRowModel extends Disposable {
public id: ko.Computed<number>;
public _index: ko.Observable<number|null>;
public getRowId(): number;
public updateColValues(colValues: ColValues): Promise<void>;
public _table: TableModel;
protected _rowId: number | 'new' | null;
protected _fields: string[];
public getRowId(): number;
public updateColValues(colValues: ColValues): Promise<void>;
}
export = BaseRowModel;
}
@@ -286,10 +283,9 @@ declare module "app/client/models/DataTableModel" {
import * as BaseRowModel from "app/client/models/BaseRowModel";
import {DocModel, TableRec} from "app/client/models/DocModel";
import {TableQuerySets} from 'app/client/models/QuerySet';
import {RowSource, SortedRowSet} from "app/client/models/rowset";
import {SortedRowSet} from "app/client/models/rowset";
import {TableData} from "app/client/models/TableData";
import * as TableModel from "app/client/models/TableModel";
import {CellValue} from "app/common/DocActions";
namespace DataTableModel {
interface LazyArrayModel<T> extends KoArray<T | null> {