Added @typescript-eslint/recommended config with suppressions (#2345)

* Disabled @blueprintjs/classes-constants. #2288.

* thuang-eslint-bp-off (#2344)

* Disabled @blueprintjs/classes-constants on webpack dev and shared. #2288.

* Added TS recommended, suppress lint errors codemod.

* Added per-error/warning ignore for tests.

* Added per-error/warning ignore for configuration.

* Added per-error/warning ignore for src. Removed suppress package.

* Minor linting.

Co-authored-by: Timmy Huang <tihuan@users.noreply.github.com>
This commit is contained in:
Mim Hastie
2021-07-28 16:06:34 -07:00
committed by GitHub
co-authored by Timmy Huang
parent 32f60a1547
commit 27575b8d86
163 changed files with 1827 additions and 64 deletions
+6
View File
@@ -4,13 +4,16 @@ Private utility code for dataframe
export { isTypedArray, isArrayOrTypedArray } from "../typeHelpers";
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function callOnceLazy(f: any) {
/*
call function once, and save the result, regardless of arguments (this is not
the same as typical memoization).
*/
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
let value: any;
let calledOnce = false;
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const result = function result(...args: any[]) {
if (!calledOnce) {
value = f(...args);
@@ -21,6 +24,7 @@ export function callOnceLazy(f: any) {
return result;
}
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types, @typescript-eslint/no-explicit-any -- - FIXME: disabled temporarily on migrate to TS.
export function memoize(fn: any, hashFn: any, maxResultsCached = -1) {
/*
function memoization, with user-provided hash. hashFn must return a
@@ -29,6 +33,7 @@ export function memoize(fn: any, hashFn: any, maxResultsCached = -1) {
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality
*/
const cache = new Map();
// eslint-disable-next-line @typescript-eslint/no-explicit-any --- FIXME: disabled temporarily on migrate to TS.
const wrap = function wrap(...args: any[]) {
const key = hashFn(...args);
if (cache.has(key)) {
@@ -57,6 +62,7 @@ export function memoize(fn: any, hashFn: any, maxResultsCached = -1) {
memoization helpers - just a global counter.
**/
let __DataframeMemoId__ = 0;
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types --- FIXME: disabled temporarily on migrate to TS.
export function __getMemoId() {
const id = __DataframeMemoId__;
__DataframeMemoId__ += 1;