diff options
author | MCMXC <16797721+mcmxcdev@users.noreply.github.com> | 2023-07-23 20:08:52 -0600 |
---|---|---|
committer | Vijay Aravamudhan <vraravam@users.noreply.github.com> | 2023-07-25 07:45:23 +0000 |
commit | 8c131073730ec684145c2cc8ee8d6b39bbe9278d (patch) | |
tree | 1129d432ae88475909f0e5d38960395b75364902 /src/stores/GlobalErrorStore.ts | |
parent | 6.4.1-nightly.11 [skip ci] (diff) | |
download | ferdium-app-8c131073730ec684145c2cc8ee8d6b39bbe9278d.tar.gz ferdium-app-8c131073730ec684145c2cc8ee8d6b39bbe9278d.tar.zst ferdium-app-8c131073730ec684145c2cc8ee8d6b39bbe9278d.zip |
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
Diffstat (limited to 'src/stores/GlobalErrorStore.ts')
-rw-r--r-- | src/stores/GlobalErrorStore.ts | 12 |
1 files changed, 7 insertions, 5 deletions
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 { | |||
27 | 27 | ||
28 | @observable response: Response = {} as Response; | 28 | @observable response: Response = {} as Response; |
29 | 29 | ||
30 | // TODO: Get rid of the @ts-ignores in this function. | 30 | // TODO: Get rid of the @ts-expect-errors in this function. |
31 | constructor(stores: Stores, api: ApiInterface, actions: Actions) { | 31 | constructor(stores: Stores, api: ApiInterface, actions: Actions) { |
32 | super(stores, api, actions); | 32 | super(stores, api, actions); |
33 | 33 | ||
34 | makeObservable(this); | 34 | makeObservable(this); |
35 | 35 | ||
36 | window.addEventListener('error', (...errorArgs: any[]): void => { | 36 | window.addEventListener('error', (...errorArgs: any[]): void => { |
37 | // @ts-ignore ts-message: Expected 5 arguments, but got 2. | 37 | // @ts-expect-error ts-message: Expected 5 arguments, but got 2. |
38 | this._handleConsoleError.call(this, ['error', ...errorArgs]); | 38 | this._handleConsoleError.call(this, ['error', ...errorArgs]); |
39 | }); | 39 | }); |
40 | 40 | ||
41 | const origConsoleError = console.error; | 41 | const origConsoleError = console.error; |
42 | window.console.error = (...errorArgs: any[]) => { | 42 | window.console.error = (...errorArgs: any[]) => { |
43 | // @ts-ignore ts-message: Expected 5 arguments, but got 2. | 43 | // @ts-expect-error ts-message: Expected 5 arguments, but got 2. |
44 | this._handleConsoleError.call(this, ['error', ...errorArgs]); | 44 | this._handleConsoleError.call(this, ['error', ...errorArgs]); |
45 | origConsoleError.apply(this, errorArgs); | 45 | origConsoleError.apply(this, errorArgs); |
46 | }; | 46 | }; |
47 | 47 | ||
48 | // eslint-disable-next-line no-console | ||
48 | const origConsoleLog = console.log; | 49 | const origConsoleLog = console.log; |
49 | window.console.log = (...logArgs: any[]) => { | 50 | window.console.log = (...logArgs: any[]) => { |
50 | // @ts-ignore ts-message: Expected 5 arguments, but got 2. | 51 | // @ts-expect-error ts-message: Expected 5 arguments, but got 2. |
51 | this._handleConsoleError.call(this, ['log', ...logArgs]); | 52 | this._handleConsoleError.call(this, ['log', ...logArgs]); |
52 | origConsoleLog.apply(this, logArgs); | 53 | origConsoleLog.apply(this, logArgs); |
53 | }; | 54 | }; |
54 | 55 | ||
56 | // eslint-disable-next-line no-console | ||
55 | const origConsoleInfo = console.info; | 57 | const origConsoleInfo = console.info; |
56 | window.console.info = (...infoArgs: any[]) => { | 58 | window.console.info = (...infoArgs: any[]) => { |
57 | // @ts-ignore ts-message: Expected 5 arguments, but got 2. | 59 | // @ts-expect-error ts-message: Expected 5 arguments, but got 2. |
58 | this._handleConsoleError.call(this, ['info', ...infoArgs]); | 60 | this._handleConsoleError.call(this, ['info', ...infoArgs]); |
59 | origConsoleInfo.apply(this, infoArgs); | 61 | origConsoleInfo.apply(this, infoArgs); |
60 | }; | 62 | }; |