Merge pull request #384 from gristlabs/eslint

Adding basic eslint support.
This commit is contained in:
jarek
2023-01-04 16:36:55 +01:00
committed by GitHub
41 changed files with 1080 additions and 102 deletions

View File

@@ -395,7 +395,10 @@ export class ActionLog extends dispose.Disposable implements IDomComponent {
const newName = tableRename[1];
if (!newName) {
// TODO - find a better way to send informative notifications.
gristNotify(t("Table {{tableId}} was subsequently removed in action #{{actionNum}}", {tableId:tableId, actionNum: action.actionNum}));
gristNotify(t(
"Table {{tableId}} was subsequently removed in action #{{actionNum}}",
{tableId:tableId, actionNum: action.actionNum}
));
return;
}
tableId = newName;
@@ -416,7 +419,10 @@ export class ActionLog extends dispose.Disposable implements IDomComponent {
const newName = columnRename[1];
if (!newName) {
// TODO - find a better way to send informative notifications.
gristNotify(t("Column {{colId}} was subsequently removed in action #{{action.actionNum}}", {colId, actionNum: action.actionNum}));
gristNotify(t(
"Column {{colId}} was subsequently removed in action #{{action.actionNum}}",
{colId, actionNum: action.actionNum}
));
return;
}
colId = newName;

View File

@@ -656,8 +656,9 @@ export class ChartConfig extends GrainJSDisposable {
),
dom.domComputed(this._optionsObj.prop('errorBars'), (value: ChartOptions["errorBars"]) =>
value === 'symmetric' ? cssRowHelp(t("Each Y series is followed by a series for the length of error bars.")) :
value === 'separate' ? cssRowHelp(t("Each Y series is followed by two series, for top and bottom error bars.")) :
null
value === 'separate' ? cssRowHelp(t("Each Y series is followed by two series, for " +
"top and bottom error bars."))
: null
),
]),

View File

@@ -160,7 +160,10 @@ export class DataTables extends Disposable {
function doRemove() {
return docModel.docData.sendAction(['RemoveTable', r.tableId()]);
}
confirmModal(t("Delete {{formattedTableName}} data, and remove it from all pages?", {formattedTableName : r.formattedTableName()}), 'Delete', doRemove);
confirmModal(t(
"Delete {{formattedTableName}} data, and remove it from all pages?",
{formattedTableName : r.formattedTableName()}
), 'Delete', doRemove);
}
private _tableRows(table: TableRec) {

View File

@@ -149,7 +149,9 @@ export class DocumentUsage extends Disposable {
return dom.domComputed((use) => {
const isAccessDenied = use(this._isAccessDenied);
if (isAccessDenied === null) { return null; }
if (isAccessDenied) { return buildMessage(t("Usage statistics are only available to users with full access to the document data.")); }
if (isAccessDenied) {
return buildMessage(t("Usage statistics are only available to users with full access to the document data."));
}
const org = use(this._currentOrg);
const product = use(this._currentProduct);
@@ -239,7 +241,7 @@ export function buildUpgradeMessage(
) {
if (!canUpgrade) { return t("Contact the site owner to upgrade the plan to raise limits."); }
const upgradeLinkText = t("start your 30-day free trial of the Pro plan.")
const upgradeLinkText = t("start your 30-day free trial of the Pro plan.");
// TODO i18next
return [
variant === 'short' ? null : t("For higher limits, "),

View File

@@ -986,7 +986,7 @@ export class GristDoc extends DisposableWithEvents {
* Renames table. Method exposed primarily for tests.
*/
public async renameTable(tableId: string, newTableName: string) {
const tableRec = this.docModel.visibleTables.all().find(t => t.tableId.peek() === tableId);
const tableRec = this.docModel.visibleTables.all().find(tb => tb.tableId.peek() === tableId);
if (!tableRec) {
throw new UserError(`No table with id ${tableId}`);
}

View File

@@ -380,7 +380,7 @@ export class Importer extends DisposableWithEvents {
}
private _getHiddenTableIds(): string[] {
return this._sourceInfoArray.get().map((t: SourceInfo) => t.hiddenTableId);
return this._sourceInfoArray.get().map((si: SourceInfo) => si.hiddenTableId);
}
private async _reImport(upload: UploadResult) {