Skip to content

Commit

Permalink
chore: fix latent lint errors (#851)
Browse files Browse the repository at this point in the history
  • Loading branch information
seve authored Mar 26, 2024
1 parent 92e478f commit fe6683e
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
3 changes: 1 addition & 2 deletions client/configuration/lint-staged/lint-staged.config.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
module.exports = {
"*.{js,ts,jsx,tsx}": "eslint --fix",
"*.{js,ts,jsx,tsx}": [() => "tsc --project tsconfig.json", "eslint --fix"],
"src/**/*": "prettier --write --ignore-unknown",
"*.{ts,tsx}": "tsc --noEmit",
};
3 changes: 2 additions & 1 deletion client/src/annoMatrix/whereCache.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ export function _whereCacheGet(
field: Field,
query: Query
): LabelType[] | [undefined] {
/*
/*
query will either be an where query (object) or a column name (string).
Return array of column labels or undefined.
Expand Down Expand Up @@ -209,5 +209,6 @@ function __whereCacheMerge(
}

export function _whereCacheMerge(...caches: (WhereCache | null)[]): WhereCache {
// eslint-disable-next-line compat/compat -- internal caches, not webAPI
return caches.reduce(__whereCacheMerge, {} as WhereCache);
}
4 changes: 2 additions & 2 deletions client/src/components/leftSidebar/infoMenu.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ interface Props {
const InformationMenu = React.memo<Props>((props): JSX.Element => {
const { tosURL, privacyURL } = props;

function handleMenuClick() {
const handleMenuClick = () => {
track(EVENTS.EXPLORER_MENU_BUTTON_CLICKED);
}
};

return (
<Popover
Expand Down
4 changes: 2 additions & 2 deletions client/src/components/menubar/clip.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,9 @@ const Clip = React.memo((props) => {
(Intent as any).INTENT_WARNING
: Intent.NONE;

function handleVizSettingsClick() {
const handleVizSettingsClick = () => {
track(EVENTS.EXPLORER_VISUALIZATION_SETTINGS_BUTTON_CLICKED);
}
};

return (
<ButtonGroup className={`${styles.menubarButton}`}>
Expand Down
6 changes: 3 additions & 3 deletions client/src/util/dataframe/labelIndex.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ export class IdentityInt32Index extends LabelIndexBase {

getOffset(label: LabelType): number {
// label to offset
return Number.isInteger(label) && label >= 0 && label < this.maxOffset
return typeof label === "number" && label >= 0 && label < this.maxOffset
? (label as number)
: -1;
}
Expand Down Expand Up @@ -137,7 +137,7 @@ export class IdentityInt32Index extends LabelIndexBase {
const { maxOffset } = this;
for (let i = 0, l = labels.length; i < l; i += 1) {
const label = labels[i];
if (!Number.isInteger(label) || label < 0 || label >= maxOffset)
if (typeof label !== "number" || label < 0 || label >= maxOffset)
throw new RangeError(`label: ${label}`);
}
return this.__promote(labels, true);
Expand Down Expand Up @@ -190,7 +190,7 @@ export class IdentityInt32Index extends LabelIndexBase {
}

dropLabel(label: LabelType): LabelIndexBase {
if (!Number.isInteger(label) || label < 0 || label > this.maxOffset - 1)
if (typeof label !== "number" || label < 0 || label > this.maxOffset - 1)
throw new RangeError("Invalid label.");
if (label === this.maxOffset - 1) {
return new IdentityInt32Index(label);
Expand Down
2 changes: 1 addition & 1 deletion client/src/util/diffexpdu/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ type TypedArray =
| Int32Array
| Float32Array
| Float64Array;
type Constructor<T extends unknown = unknown> = new (...args: unknown[]) => T;
type Constructor<T> = new (...args: unknown[]) => T;
export function concat<SrcType extends TypedArray, DstType extends TypedArray>(
Ctor: Constructor<DstType>,
tArrays: SrcType[]
Expand Down

0 comments on commit fe6683e

Please sign in to comment.