From 8c131073730ec684145c2cc8ee8d6b39bbe9278d Mon Sep 17 00:00:00 2001 From: MCMXC <16797721+mcmxcdev@users.noreply.github.com> Date: Sun, 23 Jul 2023 20:08:52 -0600 Subject: chore: improve lint setup - update eslint config - merged eslint rules for JS and TS to avoid duplicates - extended stricter lint ruleset from typescript-eslint - corrected wrong setup for certain eslint rulesets - opt in to reportUnusedDisableDirectives config option - fix or disable a lot of lint issues throughout codebase - remove trailingComma: all from prettier config which is default in prettier v3 - add volta configuration to package.json to autoload correct node and pnpm versions - upgrade all eslint and prettier related dependencies to latest - remove config options from settings.json which are default anyways - remove config options from settings.json which are outdated/unknown - set up prettier as default formatter in settings.json --- src/stores/GlobalErrorStore.ts | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/stores/GlobalErrorStore.ts') diff --git a/src/stores/GlobalErrorStore.ts b/src/stores/GlobalErrorStore.ts index 8547fec72..74a43100b 100644 --- a/src/stores/GlobalErrorStore.ts +++ b/src/stores/GlobalErrorStore.ts @@ -27,34 +27,36 @@ export default class GlobalErrorStore extends TypedStore { @observable response: Response = {} as Response; - // TODO: Get rid of the @ts-ignores in this function. + // TODO: Get rid of the @ts-expect-errors in this function. constructor(stores: Stores, api: ApiInterface, actions: Actions) { super(stores, api, actions); makeObservable(this); window.addEventListener('error', (...errorArgs: any[]): void => { - // @ts-ignore ts-message: Expected 5 arguments, but got 2. + // @ts-expect-error ts-message: Expected 5 arguments, but got 2. this._handleConsoleError.call(this, ['error', ...errorArgs]); }); const origConsoleError = console.error; window.console.error = (...errorArgs: any[]) => { - // @ts-ignore ts-message: Expected 5 arguments, but got 2. + // @ts-expect-error ts-message: Expected 5 arguments, but got 2. this._handleConsoleError.call(this, ['error', ...errorArgs]); origConsoleError.apply(this, errorArgs); }; + // eslint-disable-next-line no-console const origConsoleLog = console.log; window.console.log = (...logArgs: any[]) => { - // @ts-ignore ts-message: Expected 5 arguments, but got 2. + // @ts-expect-error ts-message: Expected 5 arguments, but got 2. this._handleConsoleError.call(this, ['log', ...logArgs]); origConsoleLog.apply(this, logArgs); }; + // eslint-disable-next-line no-console const origConsoleInfo = console.info; window.console.info = (...infoArgs: any[]) => { - // @ts-ignore ts-message: Expected 5 arguments, but got 2. + // @ts-expect-error ts-message: Expected 5 arguments, but got 2. this._handleConsoleError.call(this, ['info', ...infoArgs]); origConsoleInfo.apply(this, infoArgs); }; -- cgit v1.2.3-54-g00ecf