From 824dde374b48e7645317b02dfc1f6ceb8aaf4b98 Mon Sep 17 00:00:00 2001 From: gatzjames Date: Wed, 26 Mar 2025 16:22:27 +0100 Subject: [PATCH 1/9] init oxlint --- .oxlintrc.json | 71 +++++++++++++++++++++ packages/insomnia-inso/.oxlintrc.json | 71 +++++++++++++++++++++ packages/insomnia-sdk/.oxlintrc.json | 71 +++++++++++++++++++++ packages/insomnia-smoke-test/.oxlintrc.json | 71 +++++++++++++++++++++ packages/insomnia-testing/.oxlintrc.json | 71 +++++++++++++++++++++ packages/insomnia/.oxlintrc.json | 71 +++++++++++++++++++++ 6 files changed, 426 insertions(+) create mode 100644 .oxlintrc.json create mode 100644 packages/insomnia-inso/.oxlintrc.json create mode 100644 packages/insomnia-sdk/.oxlintrc.json create mode 100644 packages/insomnia-smoke-test/.oxlintrc.json create mode 100644 packages/insomnia-testing/.oxlintrc.json create mode 100644 packages/insomnia/.oxlintrc.json diff --git a/.oxlintrc.json b/.oxlintrc.json new file mode 100644 index 00000000000..49bfbc9de7b --- /dev/null +++ b/.oxlintrc.json @@ -0,0 +1,71 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": [ + "react", + "typescript" + ], + "categories": { + "correctness": "off" + }, + "env": { + "builtin": true + }, + "rules": { + "curly": "error", + "default-case": "error", + "default-case-last": "error", + "eqeqeq": [ + "error", + "smart" + ], + "no-async-promise-executor": "off", + "no-case-declarations": "off", + "no-duplicate-imports": "off", + "no-prototype-builtins": "off", + "no-redeclare": "error", + "no-unused-vars": [ + "error", + { + "ignoreRestSiblings": true + } + ], + "no-var": "error", + "react/no-unescaped-entities": "off", + "react/jsx-key": [ + "error", + { + "checkFragmentShorthand": true + } + ], + "react/no-array-index-key": "error", + "react/self-closing-comp": "error", + "react-hooks/rules-of-hooks": "error", + "@typescript-eslint/array-type": [ + "error", + { + "default": "array", + "readonly": "array" + } + ], + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/consistent-type-definitions": [ + "error", + "interface" + ], + "@typescript-eslint/no-empty-interface": [ + "error", + { + "allowSingleExtends": true + } + ], + "@typescript-eslint/no-namespace": [ + "error", + { + "allowDeclarations": true + } + ], + "@typescript-eslint/no-explicit-any": "off", + "react/no-find-dom-node": "off", + "no-empty-function": "off" + } +} \ No newline at end of file diff --git a/packages/insomnia-inso/.oxlintrc.json b/packages/insomnia-inso/.oxlintrc.json new file mode 100644 index 00000000000..49bfbc9de7b --- /dev/null +++ b/packages/insomnia-inso/.oxlintrc.json @@ -0,0 +1,71 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": [ + "react", + "typescript" + ], + "categories": { + "correctness": "off" + }, + "env": { + "builtin": true + }, + "rules": { + "curly": "error", + "default-case": "error", + "default-case-last": "error", + "eqeqeq": [ + "error", + "smart" + ], + "no-async-promise-executor": "off", + "no-case-declarations": "off", + "no-duplicate-imports": "off", + "no-prototype-builtins": "off", + "no-redeclare": "error", + "no-unused-vars": [ + "error", + { + "ignoreRestSiblings": true + } + ], + "no-var": "error", + "react/no-unescaped-entities": "off", + "react/jsx-key": [ + "error", + { + "checkFragmentShorthand": true + } + ], + "react/no-array-index-key": "error", + "react/self-closing-comp": "error", + "react-hooks/rules-of-hooks": "error", + "@typescript-eslint/array-type": [ + "error", + { + "default": "array", + "readonly": "array" + } + ], + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/consistent-type-definitions": [ + "error", + "interface" + ], + "@typescript-eslint/no-empty-interface": [ + "error", + { + "allowSingleExtends": true + } + ], + "@typescript-eslint/no-namespace": [ + "error", + { + "allowDeclarations": true + } + ], + "@typescript-eslint/no-explicit-any": "off", + "react/no-find-dom-node": "off", + "no-empty-function": "off" + } +} \ No newline at end of file diff --git a/packages/insomnia-sdk/.oxlintrc.json b/packages/insomnia-sdk/.oxlintrc.json new file mode 100644 index 00000000000..49bfbc9de7b --- /dev/null +++ b/packages/insomnia-sdk/.oxlintrc.json @@ -0,0 +1,71 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": [ + "react", + "typescript" + ], + "categories": { + "correctness": "off" + }, + "env": { + "builtin": true + }, + "rules": { + "curly": "error", + "default-case": "error", + "default-case-last": "error", + "eqeqeq": [ + "error", + "smart" + ], + "no-async-promise-executor": "off", + "no-case-declarations": "off", + "no-duplicate-imports": "off", + "no-prototype-builtins": "off", + "no-redeclare": "error", + "no-unused-vars": [ + "error", + { + "ignoreRestSiblings": true + } + ], + "no-var": "error", + "react/no-unescaped-entities": "off", + "react/jsx-key": [ + "error", + { + "checkFragmentShorthand": true + } + ], + "react/no-array-index-key": "error", + "react/self-closing-comp": "error", + "react-hooks/rules-of-hooks": "error", + "@typescript-eslint/array-type": [ + "error", + { + "default": "array", + "readonly": "array" + } + ], + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/consistent-type-definitions": [ + "error", + "interface" + ], + "@typescript-eslint/no-empty-interface": [ + "error", + { + "allowSingleExtends": true + } + ], + "@typescript-eslint/no-namespace": [ + "error", + { + "allowDeclarations": true + } + ], + "@typescript-eslint/no-explicit-any": "off", + "react/no-find-dom-node": "off", + "no-empty-function": "off" + } +} \ No newline at end of file diff --git a/packages/insomnia-smoke-test/.oxlintrc.json b/packages/insomnia-smoke-test/.oxlintrc.json new file mode 100644 index 00000000000..49bfbc9de7b --- /dev/null +++ b/packages/insomnia-smoke-test/.oxlintrc.json @@ -0,0 +1,71 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": [ + "react", + "typescript" + ], + "categories": { + "correctness": "off" + }, + "env": { + "builtin": true + }, + "rules": { + "curly": "error", + "default-case": "error", + "default-case-last": "error", + "eqeqeq": [ + "error", + "smart" + ], + "no-async-promise-executor": "off", + "no-case-declarations": "off", + "no-duplicate-imports": "off", + "no-prototype-builtins": "off", + "no-redeclare": "error", + "no-unused-vars": [ + "error", + { + "ignoreRestSiblings": true + } + ], + "no-var": "error", + "react/no-unescaped-entities": "off", + "react/jsx-key": [ + "error", + { + "checkFragmentShorthand": true + } + ], + "react/no-array-index-key": "error", + "react/self-closing-comp": "error", + "react-hooks/rules-of-hooks": "error", + "@typescript-eslint/array-type": [ + "error", + { + "default": "array", + "readonly": "array" + } + ], + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/consistent-type-definitions": [ + "error", + "interface" + ], + "@typescript-eslint/no-empty-interface": [ + "error", + { + "allowSingleExtends": true + } + ], + "@typescript-eslint/no-namespace": [ + "error", + { + "allowDeclarations": true + } + ], + "@typescript-eslint/no-explicit-any": "off", + "react/no-find-dom-node": "off", + "no-empty-function": "off" + } +} \ No newline at end of file diff --git a/packages/insomnia-testing/.oxlintrc.json b/packages/insomnia-testing/.oxlintrc.json new file mode 100644 index 00000000000..49bfbc9de7b --- /dev/null +++ b/packages/insomnia-testing/.oxlintrc.json @@ -0,0 +1,71 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": [ + "react", + "typescript" + ], + "categories": { + "correctness": "off" + }, + "env": { + "builtin": true + }, + "rules": { + "curly": "error", + "default-case": "error", + "default-case-last": "error", + "eqeqeq": [ + "error", + "smart" + ], + "no-async-promise-executor": "off", + "no-case-declarations": "off", + "no-duplicate-imports": "off", + "no-prototype-builtins": "off", + "no-redeclare": "error", + "no-unused-vars": [ + "error", + { + "ignoreRestSiblings": true + } + ], + "no-var": "error", + "react/no-unescaped-entities": "off", + "react/jsx-key": [ + "error", + { + "checkFragmentShorthand": true + } + ], + "react/no-array-index-key": "error", + "react/self-closing-comp": "error", + "react-hooks/rules-of-hooks": "error", + "@typescript-eslint/array-type": [ + "error", + { + "default": "array", + "readonly": "array" + } + ], + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/consistent-type-definitions": [ + "error", + "interface" + ], + "@typescript-eslint/no-empty-interface": [ + "error", + { + "allowSingleExtends": true + } + ], + "@typescript-eslint/no-namespace": [ + "error", + { + "allowDeclarations": true + } + ], + "@typescript-eslint/no-explicit-any": "off", + "react/no-find-dom-node": "off", + "no-empty-function": "off" + } +} \ No newline at end of file diff --git a/packages/insomnia/.oxlintrc.json b/packages/insomnia/.oxlintrc.json new file mode 100644 index 00000000000..49bfbc9de7b --- /dev/null +++ b/packages/insomnia/.oxlintrc.json @@ -0,0 +1,71 @@ +{ + "$schema": "./node_modules/oxlint/configuration_schema.json", + "plugins": [ + "react", + "typescript" + ], + "categories": { + "correctness": "off" + }, + "env": { + "builtin": true + }, + "rules": { + "curly": "error", + "default-case": "error", + "default-case-last": "error", + "eqeqeq": [ + "error", + "smart" + ], + "no-async-promise-executor": "off", + "no-case-declarations": "off", + "no-duplicate-imports": "off", + "no-prototype-builtins": "off", + "no-redeclare": "error", + "no-unused-vars": [ + "error", + { + "ignoreRestSiblings": true + } + ], + "no-var": "error", + "react/no-unescaped-entities": "off", + "react/jsx-key": [ + "error", + { + "checkFragmentShorthand": true + } + ], + "react/no-array-index-key": "error", + "react/self-closing-comp": "error", + "react-hooks/rules-of-hooks": "error", + "@typescript-eslint/array-type": [ + "error", + { + "default": "array", + "readonly": "array" + } + ], + "@typescript-eslint/ban-types": "off", + "@typescript-eslint/consistent-type-definitions": [ + "error", + "interface" + ], + "@typescript-eslint/no-empty-interface": [ + "error", + { + "allowSingleExtends": true + } + ], + "@typescript-eslint/no-namespace": [ + "error", + { + "allowDeclarations": true + } + ], + "@typescript-eslint/no-explicit-any": "off", + "react/no-find-dom-node": "off", + "no-empty-function": "off" + } +} \ No newline at end of file From 8561eb25ea690e2a7f0d96b7ff717fcca62833c6 Mon Sep 17 00:00:00 2001 From: gatzjames Date: Thu, 27 Mar 2025 11:45:13 +0100 Subject: [PATCH 2/9] fix unused variable error --- packages/insomnia-inso/src/cli.ts | 4 +- .../src/db/adapters/git-adapter.ts | 2 +- .../src/db/adapters/ne-db-adapter.ts | 2 +- packages/insomnia-inso/src/db/index.ts | 2 +- packages/insomnia-smoke-test/server/oauth.ts | 8 +- .../smoke/dashboard-interactions.test.ts | 1 - packages/insomnia/src/common/api-specs.ts | 2 +- packages/insomnia/src/common/har.ts | 2 +- packages/insomnia/src/common/import.ts | 2 +- packages/insomnia/src/common/insomnia-v5.ts | 2 +- packages/insomnia/src/common/render.ts | 2 +- packages/insomnia/src/main.development.ts | 2 +- packages/insomnia/src/main/git-service.ts | 8 +- .../src/main/ipc/extractPostmanDataDump.ts | 4 +- packages/insomnia/src/models/environment.ts | 2 +- packages/insomnia/src/network/network.ts | 4 +- .../src/network/o-auth-2/get-token.ts | 4 +- .../src/network/url-matches-cert-host.ts | 2 +- packages/insomnia/src/plugins/misc.ts | 4 +- packages/insomnia/src/sync/git/git-vcs.ts | 10 +- .../insomnia/src/sync/git/ne-db-client.ts | 4 +- .../src/sync/git/project-ne-db-client.ts | 6 +- .../sync/git/project-routable-fs-client.ts | 4 +- .../src/sync/store/drivers/graceful-rename.ts | 2 +- .../src/sync/vcs/__tests__/vcs.test.ts | 4 +- packages/insomnia/src/sync/vcs/vcs.ts | 8 +- .../insomnia/src/ui/auth-session-provider.ts | 4 +- .../ui/components/codemirror/code-editor.tsx | 8 +- .../components/codemirror/lint/json-lint.ts | 2 +- .../components/editors/auth/o-auth-2-auth.tsx | 2 +- .../components/editors/body/file-editor.tsx | 4 +- .../editors/body/graph-ql-editor.tsx | 4 +- .../key-value-editor.tsx | 4 +- .../src/ui/components/error-boundary.tsx | 4 +- .../ui/components/modals/cookies-modal.tsx | 2 +- .../components/modals/generate-code-modal.tsx | 4 +- .../github-repository-settings-form-group.tsx | 4 +- .../gitlab-repository-settings-form-group.tsx | 2 +- .../modals/upload-runner-data-modal.tsx | 2 +- .../src/ui/components/panes/request-pane.tsx | 2 +- .../templating/local-template-tags.ts | 8 +- packages/insomnia/src/ui/components/toast.tsx | 2 +- .../viewers/response-cookies-viewer.tsx | 2 +- .../ui/components/viewers/response-viewer.tsx | 6 +- .../websockets/websocket-request-pane.tsx | 74 +- packages/insomnia/src/ui/insomniaFetch.ts | 2 +- packages/insomnia/src/ui/routes/actions.tsx | 2 +- packages/insomnia/src/ui/routes/commands.tsx | 2 +- packages/insomnia/src/ui/routes/design.tsx | 84 +-- packages/insomnia/src/ui/routes/import.tsx | 2 +- packages/insomnia/src/ui/routes/invite.tsx | 8 +- .../insomnia/src/ui/routes/organization.tsx | 688 +++++++++--------- packages/insomnia/src/ui/routes/project.tsx | 6 +- .../src/ui/routes/remote-collections.tsx | 8 +- packages/insomnia/src/ui/routes/root.tsx | 2 +- packages/insomnia/src/ui/routes/runner.tsx | 4 +- packages/insomnia/src/utils/graph-ql.ts | 2 +- .../src/utils/importers/importers/curl.ts | 2 +- .../src/utils/importers/importers/har.ts | 2 +- .../utils/importers/importers/insomnia-1.ts | 14 +- .../utils/importers/importers/insomnia-2.ts | 2 +- .../utils/importers/importers/insomnia-3.ts | 2 +- .../utils/importers/importers/insomnia-4.ts | 2 +- .../utils/importers/importers/openapi-3.ts | 2 +- .../utils/importers/importers/postman-env.ts | 2 +- .../src/utils/importers/importers/postman.ts | 2 +- .../utils/importers/importers/swagger-2.ts | 2 +- .../src/utils/importers/importers/wsdl.ts | 2 +- .../insomnia/src/utils/importers/utils.ts | 2 +- packages/insomnia/src/utils/prettify/json.ts | 2 +- packages/insomnia/src/utils/router.ts | 4 +- .../insomnia/src/utils/url/querystring.ts | 4 +- packages/insomnia/src/utils/vault.ts | 2 +- 73 files changed, 547 insertions(+), 548 deletions(-) diff --git a/packages/insomnia-inso/src/cli.ts b/packages/insomnia-inso/src/cli.ts index a341725118f..c98d903bcf2 100644 --- a/packages/insomnia-inso/src/cli.ts +++ b/packages/insomnia-inso/src/cli.ts @@ -269,7 +269,7 @@ const getListFromFileOrUrl = (content: string, fileType?: string): Record data && typeof data === 'object' && !Array.isArray(data) && data !== null); } throw new Error('Invalid JSON file uploaded, JSON file must be array of key-value pairs.'); - } catch (error) { + } catch { throw new Error('Upload JSON file can not be parsed'); } } else if (fileType === 'csv') { @@ -726,7 +726,7 @@ Test results:`); let isIdentiferAFile = false; try { isIdentiferAFile = identifier && (await fs.promises.stat(identifierAsAbsPath)).isFile(); - } catch (err) { } + } catch { } const pathToSearch = ''; let specContent; let rulesetFileName; diff --git a/packages/insomnia-inso/src/db/adapters/git-adapter.ts b/packages/insomnia-inso/src/db/adapters/git-adapter.ts index ed6114dec36..846e526f75d 100644 --- a/packages/insomnia-inso/src/db/adapters/git-adapter.ts +++ b/packages/insomnia-inso/src/db/adapters/git-adapter.ts @@ -14,7 +14,7 @@ const gitAdapter: DbAdapter = async (dir, filterTypes) => { let files = null; try { files = await fs.promises.readdir(insomniaFolder); - } catch (error) { + } catch { if (files?.length === 0) { console.error(`.insomnia folder found at "${insomniaFolder}" but no files found inside. Ensure your workingDir is correct.`); diff --git a/packages/insomnia-inso/src/db/adapters/ne-db-adapter.ts b/packages/insomnia-inso/src/db/adapters/ne-db-adapter.ts index 52580b963b9..3f61c5e4391 100644 --- a/packages/insomnia-inso/src/db/adapters/ne-db-adapter.ts +++ b/packages/insomnia-inso/src/db/adapters/ne-db-adapter.ts @@ -10,7 +10,7 @@ const neDbAdapter: DbAdapter = async (dir, filterTypes) => { // Confirm if db files exist try { await stat(path.join(dir, 'insomnia.Workspace.db')); - } catch (err) { + } catch { return null; } diff --git a/packages/insomnia-inso/src/db/index.ts b/packages/insomnia-inso/src/db/index.ts index e818266d81b..cde501a17e1 100644 --- a/packages/insomnia-inso/src/db/index.ts +++ b/packages/insomnia-inso/src/db/index.ts @@ -61,7 +61,7 @@ interface Options { export const isFile = async (path: string) => { try { return (await stat(path)).isFile(); - } catch (error) { + } catch { return false; } }; diff --git a/packages/insomnia-smoke-test/server/oauth.ts b/packages/insomnia-smoke-test/server/oauth.ts index 2daeb692ec1..1ffddf8cd9f 100644 --- a/packages/insomnia-smoke-test/server/oauth.ts +++ b/packages/insomnia-smoke-test/server/oauth.ts @@ -1,5 +1,6 @@ import express, { urlencoded } from 'express'; import type Provider from 'oidc-provider'; +import { Configuration } from 'oidc-provider'; export const oauthRoutes = async (port: number) => { const clientIDAuthorizationCode = 'authorization_code'; @@ -12,7 +13,6 @@ export const oauthRoutes = async (port: number) => { const clientRedirectUri = `http://127.0.0.1:${port}/callback`; - /* eslint-disable camelcase */ const oidcConfig = { interactions: { url: (_, interaction) => { @@ -124,8 +124,8 @@ export const oauthRoutes = async (port: number) => { return grant; }, - }; - /* eslint-enable camelcase */ + } satisfies Configuration; + const provider = (await import('oidc-provider')).default; const oidc = new provider(`http://127.0.0.1:${port}`, oidcConfig); @@ -159,7 +159,7 @@ export const oauthRoutes = async (port: number) => { res .status(200) .json(validated); - } catch (err) { + } catch { res .status(500) .header('Content-Type', 'text/plain') diff --git a/packages/insomnia-smoke-test/tests/smoke/dashboard-interactions.test.ts b/packages/insomnia-smoke-test/tests/smoke/dashboard-interactions.test.ts index cfeb4c7d624..3c66fedd126 100644 --- a/packages/insomnia-smoke-test/tests/smoke/dashboard-interactions.test.ts +++ b/packages/insomnia-smoke-test/tests/smoke/dashboard-interactions.test.ts @@ -1,6 +1,5 @@ import { expect } from '@playwright/test'; -import { loadFixture } from '../../playwright/paths'; import { test } from '../../playwright/test'; test.describe('Dashboard', async () => { diff --git a/packages/insomnia/src/common/api-specs.ts b/packages/insomnia/src/common/api-specs.ts index 5471c04b1e3..88c573bbaed 100644 --- a/packages/insomnia/src/common/api-specs.ts +++ b/packages/insomnia/src/common/api-specs.ts @@ -20,7 +20,7 @@ export function parseApiSpec( // NOTE: JSON is valid YAML so we only need to parse YAML try { result.contents = YAML.parse(rawDocument); - } catch (err) { + } catch { throw new Error('Failed to parse API spec'); } diff --git a/packages/insomnia/src/common/har.ts b/packages/insomnia/src/common/har.ts index f52aede477d..bd83c89d208 100644 --- a/packages/insomnia/src/common/har.ts +++ b/packages/insomnia/src/common/har.ts @@ -283,7 +283,7 @@ export function getResponseCookiesFromHeaders(headers: Har.Cookie[]) { try { cookie = ToughCookie.parse(harCookie.value || '', { loose: true }); - } catch (error) { } + } catch { } if (cookie === null || cookie === undefined) { return accumulator; diff --git a/packages/insomnia/src/common/import.ts b/packages/insomnia/src/common/import.ts index f075ebc0452..3ebc09eb6cc 100644 --- a/packages/insomnia/src/common/import.ts +++ b/packages/insomnia/src/common/import.ts @@ -84,7 +84,7 @@ export async function getFilesFromPostmanExportedDataDump(filePath: string): Pro let res; try { res = await window.main.extractJsonFileFromPostmanDataDumpArchive(filePath); - } catch (err) { + } catch { throw new Error('Extract failed'); } if (res && res.data) { diff --git a/packages/insomnia/src/common/insomnia-v5.ts b/packages/insomnia/src/common/insomnia-v5.ts index 0ce3171808a..3e244fb1bfd 100644 --- a/packages/insomnia/src/common/insomnia-v5.ts +++ b/packages/insomnia/src/common/insomnia-v5.ts @@ -625,7 +625,7 @@ export async function getInsomniaV5DataExport({ try { contents = JSON.parse(spec.contents); - } catch (err) { + } catch { // @TODO For some reason switching a spec from JSON to YAML doesn't update it's content type so we need to handle both here // This must be fixed in the apiSpec model try { diff --git a/packages/insomnia/src/common/render.ts b/packages/insomnia/src/common/render.ts index 8b648a79b06..0ff56d98ea8 100644 --- a/packages/insomnia/src/common/render.ts +++ b/packages/insomnia/src/common/render.ts @@ -594,7 +594,7 @@ export async function getRenderedRequestAndContext( o.query = o.query.replace(/#}/g, '# }'); request.body.text = JSON.stringify(o); } - } catch (err) { } + } catch { } // Render description separately because it's lower priority const description = request.description; diff --git a/packages/insomnia/src/main.development.ts b/packages/insomnia/src/main.development.ts index 73fe7ffc662..621915cdf92 100644 --- a/packages/insomnia/src/main.development.ts +++ b/packages/insomnia/src/main.development.ts @@ -146,7 +146,7 @@ app.on('activate', (_error, hasVisibleWindows) => { try { console.log('[main] creating new window for MacOS activate event'); windowUtils.createWindow(); - } catch (error) { + } catch { // This might happen if 'ready' hasn't fired yet. So we're just going // to silence these errors. console.log('[main] App not ready to "activate" yet'); diff --git a/packages/insomnia/src/main/git-service.ts b/packages/insomnia/src/main/git-service.ts index 525193998cf..adc3ffb7d16 100644 --- a/packages/insomnia/src/main/git-service.ts +++ b/packages/insomnia/src/main/git-service.ts @@ -318,7 +318,7 @@ export const gitChangesLoader = async ({ branch, changes, }; - } catch (e) { + } catch { return { branch: '', changes: { @@ -348,7 +348,7 @@ export const canPushLoader = async ({ projectId, workspaceId }: { }); return { canPush: hasUnpushedChanges }; - } catch (err) { + } catch { return { canPush: false }; } }; @@ -1679,7 +1679,7 @@ function getPreviewItemName(previewDiffItem: { if (prev && 'fileName' in prev || 'name' in prev) { prevName = prev.fileName || prev.name; } - } catch (e) { + } catch { // Nothing to do } @@ -1688,7 +1688,7 @@ function getPreviewItemName(previewDiffItem: { if (next && 'fileName' in next || 'name' in next) { nextName = next.fileName || next.name; } - } catch (e) { + } catch { // Nothing to do } diff --git a/packages/insomnia/src/main/ipc/extractPostmanDataDump.ts b/packages/insomnia/src/main/ipc/extractPostmanDataDump.ts index d32eb3df7d8..646049fc6a3 100644 --- a/packages/insomnia/src/main/ipc/extractPostmanDataDump.ts +++ b/packages/insomnia/src/main/ipc/extractPostmanDataDump.ts @@ -27,7 +27,7 @@ export default async function extractPostmanDataDumpHandler(_event: unknown, dat let archiveJsonData; try { archiveJsonData = JSON.parse(archiveJsonFile.data.toString()); - } catch (err) { + } catch { return { err: 'Failed to parse archive.json file', }; @@ -62,7 +62,7 @@ export default async function extractPostmanDataDumpHandler(_event: unknown, dat }); } }); - } catch (err) { + } catch { return { err: 'Failed to parse collection or environment files', }; diff --git a/packages/insomnia/src/models/environment.ts b/packages/insomnia/src/models/environment.ts index d59cb1d7e13..55ac5fc30fc 100644 --- a/packages/insomnia/src/models/environment.ts +++ b/packages/insomnia/src/models/environment.ts @@ -148,7 +148,7 @@ export const decryptSecretValue = (encryptedValue: string, symmetricKey: JsonWeb try { const jsonWebKey = base64decode(encryptedValue, true); return crypt.decryptAES(symmetricKey, jsonWebKey); - } catch (error) { + } catch { // return origin value if failed to decrypt return encryptedValue; } diff --git a/packages/insomnia/src/network/network.ts b/packages/insomnia/src/network/network.ts index 1b506268565..cc6e9c09462 100644 --- a/packages/insomnia/src/network/network.ts +++ b/packages/insomnia/src/network/network.ts @@ -646,7 +646,7 @@ export const tryToTransformRequestWithPlugins = async (renderResult: { const { request, context } = renderResult; try { return await _applyRequestPluginHooks(request, context); - } catch (err) { + } catch { throw new Error(`Failed to transform request with plugins: ${request._id}`); } }; @@ -830,7 +830,7 @@ export const getCurrentUrl = ({ headerResults, finalUrl }: { headerResults: any; } try { return new URL(location.value, finalUrl).toString(); - } catch (error) { + } catch { return finalUrl; } }; diff --git a/packages/insomnia/src/network/o-auth-2/get-token.ts b/packages/insomnia/src/network/o-auth-2/get-token.ts index c2f56b542ff..d4744722dd5 100644 --- a/packages/insomnia/src/network/o-auth-2/get-token.ts +++ b/packages/insomnia/src/network/o-auth-2/get-token.ts @@ -359,13 +359,13 @@ export const encodePKCE = (buffer: Buffer) => { const tryToParse = (body: string): Record | null => { try { return JSON.parse(body); - } catch (err) { } + } catch { } try { // NOTE: parse does not return a JS Object, so // we cannot use hasOwnProperty on it return querystring.parse(body); - } catch (err) { } + } catch { } return null; }; diff --git a/packages/insomnia/src/network/url-matches-cert-host.ts b/packages/insomnia/src/network/url-matches-cert-host.ts index 231e2ace92b..0bc051e2dce 100644 --- a/packages/insomnia/src/network/url-matches-cert-host.ts +++ b/packages/insomnia/src/network/url-matches-cert-host.ts @@ -11,7 +11,7 @@ export function urlMatchesCertHost(certificateHost: string, requestUrl: string, let certificateHostWithProtocol = new URL('https://example.com'); try { certificateHostWithProtocol = new URL(cHostWithProtocol); - } catch (err) { + } catch { // return false early if the certificate host is invalid return false; } diff --git a/packages/insomnia/src/plugins/misc.ts b/packages/insomnia/src/plugins/misc.ts index b7cd0be6bef..108322904d9 100644 --- a/packages/insomnia/src/plugins/misc.ts +++ b/packages/insomnia/src/plugins/misc.ts @@ -99,7 +99,7 @@ const getChildValue = (theme: any, path: string[]) => { return path.reduce((acc, v: string) => { try { acc = acc[v]; - } catch (e) { + } catch { return undefined; } return acc; @@ -220,7 +220,7 @@ function getThemeBlockCSS(block?: ThemeBlock) { const rgb = parsedColor.rgb(); addVar(variable, rgb.string()); addVar(`${variable}-rgb`, rgb.array().join(', ')); - } catch (err) { + } catch { console.log('[theme] Failed to parse theme color', value); } }; diff --git a/packages/insomnia/src/sync/git/git-vcs.ts b/packages/insomnia/src/sync/git/git-vcs.ts index 7e9dea5ba16..bb3e26f8b08 100644 --- a/packages/insomnia/src/sync/git/git-vcs.ts +++ b/packages/insomnia/src/sync/git/git-vcs.ts @@ -103,7 +103,7 @@ function getInsomniaFileName(blob: void | Uint8Array | undefined): string { try { const parsed = parse(Buffer.from(blob).toString('utf-8')); return parsed?.fileName || parsed?.name || ''; - } catch (e) { + } catch { // If the document couldn't be parsed as yaml return an empty string return ''; } @@ -159,7 +159,7 @@ export class GitVCS { }); defaultBranch = mainRef?.target?.replace('refs/heads/', '') || 'main'; - } catch (err) { + } catch { // Ignore error } @@ -175,7 +175,7 @@ export class GitVCS { }); return remoteOriginURI; - } catch (err) { + } catch { // Ignore error return this._baseOpts.uri || ''; } @@ -384,7 +384,7 @@ export class GitVCS { try { return Buffer.from(blob).toString('utf-8'); - } catch (e) { + } catch { return null; } }); @@ -1033,7 +1033,7 @@ export class GitVCS { async repoExists() { try { await git.getConfig({ ...this._baseOpts, path: '' }); - } catch (err) { + } catch { return false; } diff --git a/packages/insomnia/src/sync/git/ne-db-client.ts b/packages/insomnia/src/sync/git/ne-db-client.ts index 271b37bd166..5991599c63c 100644 --- a/packages/insomnia/src/sync/git/ne-db-client.ts +++ b/packages/insomnia/src/sync/git/ne-db-client.ts @@ -213,14 +213,14 @@ export class NeDBClient { try { fileBuff = await this.readFile(filePath); - } catch (err) { + } catch { // console.log('[nedb] Failed to read file', err); } if (fileBuff === null) { try { dir = await this.readdir(filePath); - } catch (err) { + } catch { // console.log('[nedb] Failed to read dir', err); } } diff --git a/packages/insomnia/src/sync/git/project-ne-db-client.ts b/packages/insomnia/src/sync/git/project-ne-db-client.ts index 285ffacae98..f059fe8d9e8 100644 --- a/packages/insomnia/src/sync/git/project-ne-db-client.ts +++ b/packages/insomnia/src/sync/git/project-ne-db-client.ts @@ -61,7 +61,7 @@ export class GitProjectNeDBClient { } else { return raw; } - } catch (err) { + } catch { throw this._errMissing(filePath); } } @@ -163,14 +163,14 @@ export class GitProjectNeDBClient { let dir: string[] | null = null; try { fileBuff = await this.readFile(filePath); - } catch (err) { + } catch { // console.log('[nedb] Failed to read file', err); } if (fileBuff === null) { try { dir = await this.readdir(filePath); - } catch (err) { + } catch { // console.log('[nedb] Failed to read dir', err); } } diff --git a/packages/insomnia/src/sync/git/project-routable-fs-client.ts b/packages/insomnia/src/sync/git/project-routable-fs-client.ts index d2ae5f4cd74..2bb91030917 100644 --- a/packages/insomnia/src/sync/git/project-routable-fs-client.ts +++ b/packages/insomnia/src/sync/git/project-routable-fs-client.ts @@ -38,7 +38,7 @@ export function projectRoutableFSClient( let insomniaFiles = []; try { insomniaFiles = await insomniaFS.promises.readdir(filePath, ...args); - } catch (err) { + } catch { // console.log('[routablefs] Failed to execute', method, filePath, { args }, err); } @@ -59,7 +59,7 @@ export function projectRoutableFSClient( try { const result = await insomniaFS.promises[method]!(filePath, ...args); return result; - } catch (err) { + } catch { const result = await defaultFS.promises[method]!(filePath, ...args); return result; diff --git a/packages/insomnia/src/sync/store/drivers/graceful-rename.ts b/packages/insomnia/src/sync/store/drivers/graceful-rename.ts index 58abd16f6f3..e479d096f7a 100644 --- a/packages/insomnia/src/sync/store/drivers/graceful-rename.ts +++ b/packages/insomnia/src/sync/store/drivers/graceful-rename.ts @@ -35,7 +35,7 @@ async function renameWithRetry(source: string, target: string, startTime: number if (!stat.isFile()) { abortRetry = true; // if target is not a file, EPERM error may be raised and we should not attempt to retry } - } catch (error) { + } catch { // Ignore } diff --git a/packages/insomnia/src/sync/vcs/__tests__/vcs.test.ts b/packages/insomnia/src/sync/vcs/__tests__/vcs.test.ts index b42006594f7..4f134be293a 100644 --- a/packages/insomnia/src/sync/vcs/__tests__/vcs.test.ts +++ b/packages/insomnia/src/sync/vcs/__tests__/vcs.test.ts @@ -539,7 +539,7 @@ describe('VCS', () => { try { // @ts-expect-error intentionally invalid await v.removeBranch(); - } catch (err) { + } catch { didError = true; } @@ -552,7 +552,7 @@ describe('VCS', () => { try { await v.removeBranch('master'); - } catch (err) { + } catch { didError = true; } diff --git a/packages/insomnia/src/sync/vcs/vcs.ts b/packages/insomnia/src/sync/vcs/vcs.ts index eee152bce20..98cd327931b 100644 --- a/packages/insomnia/src/sync/vcs/vcs.ts +++ b/packages/insomnia/src/sync/vcs/vcs.ts @@ -211,7 +211,7 @@ export class VCS { try { previousBlobContent = await this.blobFromLastSnapshot(key); - } catch (e) { + } catch { // No previous blob found } finally { unstaged[key] = { @@ -224,7 +224,7 @@ export class VCS { let previousBlobContent: BaseModel | null = null; try { previousBlobContent = (await this._getBlob(blobId)) || null; - } catch (e) { + } catch { // No previous blob found } finally { unstaged[key] = { @@ -238,7 +238,7 @@ export class VCS { let previousBlobContent: BaseModel | null = null; try { previousBlobContent = 'blobContent' in stageEntry ? JSON.parse(stageEntry.blobContent) : {}; - } catch (e) { + } catch { // No previous blob found } finally { unstaged[key] = { @@ -772,7 +772,7 @@ export class VCS { try { mineBlobContent = conflict.mineBlob ? await this._getBlob(conflict.mineBlob) : null; theirsBlobContent = conflict.theirsBlob ? await this._getBlob(conflict.theirsBlob) : null; - } catch (e) { + } catch { // No previous blob found } return { diff --git a/packages/insomnia/src/ui/auth-session-provider.ts b/packages/insomnia/src/ui/auth-session-provider.ts index fbb52b80c27..e7c364de308 100644 --- a/packages/insomnia/src/ui/auth-session-provider.ts +++ b/packages/insomnia/src/ui/auth-session-provider.ts @@ -13,14 +13,14 @@ const sessionKeyPair = keyPair(); encodeBase64(sessionKeyPair.publicKey).then(res => { try { window.localStorage.setItem('insomnia.publicKey', getInsomniaPublicKey() || res); - } catch (error) { + } catch { console.error('Failed to store public key in localStorage.'); } }); encodeBase64(sessionKeyPair.secretKey).then(res => { try { window.localStorage.setItem('insomnia.secretKey', getInsomniaSecretKey() || res); - } catch (error) { + } catch { console.error('Failed to store secret key in localStorage.'); } }); diff --git a/packages/insomnia/src/ui/components/codemirror/code-editor.tsx b/packages/insomnia/src/ui/components/codemirror/code-editor.tsx index ced4b0ede43..22a234af379 100644 --- a/packages/insomnia/src/ui/components/codemirror/code-editor.tsx +++ b/packages/insomnia/src/ui/components/codemirror/code-editor.tsx @@ -68,7 +68,7 @@ const widget = (cm: CodeMirror.EditorFromTextArea | null, from: CodeMirror.Posit const endToken = squareBraceIsOutsideCurlyBrace ? ']' : '}'; const keys = Object.keys(JSON.parse(startToken + cm?.getRange(from, to) + endToken)); return keys.length ? `\u21A4 ${keys.length} \u21A6` : '\u2194'; - } catch (error) { + } catch { return '\u2194'; } }; @@ -225,7 +225,7 @@ export const CodeEditor = memo(forwardRef(({ } try { return vkBeautify.xml(code, indentChars); - } catch (error) { + } catch { // Failed to parse so just return original return code; } @@ -244,7 +244,7 @@ export const CodeEditor = memo(forwardRef(({ } } return jsonPrettify(jsonString, indentChars, autoPrettify); - } catch (error) { + } catch { // That's Ok, just leave it return code; } @@ -252,7 +252,7 @@ export const CodeEditor = memo(forwardRef(({ const prettifyEDN = (code: string) => { try { return ednPrettify(code); - } catch (error) { + } catch { return code; } }; diff --git a/packages/insomnia/src/ui/components/codemirror/lint/json-lint.ts b/packages/insomnia/src/ui/components/codemirror/lint/json-lint.ts index c9f082e5dd7..6f550527341 100644 --- a/packages/insomnia/src/ui/components/codemirror/lint/json-lint.ts +++ b/packages/insomnia/src/ui/components/codemirror/lint/json-lint.ts @@ -43,7 +43,7 @@ async function validator(text: string): Promise { if (renderedText) { try { jsonlint.parse(renderedText); - } catch (e) {} + } catch { } } return found; diff --git a/packages/insomnia/src/ui/components/editors/auth/o-auth-2-auth.tsx b/packages/insomnia/src/ui/components/editors/auth/o-auth-2-auth.tsx index 3395df9a432..21ced1fe939 100644 --- a/packages/insomnia/src/ui/components/editors/auth/o-auth-2-auth.tsx +++ b/packages/insomnia/src/ui/components/editors/auth/o-auth-2-auth.tsx @@ -302,7 +302,7 @@ const renderIdentityTokenExpiry = (token?: Pick) = try { decodedString = window.atob(base64Url); - } catch (error) { + } catch { return; } diff --git a/packages/insomnia/src/ui/components/editors/body/file-editor.tsx b/packages/insomnia/src/ui/components/editors/body/file-editor.tsx index c264ed029af..964ca08c32f 100644 --- a/packages/insomnia/src/ui/components/editors/body/file-editor.tsx +++ b/packages/insomnia/src/ui/components/editors/body/file-editor.tsx @@ -27,7 +27,7 @@ export const FileEditor: FC = ({ onChange, path }) => { try { const bytes = fs.statSync(path).size; sizeDescription = misc.describeByteSize(bytes); - } catch (error) { + } catch { sizeDescription = ''; } @@ -46,7 +46,7 @@ export const FileEditor: FC = ({ onChange, path }) => { Reset File -    +    diff --git a/packages/insomnia/src/ui/components/editors/body/graph-ql-editor.tsx b/packages/insomnia/src/ui/components/editors/body/graph-ql-editor.tsx index 387f7bfe56d..6e126775307 100644 --- a/packages/insomnia/src/ui/components/editors/body/graph-ql-editor.tsx +++ b/packages/insomnia/src/ui/components/editors/body/graph-ql-editor.tsx @@ -213,7 +213,7 @@ export const GraphQLEditor: FC = ({ let requestBody: GraphQLBody; try { requestBody = JSON.parse(request.body.text || ''); - } catch (err) { + } catch { requestBody = { query: '' }; } @@ -222,7 +222,7 @@ export const GraphQLEditor: FC = ({ let documentAST; try { documentAST = parse(requestBody.query || ''); - } catch (error) { + } catch { documentAST = null; } const operations = documentAST?.definitions.filter(isOperationDefinition)?.map(def => def.name?.value || '').filter(Boolean) || []; diff --git a/packages/insomnia/src/ui/components/editors/environment-key-value-editor/key-value-editor.tsx b/packages/insomnia/src/ui/components/editors/environment-key-value-editor/key-value-editor.tsx index b3e8bce0599..7d7812ca0f4 100644 --- a/packages/insomnia/src/ui/components/editors/environment-key-value-editor/key-value-editor.tsx +++ b/packages/insomnia/src/ui/components/editors/environment-key-value-editor/key-value-editor.tsx @@ -50,7 +50,7 @@ export const EnvironmentKVEditor = ({ data, onChange, vaultKey = '', isPrivate = // Ensure same array data will not generate different kvPairs to avoid flash issue // eslint-disable-next-line react-hooks/exhaustive-deps [JSON.stringify(data)] - ); const codeModalRef = useRef(null); + ); const codeModalRef = useRef(null); const [kvPairError, setKvPairError] = useState<{ id: string; error: string }[]>([]); const symmetricKey = vaultKey === '' ? {} : base64decode(vaultKey, true); @@ -173,7 +173,7 @@ export const EnvironmentKVEditor = ({ data, onChange, vaultKey = '', isPrivate = try { JSON.parse(input); return true; - } catch (error) { + } catch { return false; } }; diff --git a/packages/insomnia/src/ui/components/error-boundary.tsx b/packages/insomnia/src/ui/components/error-boundary.tsx index 512dc86f2a4..b6ee5ff0e5e 100644 --- a/packages/insomnia/src/ui/components/error-boundary.tsx +++ b/packages/insomnia/src/ui/components/error-boundary.tsx @@ -34,7 +34,7 @@ class SingleErrorBoundary extends PureComponent { try { componentName = firstChild.type.name; - } catch (err) { + } catch { // It's okay } @@ -49,7 +49,7 @@ class SingleErrorBoundary extends PureComponent {

), }); - } catch (err) { + } catch { // UI is so broken that we can't even show an alert } } diff --git a/packages/insomnia/src/ui/components/modals/cookies-modal.tsx b/packages/insomnia/src/ui/components/modals/cookies-modal.tsx index 24b03a47fbf..50202f28d77 100644 --- a/packages/insomnia/src/ui/components/modals/cookies-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/cookies-modal.tsx @@ -61,7 +61,7 @@ export const CookiesModal = ({ setIsOpen }: Props) => { for (const cookie of (activeCookieJar?.cookies || [])) { try { renderedCookies.push(await handleRender(cookie)); - } catch (err) { + } catch { renderedCookies.push(cookie); } } diff --git a/packages/insomnia/src/ui/components/modals/generate-code-modal.tsx b/packages/insomnia/src/ui/components/modals/generate-code-modal.tsx index 8a8927c62d7..25b56d55e5b 100644 --- a/packages/insomnia/src/ui/components/modals/generate-code-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/generate-code-modal.tsx @@ -49,11 +49,11 @@ export const GenerateCodeModal = forwardRef((pro let storedClient: HTTPSnippetClient | undefined; try { storedTarget = JSON.parse(window.localStorage.getItem('insomnia::generateCode::target') || '') as HTTPSnippetTarget; - } catch (error) { } + } catch { } try { storedClient = JSON.parse(window.localStorage.getItem('insomnia::generateCode::client') || '') as HTTPSnippetClient; - } catch (error) { } + } catch { } const [state, setState] = useState({ request: undefined, target: storedTarget, diff --git a/packages/insomnia/src/ui/components/modals/git-repository-settings-modal/github-repository-settings-form-group.tsx b/packages/insomnia/src/ui/components/modals/git-repository-settings-modal/github-repository-settings-form-group.tsx index c7abc91760b..7ffff7f6cd3 100644 --- a/packages/insomnia/src/ui/components/modals/git-repository-settings-modal/github-repository-settings-form-group.tsx +++ b/packages/insomnia/src/ui/components/modals/git-repository-settings-modal/github-repository-settings-form-group.tsx @@ -138,7 +138,7 @@ const GitHubRepositoryForm = ({ > Sign out - + {error && (

@@ -183,7 +183,7 @@ const GitHubSignInForm = () => { let parsedURL: URL; try { parsedURL = new URL(link); - } catch (error) { + } catch { setError('Invalid URL'); return; } diff --git a/packages/insomnia/src/ui/components/modals/git-repository-settings-modal/gitlab-repository-settings-form-group.tsx b/packages/insomnia/src/ui/components/modals/git-repository-settings-modal/gitlab-repository-settings-form-group.tsx index 5881c6f8a68..f6b2911af40 100644 --- a/packages/insomnia/src/ui/components/modals/git-repository-settings-modal/gitlab-repository-settings-form-group.tsx +++ b/packages/insomnia/src/ui/components/modals/git-repository-settings-modal/gitlab-repository-settings-form-group.tsx @@ -201,7 +201,7 @@ const GitLabSignInForm = () => { let parsedURL: URL; try { parsedURL = new URL(link); - } catch (error) { + } catch { setError('Invalid URL'); return; } diff --git a/packages/insomnia/src/ui/components/modals/upload-runner-data-modal.tsx b/packages/insomnia/src/ui/components/modals/upload-runner-data-modal.tsx index e94f01e4b9d..76a0e8834e4 100644 --- a/packages/insomnia/src/ui/components/modals/upload-runner-data-modal.tsx +++ b/packages/insomnia/src/ui/components/modals/upload-runner-data-modal.tsx @@ -69,7 +69,7 @@ export const UploadDataModal = ({ onUploadFile, onClose, userUploadData }: Uploa } else { setInvalidFileReason('Invalid JSON file uploaded, JSON file must be array of key-value pairs.'); } - } catch (error) { + } catch { setInvalidFileReason('Upload JSON file can not be parsed'); } } else if (fileType === 'text/csv') { diff --git a/packages/insomnia/src/ui/components/panes/request-pane.tsx b/packages/insomnia/src/ui/components/panes/request-pane.tsx index b4146891a52..2770257ab22 100644 --- a/packages/insomnia/src/ui/components/panes/request-pane.tsx +++ b/packages/insomnia/src/ui/components/panes/request-pane.tsx @@ -54,7 +54,7 @@ export const RequestPane: FC = ({ try { query = extractQueryStringFromUrl(activeRequest.url); - } catch (error) { + } catch { console.warn('Failed to parse url to import querystring'); return; } diff --git a/packages/insomnia/src/ui/components/templating/local-template-tags.ts b/packages/insomnia/src/ui/components/templating/local-template-tags.ts index 22a12bed5c5..b6b907c7295 100644 --- a/packages/insomnia/src/ui/components/templating/local-template-tags.ts +++ b/packages/insomnia/src/ui/components/templating/local-template-tags.ts @@ -198,7 +198,7 @@ const localTemplatePlugins: { templateTag: PluginTemplateTag }[] = [ try { const results = JSONPath({ json: value, path: filter }); value = Array.isArray(results) ? results[0] : results; - } catch (err) { } + } catch { } } if (typeof value !== 'string') { @@ -306,7 +306,7 @@ const localTemplatePlugins: { templateTag: PluginTemplateTag }[] = [ if (!Array.isArray(results)) { results = [results]; } - } catch (err) { + } catch { throw new Error(`Invalid JSONPath query: ${filter}`); } @@ -735,7 +735,7 @@ const localTemplatePlugins: { templateTag: PluginTemplateTag }[] = [ if (!Array.isArray(results)) { results = [results]; } - } catch (err) { + } catch { throw new Error(`Invalid JSONPath query: ${sanitizedFilter}`); } @@ -793,7 +793,7 @@ const localTemplatePlugins: { templateTag: PluginTemplateTag }[] = [ } return results[0].inner; - } catch (err) { + } catch { throw new Error(`Invalid XPath query: ${sanitizedFilter}`); } } diff --git a/packages/insomnia/src/ui/components/toast.tsx b/packages/insomnia/src/ui/components/toast.tsx index 02da671f0b6..0f493bfe928 100644 --- a/packages/insomnia/src/ui/components/toast.tsx +++ b/packages/insomnia/src/ui/components/toast.tsx @@ -40,7 +40,7 @@ export const Toast: FC = () => { if (storedKeys) { seenNotifications = JSON.parse(storedKeys) as SeenNotifications || {}; } - } catch (e) { } + } catch { } console.log(`[toast] Received notification ${notification.key}`); if (seenNotifications[notification.key]) { console.log(`[toast] Not showing notification ${notification.key} because has already been seen`); diff --git a/packages/insomnia/src/ui/components/viewers/response-cookies-viewer.tsx b/packages/insomnia/src/ui/components/viewers/response-cookies-viewer.tsx index 8e957d89374..b8fe7060ca4 100644 --- a/packages/insomnia/src/ui/components/viewers/response-cookies-viewer.tsx +++ b/packages/insomnia/src/ui/components/viewers/response-cookies-viewer.tsx @@ -16,7 +16,7 @@ export const ResponseCookiesViewer: FC = props => { try { cookie = h ? Cookie.parse(h.value || '', { loose: true }) : null; - } catch (err) { + } catch { console.warn('Failed to parse set-cookie header', h); } diff --git a/packages/insomnia/src/ui/components/viewers/response-viewer.tsx b/packages/insomnia/src/ui/components/viewers/response-viewer.tsx index 553851aed8f..0839ad4a33d 100644 --- a/packages/insomnia/src/ui/components/viewers/response-viewer.tsx +++ b/packages/insomnia/src/ui/components/viewers/response-viewer.tsx @@ -127,7 +127,7 @@ export const ResponseViewer = ({ JSON.parse(overSizedBody.toString('utf8')); return 'application/json'; } - } catch (error) { } + } catch { } // Try to detect HTML in all cases (even if header is set). // It is fairly common for webservers to send errors in HTML by default. // NOTE: This will probably never throw but I'm not 100% so wrap anyway @@ -144,7 +144,7 @@ export const ResponseViewer = ({ ) { return 'text/html'; } - } catch (error) { } + } catch { } return lowercasedOriginalContentType; }, [originalContentType, overSizedBody]); @@ -245,7 +245,7 @@ export const ResponseViewer = ({ // So we try to use the native JSON.stringify to prettify the json string better. The native way can handle the issue. try { bodyStr = JSON.stringify(JSON.parse(bodyStr)); - } catch (err) { } + } catch { } return ( = ({ environment }) => { try { query = extractQueryStringFromUrl(activeRequest.url); - } catch (error) { + } catch { console.warn('Failed to parse url to import querystring'); return; } @@ -391,44 +391,44 @@ export const WebSocketRequestPane: FC = ({ environment }) => {

Path parameters - {pathParameters.length > 0 && ( + {pathParameters.length > 0 && (
-
- {pathParameters.map(pathParameter => ( - - - {pathParameter.name} - -
- { - onPathParameterChange(pathParameters.map(p => p.name === pathParameter.name ? { ...p, value: name } : p)); - }} - /> -
-
- ))} +
+ {pathParameters.map(pathParameter => ( + + + {pathParameter.name} + +
+ { + onPathParameterChange(pathParameters.map(p => p.name === pathParameter.name ? { ...p, value: name } : p)); + }} + /> +
+
+ ))} +
-
- )} - {pathParameters.length === 0 && !dismissPathParameterTip && ( -
- - Path parameters are url path segments that start with a colon ':' e.g. ':id' - -
- )} -
+ )} + {pathParameters.length === 0 && !dismissPathParameterTip && ( +
+ + Path parameters are url path segments that start with a colon ':' e.g. ':id' + +
+ )} + diff --git a/packages/insomnia/src/ui/insomniaFetch.ts b/packages/insomnia/src/ui/insomniaFetch.ts index 4c9ac789b91..27a309fce16 100644 --- a/packages/insomnia/src/ui/insomniaFetch.ts +++ b/packages/insomnia/src/ui/insomniaFetch.ts @@ -72,7 +72,7 @@ export async function insomniaFetch({ if (typeof json?.message === 'string') { errMsg = json.message; } - } catch (err) {} + } catch { } } throw new ResponseFailError(errMsg, response); } diff --git a/packages/insomnia/src/ui/routes/actions.tsx b/packages/insomnia/src/ui/routes/actions.tsx index bd81848f43b..347d7a5a289 100644 --- a/packages/insomnia/src/ui/routes/actions.tsx +++ b/packages/insomnia/src/ui/routes/actions.tsx @@ -1389,7 +1389,7 @@ export const accessAIApiAction: ActionFunction = async ({ params }) => { return { enabled: response.enabled, }; - } catch (err) { + } catch { return { enabled: false }; } }; diff --git a/packages/insomnia/src/ui/routes/commands.tsx b/packages/insomnia/src/ui/routes/commands.tsx index 982ef970315..f7fd3262fe1 100644 --- a/packages/insomnia/src/ui/routes/commands.tsx +++ b/packages/insomnia/src/ui/routes/commands.tsx @@ -340,7 +340,7 @@ export const remoteFilesLoader: LoaderFunction = async (): Promise { let spec = {}; try { spec = parseApiSpec(text).contents || {}; - } catch (err) { } + } catch { } SwaggerUIBundle({ spec, dom_id: '#swagger-ui' }); }, [text]); return ( @@ -468,47 +468,47 @@ const Design: FC = () => {
- - - - - - - - - - - -
-
- setEnvironmentModalOpen(true)} - /> -
- - +
diff --git a/packages/insomnia/src/ui/routes/import.tsx b/packages/insomnia/src/ui/routes/import.tsx index 0af2a229059..58289efdb00 100644 --- a/packages/insomnia/src/ui/routes/import.tsx +++ b/packages/insomnia/src/ui/routes/import.tsx @@ -44,7 +44,7 @@ export const scanForResourcesAction: ActionFunction = async ({ request }): Promi if (filePaths.length === 0) { throw new Error(); } - } catch (err) { + } catch { return [{ errors: ['File is required'], }]; diff --git a/packages/insomnia/src/ui/routes/invite.tsx b/packages/insomnia/src/ui/routes/invite.tsx index 2f8234b05a2..d11d7e35df1 100644 --- a/packages/insomnia/src/ui/routes/invite.tsx +++ b/packages/insomnia/src/ui/routes/invite.tsx @@ -96,7 +96,7 @@ export const collaboratorSearchLoader: LoaderFunction = async ({ params, request }); return collaboratorsSearchList; - } catch (err) { + } catch { return []; } }; @@ -118,7 +118,7 @@ export const reinviteCollaboratorAction: ActionFunction = async ({ params }) => }); return response; - } catch (err) { + } catch { throw new Error('Failed to reinvite member. Please try again.'); } }; @@ -146,7 +146,7 @@ export const updateInvitationRoleAction: ActionFunction = async ({ request, para }); return response; - } catch (err) { + } catch { throw new Error('Failed to reinvite member. Please try again.'); } }; @@ -174,7 +174,7 @@ export const updateMemberRoleAction: ActionFunction = async ({ request, params } }); return response; - } catch (err) { + } catch { throw new Error('Failed to update organization member roles'); } }; diff --git a/packages/insomnia/src/ui/routes/organization.tsx b/packages/insomnia/src/ui/routes/organization.tsx index d150e9a5f4f..6569cc60bbb 100644 --- a/packages/insomnia/src/ui/routes/organization.tsx +++ b/packages/insomnia/src/ui/routes/organization.tsx @@ -453,7 +453,7 @@ export const organizationPermissionsLoader: LoaderFunction = async ({ params }): featuresPromise: featuresResponse.then(res => res?.features || fallbackFeatures), billingPromise: featuresResponse.then(res => res?.billing || fallbackBilling), }; - } catch (err) { + } catch { return { featuresPromise: Promise.resolve(fallbackFeatures), billingPromise: Promise.resolve(fallbackBilling), @@ -647,107 +647,107 @@ const OrganizationRoute = () => { return ( -
-
+
+
{!isMinimal &&
-
-
- +
+
+
- {!user ? : null} + {!user ? : null}
-
- {user ? ( - - - - - - ) : ( - - - Login - - +
+ {user ? ( + + + + + + ) : ( + + + Login + + Sign up for free - - - )} -
-
} - {isScratchPadBannerVisible ? ( -
-
-
- -
+ + + )}
-
-

- Welcome to the Scratch Pad where you can work locally with up to 1 collection. - To create more and see your projects - {' '} - - login or create an account → - -

+ } + {isScratchPadBannerVisible ? ( +
+
+
+ +
+
+
+

+ Welcome to the Scratch Pad where you can work locally with up to 1 collection. + To create more and see your projects + {' '} + + login or create an account → + +

+
+
- -
- ) : null} - {isOrganizationSidebarOpen &&
- -
} -
+ + + Join an organization + + + + Create a new organization + + + + + +
} +
-
-
-
- - - {({ isSelected }) => { - return ( - - {isSelected ? ( - - ) : ( - - )} - - ); - }} - - - Toggle organizations sidebar - - - - { - setIsMinimal(!flag); - }} - isSelected={!isMinimal} - > - {({ isSelected }) => { - return ( - - {isSelected ? ( - - ) : ( - - )} - - ); - }} - - - Toggle header - -
-
-
+
+
- + {({ isSelected }) => { + return ( + + {isSelected ? ( + + ) : ( + + )} + + ); + }} + - Preferences - + Toggle organizations sidebar - {(hasUntrackedData && !isMinimal) ?
- -
: null} - {(hasUntrackedData && isMinimal) ? ( - + {({ isSelected }) => { + return ( + + {isSelected ? ( + + ) : ( + + )} + + ); + }} + + + Toggle header + + +
+
+
+ - We have detected orphaned projects on your computer, click here to view them. + Preferences + - ) : null} - {isMinimal && } -
-
- {isMinimal && ( - - )} -
-
-
- {loadingAI && ( - + - - Generating tests with Insomnia AI - - - )} - - )} - {!isMinimal && } - {!isMinimal && ( - - We have detected orphaned projects on your computer, click here to view them. + +
: null} + {(hasUntrackedData && isMinimal) ? ( + + + - Made with - by - Kong - - + We have detected orphaned projects on your computer, click here to view them. + + + ) : null} + {isMinimal && } +
+
+ {isMinimal && ( + )}
- {isMinimal && ( -
- {user ? ( - - - - - - ) : ( - - - Login - - +
+ {loadingAI && ( + + {({ percentage }) => ( + + + + Generating tests with Insomnia AI + + + )} + + )} + {!isMinimal && } + {!isMinimal && ( + + - Sign up for free - - + Made with + by + Kong + + )}
- )} + {isMinimal && ( +
+ {user ? ( + + + + + + ) : ( + + + Login + + + Sign up for free + + + )} +
+ )} +
+
- -
); diff --git a/packages/insomnia/src/ui/routes/project.tsx b/packages/insomnia/src/ui/routes/project.tsx index 57ac77e9595..119a1f5b9da 100644 --- a/packages/insomnia/src/ui/routes/project.tsx +++ b/packages/insomnia/src/ui/routes/project.tsx @@ -236,7 +236,7 @@ export const indexLoader: LoaderFunction = async ({ params }) => { try { await syncProjects(organizationId); - } catch (err) { + } catch { console.log('[project] Could not fetch remote projects.'); } const initialOrganizationRoute = await getInitialRouteForOrganization({ organizationId }); @@ -325,7 +325,7 @@ async function getAllLocalFiles({ spec = result.contents; specFormat = result.format; specFormatVersion = result.formatVersion; - } catch (err) { + } catch { // Assume there is no spec // TODO: Check for parse errors if it's an invalid spec } @@ -505,7 +505,7 @@ const getLearningFeature = async (fallbackLearningFeature: LearningFeature) => { sessionId: '', }); window.localStorage.setItem('learning-feature-last-fetch', Date.now().toString()); - } catch (err) { + } catch { console.log('[project] Could not fetch learning feature data.'); } } diff --git a/packages/insomnia/src/ui/routes/remote-collections.tsx b/packages/insomnia/src/ui/routes/remote-collections.tsx index 05b38ec0504..3bdfaba0ad7 100644 --- a/packages/insomnia/src/ui/routes/remote-collections.tsx +++ b/packages/insomnia/src/ui/routes/remote-collections.tsx @@ -304,8 +304,8 @@ export const syncDataAction: ActionFunction = async ({ params }) => { export type SyncDataLoaderData = | SyncData | { - error: string; - }; + error: string; + }; export const syncDataLoader: LoaderFunction = async ({ params, @@ -357,7 +357,7 @@ export const syncDataLoader: LoaderFunction = async ({ hasUncommittedChanges, hasUnpushedChanges: compare?.ahead > 0, }); - } catch (e) { } + } catch { } return { syncItems, @@ -492,7 +492,7 @@ export const deleteBranchAction: ActionFunction = async ({ await vcs.removeRemoteBranch(branch); try { await vcs.removeBranch(branch); - } catch (err) { + } catch { // Branch doesn't exist locally, ignore } diff --git a/packages/insomnia/src/ui/routes/root.tsx b/packages/insomnia/src/ui/routes/root.tsx index 6709607d523..3bf1f7b99d3 100644 --- a/packages/insomnia/src/ui/routes/root.tsx +++ b/packages/insomnia/src/ui/routes/root.tsx @@ -67,7 +67,7 @@ const Root = () => { let parsedUrl; try { parsedUrl = new URL(url); - } catch (err) { + } catch { console.log('[deep-link] Invalid args, expected insomnia://x/y/z', url); return; } diff --git a/packages/insomnia/src/ui/routes/runner.tsx b/packages/insomnia/src/ui/routes/runner.tsx index 8681572d19c..90d834b1850 100644 --- a/packages/insomnia/src/ui/routes/runner.tsx +++ b/packages/insomnia/src/ui/routes/runner.tsx @@ -449,7 +449,7 @@ export const Runner: FC<{}> = () => { if (parseInt(e.target.value, 10) > 0) { updateRunnerState(organizationId, runnerId, { iterationCount: parseInt(e.target.value, 10) }); } - } catch (ex) { } + } catch { } }} type='number' className={iterationInputStyle} @@ -467,7 +467,7 @@ export const Runner: FC<{}> = () => { if (delay >= 0) { updateRunnerState(organizationId, runnerId, { delay }); // also update the temp settings } - } catch (ex) { } + } catch { } }} type='number' className={inputStyle} diff --git a/packages/insomnia/src/utils/graph-ql.ts b/packages/insomnia/src/utils/graph-ql.ts index bf31fa1b59c..0a26abfeb63 100644 --- a/packages/insomnia/src/utils/graph-ql.ts +++ b/packages/insomnia/src/utils/graph-ql.ts @@ -26,7 +26,7 @@ export function getOperationType(request: Request) { try { requestBody = JSON.parse(request.body.text || ''); documentAST = parse(requestBody?.query || ''); - } catch (error) { + } catch { documentAST = null; } if (documentAST) { diff --git a/packages/insomnia/src/utils/importers/importers/curl.ts b/packages/insomnia/src/utils/importers/importers/curl.ts index 99d48907fde..c89801679f0 100644 --- a/packages/insomnia/src/utils/importers/importers/curl.ts +++ b/packages/insomnia/src/utils/importers/importers/curl.ts @@ -107,7 +107,7 @@ const importCommand = (parseEntries: ParseEntry[]): ImportRequest => { })); url = href.replace(search, '').replace(/\/$/, ''); - } catch (error) {} + } catch { } /// /////// Authentication ////////// const [username, password] = getPairValue(pairsByName, '', [ diff --git a/packages/insomnia/src/utils/importers/importers/har.ts b/packages/insomnia/src/utils/importers/importers/har.ts index 57d0599d3c0..126ab138be9 100644 --- a/packages/insomnia/src/utils/importers/importers/har.ts +++ b/packages/insomnia/src/utils/importers/importers/har.ts @@ -110,7 +110,7 @@ export const convert: Converter = rawData => { const data = JSON.parse(rawData); const requests = extractRequests(data); return requests.map(importRequest); - } catch (error) { + } catch { return null; } }; diff --git a/packages/insomnia/src/utils/importers/importers/insomnia-1.ts b/packages/insomnia/src/utils/importers/importers/insomnia-1.ts index 41877b0fa77..b90e7bbda10 100644 --- a/packages/insomnia/src/utils/importers/importers/insomnia-1.ts +++ b/packages/insomnia/src/utils/importers/importers/insomnia-1.ts @@ -27,12 +27,12 @@ interface Item { }; headers?: Header[]; body: - | string - | { - mimeType: string; - text?: string; - params?: Parameter[]; - }; + | string + | { + mimeType: string; + text?: string; + params?: Parameter[]; + }; params: Parameter[]; url?: string; method?: string; @@ -147,7 +147,7 @@ export const convert: Converter = rawData => { try { data = JSON.parse(rawData) as Insomnia1Data; - } catch (error) { + } catch { return null; } diff --git a/packages/insomnia/src/utils/importers/importers/insomnia-2.ts b/packages/insomnia/src/utils/importers/importers/insomnia-2.ts index d3092b44327..4a9830d0dad 100644 --- a/packages/insomnia/src/utils/importers/importers/insomnia-2.ts +++ b/packages/insomnia/src/utils/importers/importers/insomnia-2.ts @@ -15,7 +15,7 @@ export const convert: Converter = rawData => { try { data = JSON.parse(rawData) as Insomnia2Data; - } catch (error) { + } catch { return null; } diff --git a/packages/insomnia/src/utils/importers/importers/insomnia-3.ts b/packages/insomnia/src/utils/importers/importers/insomnia-3.ts index 9b0bd7dc7e2..354af11249f 100644 --- a/packages/insomnia/src/utils/importers/importers/insomnia-3.ts +++ b/packages/insomnia/src/utils/importers/importers/insomnia-3.ts @@ -14,7 +14,7 @@ export const convert: Converter = rawData => { try { data = JSON.parse(rawData) as Insomnia3Data; - } catch (error) { + } catch { return null; } diff --git a/packages/insomnia/src/utils/importers/importers/insomnia-4.ts b/packages/insomnia/src/utils/importers/importers/insomnia-4.ts index 456365a5ba9..99a25a4487d 100644 --- a/packages/insomnia/src/utils/importers/importers/insomnia-4.ts +++ b/packages/insomnia/src/utils/importers/importers/insomnia-4.ts @@ -19,7 +19,7 @@ export const convert: Converter = rawData => { try { data = YAML.parse(rawData); - } catch (error) { + } catch { return null; } diff --git a/packages/insomnia/src/utils/importers/importers/openapi-3.ts b/packages/insomnia/src/utils/importers/importers/openapi-3.ts index 008ed3ffff9..8c1cc4fc9e2 100644 --- a/packages/insomnia/src/utils/importers/importers/openapi-3.ts +++ b/packages/insomnia/src/utils/importers/importers/openapi-3.ts @@ -112,7 +112,7 @@ const parseDocument = (rawData: string): OpenAPIV3.Document | null => { try { return (unthrowableParseJson(rawData) || YAML.parse(rawData)) as OpenAPIV3.Document; - } catch (err) { + } catch { return null; } }; diff --git a/packages/insomnia/src/utils/importers/importers/postman-env.ts b/packages/insomnia/src/utils/importers/importers/postman-env.ts index 47830677c14..be84be199e0 100644 --- a/packages/insomnia/src/utils/importers/importers/postman-env.ts +++ b/packages/insomnia/src/utils/importers/importers/postman-env.ts @@ -56,7 +56,7 @@ export const convert: Converter = rawData => { }, }, ]; - } catch (error) { + } catch { // Nothing } diff --git a/packages/insomnia/src/utils/importers/importers/postman.ts b/packages/insomnia/src/utils/importers/importers/postman.ts index df3a9f81ad2..5bf0b4caeef 100644 --- a/packages/insomnia/src/utils/importers/importers/postman.ts +++ b/packages/insomnia/src/utils/importers/importers/postman.ts @@ -970,7 +970,7 @@ export const convert: Converter = rawData => { })); return ordered; } - } catch (error) { + } catch { // Nothing } diff --git a/packages/insomnia/src/utils/importers/importers/swagger-2.ts b/packages/insomnia/src/utils/importers/importers/swagger-2.ts index 3c915f47a40..ac279a6e072 100644 --- a/packages/insomnia/src/utils/importers/importers/swagger-2.ts +++ b/packages/insomnia/src/utils/importers/importers/swagger-2.ts @@ -49,7 +49,7 @@ const importFolderItem = (parentId: string) => ( const parseDocument = (rawData: string) => { try { return unthrowableParseJson(rawData) || YAML.parse(rawData); - } catch (err) { + } catch { return null; } }; diff --git a/packages/insomnia/src/utils/importers/importers/wsdl.ts b/packages/insomnia/src/utils/importers/importers/wsdl.ts index aed66126b6e..d89b9a85eee 100644 --- a/packages/insomnia/src/utils/importers/importers/wsdl.ts +++ b/packages/insomnia/src/utils/importers/importers/wsdl.ts @@ -17,7 +17,7 @@ const pathToSwagger = (swagger: any, path: string[]) => { return path.reduce((acc, v: string) => { try { acc = acc[v]; - } catch (e) { + } catch { return undefined; } return acc; diff --git a/packages/insomnia/src/utils/importers/utils.ts b/packages/insomnia/src/utils/importers/utils.ts index efecfa28639..3b61d3e97c6 100644 --- a/packages/insomnia/src/utils/importers/utils.ts +++ b/packages/insomnia/src/utils/importers/utils.ts @@ -43,7 +43,7 @@ export const setDefaults = (obj: ImportRequest | null) => { export const unthrowableParseJson = (rawData: string) => { try { return JSON.parse(rawData); - } catch (err) { + } catch { return null; } }; diff --git a/packages/insomnia/src/utils/prettify/json.ts b/packages/insomnia/src/utils/prettify/json.ts index c7a61e7aeb8..e857ae9812f 100644 --- a/packages/insomnia/src/utils/prettify/json.ts +++ b/packages/insomnia/src/utils/prettify/json.ts @@ -35,7 +35,7 @@ function ensureStringify(val?: string | Object): string { if (typeof val === 'object') { try { defaultVal = JSON.stringify(val); - } catch (error) { + } catch { // If we can't stringify, just return the default } diff --git a/packages/insomnia/src/utils/router.ts b/packages/insomnia/src/utils/router.ts index 695a48c71dc..349aefb3f49 100644 --- a/packages/insomnia/src/utils/router.ts +++ b/packages/insomnia/src/utils/router.ts @@ -102,7 +102,7 @@ export const getInitialEntry = async () => { if (lastVisitedOrganizationId && organizations.find(o => o.id === lastVisitedOrganizationId)) { organizationId = lastVisitedOrganizationId; } - } catch (e) { } + } catch { } return { pathname: await getInitialRouteForOrganization({ organizationId, navigateToWorkspace: true }), @@ -118,7 +118,7 @@ export const getInitialEntry = async () => { } return '/organization/org_scratchpad/project/proj_scratchpad/workspace/wrk_scratchpad/debug'; - } catch (e) { + } catch { return '/organization/org_scratchpad/project/proj_scratchpad/workspace/wrk_scratchpad/debug'; } }; diff --git a/packages/insomnia/src/utils/url/querystring.ts b/packages/insomnia/src/utils/url/querystring.ts index 4215dd6f7c9..d9bb8aa3227 100644 --- a/packages/insomnia/src/utils/url/querystring.ts +++ b/packages/insomnia/src/utils/url/querystring.ts @@ -168,7 +168,7 @@ export const deconstructQueryStringToParams = ( let name = ''; try { name = decodeURIComponent(encodedName || ''); - } catch (error) { + } catch { // Just leave it name = encodedName; } @@ -176,7 +176,7 @@ export const deconstructQueryStringToParams = ( let value: ValueType = ''; try { value = (strictNullHandling && encodedValue === null) ? null : decodeURIComponent(encodedValue || ''); - } catch (error) { + } catch { // Just leave it value = encodedValue; } diff --git a/packages/insomnia/src/utils/vault.ts b/packages/insomnia/src/utils/vault.ts index dfb23022eea..8e70e300d08 100644 --- a/packages/insomnia/src/utils/vault.ts +++ b/packages/insomnia/src/utils/vault.ts @@ -14,7 +14,7 @@ export const base64decode = (base64Str: string, toObject: boolean) => { return JSON.parse(decodedStr); } return decodedStr; - } catch (error) { + } catch { console.error(`failed to base64 decode string ${base64Str}`); } return base64Str; From 27b6a888ec6c1f95530e7d09e4a6a98e7575d5d2 Mon Sep 17 00:00:00 2001 From: gatzjames Date: Thu, 27 Mar 2025 12:07:35 +0100 Subject: [PATCH 3/9] tsx errors --- .../components/proto-file/proto-file-list.tsx | 189 +++++++++--------- .../insomnia/src/ui/hooks/use-state-ref.ts | 7 +- 2 files changed, 98 insertions(+), 98 deletions(-) diff --git a/packages/insomnia/src/ui/components/proto-file/proto-file-list.tsx b/packages/insomnia/src/ui/components/proto-file/proto-file-list.tsx index eb2d0e3e8bd..5c75b591159 100644 --- a/packages/insomnia/src/ui/components/proto-file/proto-file-list.tsx +++ b/packages/insomnia/src/ui/components/proto-file/proto-file-list.tsx @@ -36,105 +36,106 @@ const recursiveRender = ( handleDeleteDirectory: DeleteProtoDirectoryHandler, selectedId?: string ): React.ReactNode => [ - dir && ( -
  • - - - {dir.name} - - {indent === 0 && ( -
    - -
    - )} -
  • - ), - ...files.map(f => ( -
  • handleSelect(f._id)} - > - <> - { - if (isSelected) { - handleSelect(f._id); - } else { - handleUnselect(f._id); - } - }} - > - {({ isSelected }) => { - return <> - {isSelected ? - : - - } - ; - }} - + dir && ( +
  • - - {f.name} + + {dir.name} -
    - +
    + )} +
  • + ), + ...files.map(f => ( +
  • handleSelect(f._id)} + > + <> + { + if (isSelected) { + handleSelect(f._id); + } else { + handleUnselect(f._id); + } }} - className="space-right" > - - - -
  • - - - )), - ...subDirs.map(sd => - recursiveRender( - indent + 1, - sd, - handleSelect, - handleUnselect, - handleUpdate, - handleDelete, - handleDeleteDirectory, - selectedId - ) - ), -]; + + + + {f.name} + +
    + + +
    + + + )), + ...subDirs.map(sd => + recursiveRender( + indent + 1, + sd, + handleSelect, + handleUnselect, + handleUpdate, + handleDelete, + handleDeleteDirectory, + selectedId + ) + ), + ]; export const ProtoFileList: FunctionComponent = props => (
      diff --git a/packages/insomnia/src/ui/hooks/use-state-ref.ts b/packages/insomnia/src/ui/hooks/use-state-ref.ts index f04c635963a..bc1e7ba31d2 100644 --- a/packages/insomnia/src/ui/hooks/use-state-ref.ts +++ b/packages/insomnia/src/ui/hooks/use-state-ref.ts @@ -8,11 +8,10 @@ interface ReadOnlyRefObject { readonly current: T; } -// eslint-disable-next-line @typescript-eslint/consistent-type-definitions -type UseStateRef = { +interface UseStateRef { (initialState: S | (() => S)): [S, Dispatch>, ReadOnlyRefObject]; - (): [S | undefined, Dispatch>, ReadOnlyRefObject]; -}; + (): [T | undefined, Dispatch>, ReadOnlyRefObject]; +} const useStateRef: UseStateRef = (initialState?: S | (() => S)) => { const [state, setState] = useState(initialState); From 6d0271fb1fdec7bd8d39a5ef93202e938e5c4a17 Mon Sep 17 00:00:00 2001 From: gatzjames Date: Thu, 27 Mar 2025 12:07:53 +0100 Subject: [PATCH 4/9] add fix on save --- .vscode/settings.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index 95e8aaa7316..3b975064b0d 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -9,7 +9,7 @@ "editor.formatOnSave": true, "editor.formatOnSaveMode": "file", "editor.codeActionsOnSave": { - "source.fixAll.eslint": "always", + "source.fixAll.oxc": "always", "source.fixAll.ts": "always" }, "editor.defaultFormatter": "vscode.typescript-language-features", From a75941db89a63ef1f01c4da447cc75a44515433a Mon Sep 17 00:00:00 2001 From: gatzjames Date: Thu, 27 Mar 2025 12:08:33 +0100 Subject: [PATCH 5/9] cleanup pkg json files --- package-lock.json | 957 +++++-------------------- package.json | 15 +- packages/insomnia-inso/package.json | 2 +- packages/insomnia-testing/package.json | 2 +- packages/insomnia/package.json | 2 +- 5 files changed, 196 insertions(+), 782 deletions(-) diff --git a/package-lock.json b/package-lock.json index e87ca1f82b2..7ebd44caff5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,15 +30,7 @@ "@typescript-eslint/parser": "^7.5.0", "esbuild": "^0.24.0", "esbuild-runner": "^2.2.2", - "eslint": "^8.57.0", - "eslint-config-helpers": "^1.2.0", - "eslint-plugin-filenames": "^1.3.2", - "eslint-plugin-html": "^8.0.0", - "eslint-plugin-import": "^2.29.1", - "eslint-plugin-json": "^3.1.0", - "eslint-plugin-react": "^7.34.1", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-simple-import-sort": "^12.0.0", + "oxlint": "^0.16.3", "tslib": "2.0.1", "type-fest": "^4.15.0", "typescript": "^5.6.2", @@ -1362,6 +1354,7 @@ "integrity": "sha512-269Z39MS6wVJtsoUl10L60WdkhJVdPG24Q4eZTH3nnF6lpvSShEK3wQjDX9JRWAUPvPh7COouPpU9IrqaZFvtQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "ajv": "^6.12.4", "debug": "^4.3.2", @@ -1386,6 +1379,7 @@ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -1402,7 +1396,8 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, - "license": "Python-2.0" + "license": "Python-2.0", + "peer": true }, "node_modules/@eslint/eslintrc/node_modules/globals": { "version": "13.24.0", @@ -1410,6 +1405,7 @@ "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "type-fest": "^0.20.2" }, @@ -1426,6 +1422,7 @@ "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "argparse": "^2.0.1" }, @@ -1438,7 +1435,8 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/@eslint/eslintrc/node_modules/type-fest": { "version": "0.20.2", @@ -1446,6 +1444,7 @@ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, "license": "(MIT OR CC0-1.0)", + "peer": true, "engines": { "node": ">=10" }, @@ -1459,6 +1458,7 @@ "integrity": "sha512-d9zaMRSTIKDLhctzH12MtXvJKSSUhaHcjV+2Z+GK+EEY7XKpP5yR4x+N3TAcHTcu963nIr+TMcCb4DBCYX1z6Q==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } @@ -1778,6 +1778,7 @@ "deprecated": "Use @eslint/config-array instead", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "@humanwhocodes/object-schema": "^2.0.3", "debug": "^4.3.1", @@ -1793,6 +1794,7 @@ "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, "license": "Apache-2.0", + "peer": true, "engines": { "node": ">=12.22" }, @@ -1807,7 +1809,8 @@ "integrity": "sha512-93zYdMES/c1D69yZiKDBj0V24vqNzB/koF26KPaagAfd3P/4gUlh3Dys5ogAK+Exi9QyzlD8x/08Zt7wIKcDcA==", "deprecated": "Use @eslint/object-schema instead", "dev": true, - "license": "BSD-3-Clause" + "license": "BSD-3-Clause", + "peer": true }, "node_modules/@internationalized/date": { "version": "3.5.5", @@ -2927,6 +2930,118 @@ "@opentelemetry/api": "^1.1.0" } }, + "node_modules/@oxlint/darwin-arm64": { + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/@oxlint/darwin-arm64/-/darwin-arm64-0.16.3.tgz", + "integrity": "sha512-X0VSK4mjPWJTzNHTExFlN+MdEVbxhdl/fXSLDKPf8Sm46ebY7qat8Df06Z0fncZc1+aDAb32xDy0U3cnUA1vgg==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxlint/darwin-x64": { + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/@oxlint/darwin-x64/-/darwin-x64-0.16.3.tgz", + "integrity": "sha512-/fTRMu2wjSbp9ai6jFlNSOME3Eoq9+7W9JpGyi7s3vht5PnqKVSCZVXaawEAlHgFIlcwi9MZHbRo6GDsqfZnuw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ] + }, + "node_modules/@oxlint/linux-arm64-gnu": { + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/@oxlint/linux-arm64-gnu/-/linux-arm64-gnu-0.16.3.tgz", + "integrity": "sha512-t1xtcbHoJGpE/0oRA8z2/szBB0gHGy0eua0ko57Lo1LscHiyvkmpqPJTiaR8+1b+EbGO8KKgLcKDoxqvmIqDbA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxlint/linux-arm64-musl": { + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/@oxlint/linux-arm64-musl/-/linux-arm64-musl-0.16.3.tgz", + "integrity": "sha512-N0kCa9K9MssXO/Gk6tPHYQWUdWhEJPek4rsYRLXyoVKX0c36Ty66Ye74LiDtFkkB33S0P38hTAwYWF68nqCEmw==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxlint/linux-x64-gnu": { + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/@oxlint/linux-x64-gnu/-/linux-x64-gnu-0.16.3.tgz", + "integrity": "sha512-f/MzfVTTxdO2YqWLvv/yyDF4O82yBC9KsDgd01M3M2cqrBlczDZ8FZaVAMO9RzKGiPZi6nwxxK0VPaLzGEc3XQ==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxlint/linux-x64-musl": { + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/@oxlint/linux-x64-musl/-/linux-x64-musl-0.16.3.tgz", + "integrity": "sha512-xdAtPsXkAe1XyXGTwmhDRy48j9EOUMiT7yL0OziHndU8U5/kfrEXgwLAw0tb8XEvfu5ZVn76EtTyQxpG0KkPpw==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "linux" + ] + }, + "node_modules/@oxlint/win32-arm64": { + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/@oxlint/win32-arm64/-/win32-arm64-0.16.3.tgz", + "integrity": "sha512-B54p7IrcACUEypQtKzMJ07xP+pFJbTwktB9TuANogMIMo33DsxoBvAYoGFOL/sFq1Dvg5jtCa6LX1dAzSPXwTA==", + "cpu": [ + "arm64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, + "node_modules/@oxlint/win32-x64": { + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/@oxlint/win32-x64/-/win32-x64-0.16.3.tgz", + "integrity": "sha512-ZpnyNyXAS5xsZggOD2V5tYYBALnW8p0w70UNXPWnXl3ScAb3QMW7IQRyOvKNPbXyW7XNYebWlgJkSCFij9gKvA==", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ] + }, "node_modules/@pkgjs/parseargs": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", @@ -5038,13 +5153,6 @@ "win32" ] }, - "node_modules/@rtsao/scc": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@rtsao/scc/-/scc-1.1.0.tgz", - "integrity": "sha512-zt6OdqaDoOnJ1ZYsCYGt9YmWzDXl4vQdKTyJev62gFhRGKdx7mcT54V9KIjg+d2wi9EXsPvAPKe7i7WjfVWB8g==", - "dev": true, - "license": "MIT" - }, "node_modules/@seald-io/binary-search-tree": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/@seald-io/binary-search-tree/-/binary-search-tree-1.0.3.tgz", @@ -6366,13 +6474,6 @@ "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "license": "MIT" }, - "node_modules/@types/json5": { - "version": "0.0.29", - "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", - "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", - "dev": true, - "license": "MIT" - }, "node_modules/@types/jsonpath-plus": { "version": "5.0.5", "resolved": "https://registry.npmjs.org/@types/jsonpath-plus/-/jsonpath-plus-5.0.5.tgz", @@ -7022,7 +7123,8 @@ "resolved": "https://registry.npmjs.org/@ungap/structured-clone/-/structured-clone-1.2.0.tgz", "integrity": "sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/@vitejs/plugin-react": { "version": "4.3.2", @@ -7377,6 +7479,7 @@ "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", "dev": true, "license": "MIT", + "peer": true, "peerDependencies": { "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } @@ -7956,27 +8059,6 @@ "dev": true, "license": "MIT" }, - "node_modules/array-includes": { - "version": "3.1.8", - "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.8.tgz", - "integrity": "sha512-itaWrbYbqpGXkGhZPGUulwnhVf5Hpy1xiCFsGqyIGglbBxmG5vSjxQen3/WGOjPpNEv1RtBLKxbmVXm8HpJStQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-object-atoms": "^1.0.0", - "get-intrinsic": "^1.2.4", - "is-string": "^1.0.7" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/array-union": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", @@ -7987,103 +8069,6 @@ "node": ">=8" } }, - "node_modules/array.prototype.findlast": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.findlast/-/array.prototype.findlast-1.2.5.tgz", - "integrity": "sha512-CVvd6FHg1Z3POpBLxO6E6zr+rSKEQ9L6rZHAaY7lLfhKsWYUBBOuMs0e9o24oopj6H+geRCX0YJ+TJLBK2eHyQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-shim-unscopables": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.findlastindex": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/array.prototype.findlastindex/-/array.prototype.findlastindex-1.2.5.tgz", - "integrity": "sha512-zfETvRFA8o7EiNn++N5f/kaCw221hrpGsDmcpndVupkPzEc1Wuf3VgC0qby1BbHs7f5DVYjgtEU2LLh5bqeGfQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "es-shim-unscopables": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.flat": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.2.tgz", - "integrity": "sha512-djYB+Zx2vLewY8RWlNCUdHjDXs2XOgm602S9E7P/UpHgfeHL00cRiIF+IN/G/aUJ7kGPb6yO/ErDI5V2s8iycA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.flatmap": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.2.tgz", - "integrity": "sha512-Ewyx0c9PmpcsByhSW4r+9zDU7sGjFc86qf/kKtuSCRdhfbk0SNLLkaT5qvcHnRGgc5NP/ly/y+qkXkqONX54CQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2", - "define-properties": "^1.2.0", - "es-abstract": "^1.22.1", - "es-shim-unscopables": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/array.prototype.tosorted": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/array.prototype.tosorted/-/array.prototype.tosorted-1.1.4.tgz", - "integrity": "sha512-p6Fx8B7b7ZhL/gmUsAy0D15WhvDccw3mnGNbZpi3pmeJdxtWsj2jEaI4Y6oo3XiHfzuSgPwKc04MYt6KgvC/wA==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.3", - "es-errors": "^1.3.0", - "es-shim-unscopables": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/arraybuffer.prototype.slice": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/arraybuffer.prototype.slice/-/arraybuffer.prototype.slice-1.0.3.tgz", @@ -10213,7 +10198,8 @@ "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/deepmerge": { "version": "4.3.1", @@ -10520,6 +10506,7 @@ "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "license": "Apache-2.0", + "peer": true, "dependencies": { "esutils": "^2.0.2" }, @@ -11173,32 +11160,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/es-iterator-helpers": { - "version": "1.0.19", - "resolved": "https://registry.npmjs.org/es-iterator-helpers/-/es-iterator-helpers-1.0.19.tgz", - "integrity": "sha512-zoMwbCcH5hwUkKJkT8kDIBZSz9I6mVG//+lDCinLCGov4+r7NIy0ld8o03M0cJxl2spVf6ESYVS6/gpIfq1FFw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.3", - "es-errors": "^1.3.0", - "es-set-tostringtag": "^2.0.3", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "globalthis": "^1.0.3", - "has-property-descriptors": "^1.0.2", - "has-proto": "^1.0.3", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.7", - "iterator.prototype": "^1.1.2", - "safe-array-concat": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, "node_modules/es-object-atoms": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.0.0.tgz", @@ -11225,16 +11186,6 @@ "node": ">= 0.4" } }, - "node_modules/es-shim-unscopables": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.2.tgz", - "integrity": "sha512-J3yBRXCzDu4ULnQwxyToo/OjdMx6akgVC7K6few0a7F/0wLtmKKN7I73AH5T2836UuXRqN7Qg+IIUw/+YJksRw==", - "dev": true, - "license": "MIT", - "dependencies": { - "hasown": "^2.0.0" - } - }, "node_modules/es-to-primitive": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", @@ -11436,6 +11387,7 @@ "integrity": "sha512-ypowyDxpVSYpkXr9WPv2PAZCtNip1Mv5KTW0SCurXv/9iOpcrH9PaqUElksqEB6pChqHGDRCFTyrZlGhnLNGiA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "@eslint-community/eslint-utils": "^4.2.0", "@eslint-community/regexpp": "^4.6.1", @@ -11486,278 +11438,13 @@ "url": "https://opencollective.com/eslint" } }, - "node_modules/eslint-config-helpers": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/eslint-config-helpers/-/eslint-config-helpers-1.2.0.tgz", - "integrity": "sha512-ouVdkWAlKZWCyffVz+gYMlaz6OCdhIfV8UbOTAvFUBgnNmT20J34v8DULhJFvWWyL6tyWkSNohWYsCaoWf6iTw==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=16" - } - }, - "node_modules/eslint-import-resolver-node": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.9.tgz", - "integrity": "sha512-WFj2isz22JahUv+B788TlO3N6zL3nNJGU8CcZbPZvVEkBPaJdCV4vy5wyghty5ROFbCRnm132v8BScu5/1BQ8g==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^3.2.7", - "is-core-module": "^2.13.0", - "resolve": "^1.22.4" - } - }, - "node_modules/eslint-import-resolver-node/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-module-utils": { - "version": "2.12.0", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.12.0.tgz", - "integrity": "sha512-wALZ0HFoytlyh/1+4wuZ9FJCD/leWHQzzrxJ8+rebyReSLk7LApMyd3WJaLVoN+D5+WIdJyDK1c6JnE65V4Zyg==", - "dev": true, - "license": "MIT", - "dependencies": { - "debug": "^3.2.7" - }, - "engines": { - "node": ">=4" - }, - "peerDependenciesMeta": { - "eslint": { - "optional": true - } - } - }, - "node_modules/eslint-module-utils/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-plugin-filenames": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-filenames/-/eslint-plugin-filenames-1.3.2.tgz", - "integrity": "sha512-tqxJTiEM5a0JmRCUYQmxw23vtTxrb2+a3Q2mMOPhFxvt7ZQQJmdiuMby9B/vUAuVMghyP7oET+nIf6EO6CBd/w==", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash.camelcase": "4.3.0", - "lodash.kebabcase": "4.1.1", - "lodash.snakecase": "4.1.1", - "lodash.upperfirst": "4.3.1" - }, - "peerDependencies": { - "eslint": "*" - } - }, - "node_modules/eslint-plugin-html": { - "version": "8.1.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-html/-/eslint-plugin-html-8.1.2.tgz", - "integrity": "sha512-pbRchDV2SmqbCi/Ev/q3aAikzG9BcFe0IjjqjtMn8eTLq71ZUggyJB6CDmuwGAXmYZHrXI12XTfCqvgcnPRqGw==", - "dev": true, - "license": "ISC", - "dependencies": { - "htmlparser2": "^9.1.0" - }, - "engines": { - "node": ">=16.0.0" - } - }, - "node_modules/eslint-plugin-import": { - "version": "2.30.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.30.0.tgz", - "integrity": "sha512-/mHNE9jINJfiD2EKkg1BKyPyUk4zdnT54YgbOgfjSakWT5oyX/qQLVNTkehyfpcMxZXMy1zyonZ2v7hZTX43Yw==", - "dev": true, - "license": "MIT", - "dependencies": { - "@rtsao/scc": "^1.1.0", - "array-includes": "^3.1.8", - "array.prototype.findlastindex": "^1.2.5", - "array.prototype.flat": "^1.3.2", - "array.prototype.flatmap": "^1.3.2", - "debug": "^3.2.7", - "doctrine": "^2.1.0", - "eslint-import-resolver-node": "^0.3.9", - "eslint-module-utils": "^2.9.0", - "hasown": "^2.0.2", - "is-core-module": "^2.15.1", - "is-glob": "^4.0.3", - "minimatch": "^3.1.2", - "object.fromentries": "^2.0.8", - "object.groupby": "^1.0.3", - "object.values": "^1.2.0", - "semver": "^6.3.1", - "tsconfig-paths": "^3.15.0" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" - } - }, - "node_modules/eslint-plugin-import/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "ms": "^2.1.1" - } - }, - "node_modules/eslint-plugin-import/node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eslint-plugin-import/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/eslint-plugin-json": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-json/-/eslint-plugin-json-3.1.0.tgz", - "integrity": "sha512-MrlG2ynFEHe7wDGwbUuFPsaT2b1uhuEFhJ+W1f1u+1C2EkXmTYJp4B1aAdQQ8M+CC3t//N/oRKiIVw14L2HR1g==", - "dev": true, - "license": "MIT", - "dependencies": { - "lodash": "^4.17.21", - "vscode-json-languageservice": "^4.1.6" - }, - "engines": { - "node": ">=12.0" - } - }, - "node_modules/eslint-plugin-react": { - "version": "7.37.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.37.0.tgz", - "integrity": "sha512-IHBePmfWH5lKhJnJ7WB1V+v/GolbB0rjS8XYVCSQCZKaQCAUhMoVoOEn1Ef8Z8Wf0a7l8KTJvuZg5/e4qrZ6nA==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-includes": "^3.1.8", - "array.prototype.findlast": "^1.2.5", - "array.prototype.flatmap": "^1.3.2", - "array.prototype.tosorted": "^1.1.4", - "doctrine": "^2.1.0", - "es-iterator-helpers": "^1.0.19", - "estraverse": "^5.3.0", - "hasown": "^2.0.2", - "jsx-ast-utils": "^2.4.1 || ^3.0.0", - "minimatch": "^3.1.2", - "object.entries": "^1.1.8", - "object.fromentries": "^2.0.8", - "object.values": "^1.2.0", - "prop-types": "^15.8.1", - "resolve": "^2.0.0-next.5", - "semver": "^6.3.1", - "string.prototype.matchall": "^4.0.11", - "string.prototype.repeat": "^1.0.0" - }, - "engines": { - "node": ">=4" - }, - "peerDependencies": { - "eslint": "^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7" - } - }, - "node_modules/eslint-plugin-react-hooks": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-4.6.2.tgz", - "integrity": "sha512-QzliNJq4GinDBcD8gPB5v0wh6g8q3SUi6EFF0x8N/BL9PoVs0atuGc47ozMRyOWAKdwaZ5OnbOEa3WR+dSGKuQ==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=10" - }, - "peerDependencies": { - "eslint": "^3.0.0 || ^4.0.0 || ^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0-0" - } - }, - "node_modules/eslint-plugin-react/node_modules/doctrine": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", - "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", - "dev": true, - "license": "Apache-2.0", - "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/eslint-plugin-react/node_modules/resolve": { - "version": "2.0.0-next.5", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-2.0.0-next.5.tgz", - "integrity": "sha512-U7WjGVG9sH8tvjW5SmGbQuui75FiyjAX72HX15DwBBwF9dNiQZRQAg9nnPhYy+TUnE0+VcrttuvNI8oSxZcocA==", - "dev": true, - "license": "MIT", - "dependencies": { - "is-core-module": "^2.13.0", - "path-parse": "^1.0.7", - "supports-preserve-symlinks-flag": "^1.0.0" - }, - "bin": { - "resolve": "bin/resolve" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/eslint-plugin-react/node_modules/semver": { - "version": "6.3.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", - "integrity": "sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==", - "dev": true, - "license": "ISC", - "bin": { - "semver": "bin/semver.js" - } - }, - "node_modules/eslint-plugin-simple-import-sort": { - "version": "12.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-simple-import-sort/-/eslint-plugin-simple-import-sort-12.1.1.tgz", - "integrity": "sha512-6nuzu4xwQtE3332Uz0to+TxDQYRLTKRESSc2hefVT48Zc8JthmN23Gx9lnYhu0FtkRSL1oxny3kJ2aveVhmOVA==", - "dev": true, - "license": "MIT", - "peerDependencies": { - "eslint": ">=5.0.0" - } - }, "node_modules/eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", "integrity": "sha512-dOt21O7lTMhDM+X9mB4GX+DZrZtCUJPL/wlcTqxyrx5IvO0IYtILdtrQGQp+8n5S0gwSVmOf9NQrjMOgfQZlIg==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" @@ -11788,6 +11475,7 @@ "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "fast-deep-equal": "^3.1.1", "fast-json-stable-stringify": "^2.0.0", @@ -11804,7 +11492,8 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", "dev": true, - "license": "Python-2.0" + "license": "Python-2.0", + "peer": true }, "node_modules/eslint/node_modules/globals": { "version": "13.24.0", @@ -11812,6 +11501,7 @@ "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "type-fest": "^0.20.2" }, @@ -11828,6 +11518,7 @@ "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "argparse": "^2.0.1" }, @@ -11840,7 +11531,8 @@ "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/eslint/node_modules/type-fest": { "version": "0.20.2", @@ -11848,6 +11540,7 @@ "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, "license": "(MIT OR CC0-1.0)", + "peer": true, "engines": { "node": ">=10" }, @@ -11877,6 +11570,7 @@ "integrity": "sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "acorn": "^8.9.0", "acorn-jsx": "^5.3.2", @@ -11908,6 +11602,7 @@ "integrity": "sha512-ca9pw9fomFcKPvFLXhBKUK90ZvGibiGOvRJNbjljY7s7uq/5YO4BOzcYtJqExdx99rF6aAcnRxHmcUHcz6sQsg==", "dev": true, "license": "BSD-3-Clause", + "peer": true, "dependencies": { "estraverse": "^5.1.0" }, @@ -11921,6 +11616,7 @@ "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "dependencies": { "estraverse": "^5.2.0" }, @@ -11934,6 +11630,7 @@ "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "engines": { "node": ">=4.0" } @@ -11950,6 +11647,7 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true, "license": "BSD-2-Clause", + "peer": true, "engines": { "node": ">=0.10.0" } @@ -12246,7 +11944,8 @@ "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/fast-memoize": { "version": "2.5.2", @@ -12303,6 +12002,7 @@ "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "flat-cache": "^3.0.4" }, @@ -12431,6 +12131,7 @@ "integrity": "sha512-CYcENa+FtcUKLmhhqyctpclsq7QF38pKjZHsGNiSQF5r4FtoKDWabFDl3hzaEQMvT1LHEysw5twgLvpYYb4vbw==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "flatted": "^3.2.9", "keyv": "^4.5.3", @@ -12445,7 +12146,8 @@ "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.3.1.tgz", "integrity": "sha512-X8cqMLLie7KsNUDSdzeN8FYK9rEt4Dt67OsG/DNGnYTSDBG4uFAJFBnUeiV+zCVAvwFy56IjM9sH51jVaEhNxw==", "dev": true, - "license": "ISC" + "license": "ISC", + "peer": true }, "node_modules/for-each": { "version": "0.3.3", @@ -13834,22 +13536,6 @@ "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", "license": "MIT" }, - "node_modules/is-async-function": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-async-function/-/is-async-function-2.0.0.tgz", - "integrity": "sha512-Y1JXKrfykRJGdlDwdKlLpLyMIiWqWvuSd17TvZk68PLAOGOoF4Xyav1z0Xhoi+gCYjZVeC5SI+hYFOfvXmGRCA==", - "dev": true, - "license": "MIT", - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-bigint": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", @@ -13969,19 +13655,6 @@ "node": ">=0.10.0" } }, - "node_modules/is-finalizationregistry": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/is-finalizationregistry/-/is-finalizationregistry-1.0.2.tgz", - "integrity": "sha512-0by5vtUJs8iFQb5TYUHHPudOR+qXYIMKtiUzvLIZITZUjknFmziyBJuLhVRc+Ds0dREFlskDNJKYIdIzu/9pfw==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", @@ -14087,6 +13760,7 @@ "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=8" } @@ -14348,20 +14022,6 @@ "node": ">=6" } }, - "node_modules/iterator.prototype": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/iterator.prototype/-/iterator.prototype-1.1.2.tgz", - "integrity": "sha512-DR33HMMr8EzwuRL8Y9D3u2BMj8+RqSE850jfGu59kS7tbmPLzGkZmVSfyCFSDxuZiEY6Rzt3T2NA/qU+NwVj1w==", - "dev": true, - "license": "MIT", - "dependencies": { - "define-properties": "^1.2.1", - "get-intrinsic": "^1.2.1", - "has-symbols": "^1.0.3", - "reflect.getprototypeof": "^1.0.4", - "set-function-name": "^2.0.1" - } - }, "node_modules/jackspeak": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", @@ -14842,7 +14502,8 @@ "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/json-stringify-safe": { "version": "5.0.1", @@ -15019,22 +14680,6 @@ "resolved": "https://registry.npmjs.org/jsv-fixed/-/jsv-fixed-4.0.2.tgz", "integrity": "sha512-7nbUtzSw9xj0PAOXZIzMqVLGuI797NHQrD+b64+x5f1x9H2SexLlKV0Dr3EwOByKPOmXkmn1JgmmIHAdavpN4Q==" }, - "node_modules/jsx-ast-utils": { - "version": "3.3.5", - "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-3.3.5.tgz", - "integrity": "sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "array-includes": "^3.1.6", - "array.prototype.flat": "^1.3.1", - "object.assign": "^4.1.4", - "object.values": "^1.1.6" - }, - "engines": { - "node": ">=4.0" - } - }, "node_modules/jszip": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.10.1.tgz", @@ -15406,6 +15051,7 @@ "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "prelude-ls": "^1.2.1", "type-check": "~0.4.0" @@ -15573,13 +15219,6 @@ "dev": true, "license": "MIT" }, - "node_modules/lodash.kebabcase": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", - "integrity": "sha512-N8XRTIMMqqDgSy4VLKPnJ/+hpGZN+PHQiJnSenYqPaVV/NCqEogTnAdZLQiGKhxX+JCs8waWq2t1XHWKOmlY8g==", - "dev": true, - "license": "MIT" - }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -15594,13 +15233,6 @@ "dev": true, "license": "MIT" }, - "node_modules/lodash.snakecase": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", - "integrity": "sha512-QZ1d4xoBHYUeuouhEq3lk3Uq7ldgyFXGBhg04+oRLnIz8o9T65Eh+8YdroUwn846zchkA9yDsDl5CVVaV2nqYw==", - "dev": true, - "license": "MIT" - }, "node_modules/lodash.topath": { "version": "4.5.2", "resolved": "https://registry.npmjs.org/lodash.topath/-/lodash.topath-4.5.2.tgz", @@ -15614,13 +15246,6 @@ "dev": true, "license": "MIT" }, - "node_modules/lodash.upperfirst": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz", - "integrity": "sha512-sReKOYJIJf74dhJONhU4e0/shzi1trVbSWDOhKYE5XV2O+H7Sb2Dihwuc7xWxVl+DgFPyTqIN3zMfT9cq5iWDg==", - "dev": true, - "license": "MIT" - }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -17078,73 +16703,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/object.entries": { - "version": "1.1.8", - "resolved": "https://registry.npmjs.org/object.entries/-/object.entries-1.1.8.tgz", - "integrity": "sha512-cmopxi8VwRIAw/fkijJohSfpef5PdN0pMQJN6VC/ZKvn0LIknWD8KtgY6KlQdEc4tIjcQ3HxSMmnvtzIscdaYQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.fromentries": { - "version": "2.0.8", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.8.tgz", - "integrity": "sha512-k6E21FzySsSK5a21KRADBd/NGneRegFO5pLHfdQLpRDETUNJueLXs3WCzyQ3tFRDYgbq3KHGXfTbi2bs8WQ6rQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/object.groupby": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/object.groupby/-/object.groupby-1.0.3.tgz", - "integrity": "sha512-+Lhy3TQTuzXI5hevh8sBGqbmurHbbIjAi0Z4S63nthVLmLxfbj4T54a4CfZrXIrt9iP4mVAPYMo/v99taj3wjQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/object.values": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.2.0.tgz", - "integrity": "sha512-yBYjY9QX2hnRmZHAjG/f13MzmBzxzYgQhFrke06TTyKY5zSTEqkOeukBzIdVA3j3ulu8Qa3MbVFShV7T2RmGtQ==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-object-atoms": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/objectpath": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/objectpath/-/objectpath-2.0.0.tgz", @@ -17492,6 +17050,7 @@ "integrity": "sha512-6IpQ7mKUxRcZNLIObR0hz7lxsapSSIYNZJwXPGeF0mTVqGKFIXj1DQcMoT22S3ROcLyY/rz0PWaWZ9ayWmad9g==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "deep-is": "^0.1.3", "fast-levenshtein": "^2.0.6", @@ -17504,6 +17063,33 @@ "node": ">= 0.8.0" } }, + "node_modules/oxlint": { + "version": "0.16.3", + "resolved": "https://registry.npmjs.org/oxlint/-/oxlint-0.16.3.tgz", + "integrity": "sha512-CqHLqyVLL0UYLsJTLHuwzbM3/dCxA5v0ngSCTnVFYwQsj8qYr8p1KS0TbCX4Mv20vcOJifSoQdQhvNcWFSKMZw==", + "dev": true, + "license": "MIT", + "bin": { + "oxc_language_server": "bin/oxc_language_server", + "oxlint": "bin/oxlint" + }, + "engines": { + "node": ">=8.*" + }, + "funding": { + "url": "https://github.com/sponsors/Boshen" + }, + "optionalDependencies": { + "@oxlint/darwin-arm64": "0.16.3", + "@oxlint/darwin-x64": "0.16.3", + "@oxlint/linux-arm64-gnu": "0.16.3", + "@oxlint/linux-arm64-musl": "0.16.3", + "@oxlint/linux-x64-gnu": "0.16.3", + "@oxlint/linux-x64-musl": "0.16.3", + "@oxlint/win32-arm64": "0.16.3", + "@oxlint/win32-x64": "0.16.3" + } + }, "node_modules/p-cancelable": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", @@ -18150,6 +17736,7 @@ "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">= 0.8.0" } @@ -18901,28 +18488,6 @@ "node": ">=8.10.0" } }, - "node_modules/reflect.getprototypeof": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/reflect.getprototypeof/-/reflect.getprototypeof-1.0.6.tgz", - "integrity": "sha512-fmfw4XgoDke3kdI6h4xcUz1dG8uaiv5q9gcEwLS4Pnth2kxT+GZ7YehS1JTMGBQmtV7Y4GFGbs2re2NqhdozUg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.1", - "es-errors": "^1.3.0", - "get-intrinsic": "^1.2.4", - "globalthis": "^1.0.3", - "which-builtin-type": "^1.1.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/reftools": { "version": "1.1.9", "resolved": "https://registry.npmjs.org/reftools/-/reftools-1.1.9.tgz", @@ -20056,44 +19621,6 @@ "node": ">=8" } }, - "node_modules/string.prototype.matchall": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/string.prototype.matchall/-/string.prototype.matchall-4.0.11.tgz", - "integrity": "sha512-NUdh0aDavY2og7IbBPenWqR9exH+E26Sv8e0/eTe1tltDGZL+GtBkDAnnyBtmekfK6/Dq3MkcGtzXFEd1LQrtg==", - "dev": true, - "license": "MIT", - "dependencies": { - "call-bind": "^1.0.7", - "define-properties": "^1.2.1", - "es-abstract": "^1.23.2", - "es-errors": "^1.3.0", - "es-object-atoms": "^1.0.0", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-symbols": "^1.0.3", - "internal-slot": "^1.0.7", - "regexp.prototype.flags": "^1.5.2", - "set-function-name": "^2.0.2", - "side-channel": "^1.0.6" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/string.prototype.repeat": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/string.prototype.repeat/-/string.prototype.repeat-1.0.0.tgz", - "integrity": "sha512-0u/TldDbKD8bFCQ/4f5+mNRrXwZ8hg2w7ZR8wa16e8z9XpePWl3eGEcUD0OXpEH/VJH/2G3gjUtR3ZOiBe2S/w==", - "dev": true, - "license": "MIT", - "dependencies": { - "define-properties": "^1.1.3", - "es-abstract": "^1.17.5" - } - }, "node_modules/string.prototype.trim": { "version": "1.2.9", "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.9.tgz", @@ -20182,16 +19709,6 @@ "node": ">=8" } }, - "node_modules/strip-bom": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", - "dev": true, - "license": "MIT", - "engines": { - "node": ">=4" - } - }, "node_modules/strip-dirs": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/strip-dirs/-/strip-dirs-2.1.0.tgz", @@ -20647,7 +20164,8 @@ "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true, - "license": "MIT" + "license": "MIT", + "peer": true }, "node_modules/thenify": { "version": "3.3.1", @@ -20908,32 +20426,6 @@ "dev": true, "license": "Apache-2.0" }, - "node_modules/tsconfig-paths": { - "version": "3.15.0", - "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.15.0.tgz", - "integrity": "sha512-2Ac2RgzDe/cn48GvOe3M+o82pEFewD3UPbyoUHHdKasHwJKjds4fLXWf/Ux5kATBKN20oaFGu+jbElp1pos0mg==", - "dev": true, - "license": "MIT", - "dependencies": { - "@types/json5": "^0.0.29", - "json5": "^1.0.2", - "minimist": "^1.2.6", - "strip-bom": "^3.0.0" - } - }, - "node_modules/tsconfig-paths/node_modules/json5": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", - "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", - "dev": true, - "license": "MIT", - "dependencies": { - "minimist": "^1.2.0" - }, - "bin": { - "json5": "lib/cli.js" - } - }, "node_modules/tslib": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz", @@ -20988,6 +20480,7 @@ "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "license": "MIT", + "peer": true, "dependencies": { "prelude-ls": "^1.2.1" }, @@ -22157,34 +21650,6 @@ "dev": true, "license": "MIT" }, - "node_modules/vscode-json-languageservice": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-4.2.1.tgz", - "integrity": "sha512-xGmv9QIWs2H8obGbWg+sIPI/3/pFgj/5OWBhNzs00BkYQ9UaB2F6JJaGB/2/YOZJ3BvLXQTC4Q7muqU25QgAhA==", - "dev": true, - "license": "MIT", - "dependencies": { - "jsonc-parser": "^3.0.0", - "vscode-languageserver-textdocument": "^1.0.3", - "vscode-languageserver-types": "^3.16.0", - "vscode-nls": "^5.0.0", - "vscode-uri": "^3.0.3" - } - }, - "node_modules/vscode-json-languageservice/node_modules/jsonc-parser": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.3.1.tgz", - "integrity": "sha512-HUgH65KyejrUFPvHFPbqOY0rsFip3Bo5wb4ngvdi1EpCYWUQDC5V+Y7mZws+DLkr4M//zQJoanu1SP+87Dv1oQ==", - "dev": true, - "license": "MIT" - }, - "node_modules/vscode-languageserver-textdocument": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/vscode-languageserver-textdocument/-/vscode-languageserver-textdocument-1.0.12.tgz", - "integrity": "sha512-cxWNPesCnQCcMPeenjKKsOCKQZ/L6Tv19DTRIGuLWe32lyzWhihGVJ/rcckZXJxfdKCFvRLS3fpBIsV/ZGX4zA==", - "dev": true, - "license": "MIT" - }, "node_modules/vscode-languageserver-types": { "version": "3.17.5", "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.17.5.tgz", @@ -22192,20 +21657,6 @@ "dev": true, "license": "MIT" }, - "node_modules/vscode-nls": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-5.2.0.tgz", - "integrity": "sha512-RAaHx7B14ZU04EU31pT+rKz2/zSl7xMsfIZuo8pd+KZO6PXtQmpevpq3vxvWNcrGbdmhM/rr5Uw5Mz+NBfhVng==", - "dev": true, - "license": "MIT" - }, - "node_modules/vscode-uri": { - "version": "3.0.8", - "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-3.0.8.tgz", - "integrity": "sha512-AyFQ0EVmsOZOlAnxoFOGOq1SQDWAB7C6aqMGS23svWAllfOaxbuFvcT8D1i8z3Gyn8fraVeZNNmN6e9bxxXkKw==", - "dev": true, - "license": "MIT" - }, "node_modules/w3c-keyname": { "version": "2.2.8", "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", @@ -22300,33 +21751,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/which-builtin-type": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/which-builtin-type/-/which-builtin-type-1.1.4.tgz", - "integrity": "sha512-bppkmBSsHFmIMSl8BO9TbsyzsvGjVoppt8xUiGzwiu/bhDCGxnpOKCxgqj6GuyHE0mINMDecBFPlOm2hzY084w==", - "dev": true, - "license": "MIT", - "dependencies": { - "function.prototype.name": "^1.1.6", - "has-tostringtag": "^1.0.2", - "is-async-function": "^2.0.0", - "is-date-object": "^1.0.5", - "is-finalizationregistry": "^1.0.2", - "is-generator-function": "^1.0.10", - "is-regex": "^1.1.4", - "is-weakref": "^1.0.2", - "isarray": "^2.0.5", - "which-boxed-primitive": "^1.0.2", - "which-collection": "^1.0.2", - "which-typed-array": "^1.1.15" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/which-collection": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/which-collection/-/which-collection-1.0.2.tgz", @@ -22387,6 +21811,7 @@ "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", "dev": true, "license": "MIT", + "peer": true, "engines": { "node": ">=0.10.0" } diff --git a/package.json b/package.json index 0449ad55faf..0545aa69fd6 100644 --- a/package.json +++ b/package.json @@ -23,7 +23,7 @@ ], "scripts": { "dev": "npm start -w insomnia", - "lint": "npm run lint --workspaces --if-present", + "lint": "oxlint", "type-check": "npm run type-check --workspaces --if-present", "test": "npm run test --workspaces --if-present", "lint:markdown": "npx markdownlint-cli2 \"**/*.md\" \"#**/node_modules\" \"#**/CHANGELOG.md\"", @@ -43,23 +43,12 @@ }, "devDependencies": { "@types/chai": "^4.3.14", - "@types/eslint": "^8.56.7", "@types/har-format": "^1.2.15", "@types/mocha": "^10.0.6", "@types/node": "^22.13.10", - "@typescript-eslint/eslint-plugin": "^7.5.0", - "@typescript-eslint/parser": "^7.5.0", "esbuild": "^0.24.0", "esbuild-runner": "^2.2.2", - "eslint": "^8.57.0", - "eslint-config-helpers": "^1.2.0", - "eslint-plugin-filenames": "^1.3.2", - "eslint-plugin-html": "^8.0.0", - "eslint-plugin-import": "^2.29.1", - "eslint-plugin-json": "^3.1.0", - "eslint-plugin-react": "^7.34.1", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-simple-import-sort": "^12.0.0", + "oxlint": "^0.16.3", "tslib": "2.0.1", "type-fest": "^4.15.0", "typescript": "^5.6.2", diff --git a/packages/insomnia-inso/package.json b/packages/insomnia-inso/package.json index d3654f54aef..42bbcc5892d 100644 --- a/packages/insomnia-inso/package.json +++ b/packages/insomnia-inso/package.json @@ -20,7 +20,7 @@ "inso": "bin/inso" }, "scripts": { - "lint": "eslint . --ext .js,.ts,.tsx --cache", + "lint": "npx oxlint", "test:unit": "vitest run --exclude '**/cli.test.ts'", "test:bundle": "vitest cli.test.ts -t \"inso dev bundle\"", "test:binary": "vitest cli.test.ts -t \"inso packaged binary\"", diff --git a/packages/insomnia-testing/package.json b/packages/insomnia-testing/package.json index a3e21aadb6f..65ac5651a9a 100644 --- a/packages/insomnia-testing/package.json +++ b/packages/insomnia-testing/package.json @@ -15,7 +15,7 @@ "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "lint": "eslint . --ext .js,.ts,.tsx --cache", + "lint": "npx oxlint", "test": "vitest run", "type-check": "tsc --noEmit --project tsconfig.json" }, diff --git a/packages/insomnia/package.json b/packages/insomnia/package.json index 86dbe8a9bea..c7723397c24 100644 --- a/packages/insomnia/package.json +++ b/packages/insomnia/package.json @@ -21,7 +21,7 @@ "build:app": "esr --cache ./scripts/build.ts --noErrorTruncation", "generate:schema": "esr ./src/schema.ts", "build:main.min.js": "cross-env NODE_ENV=development esr esbuild.main.ts", - "lint": "eslint . --ext .js,.ts,.tsx --cache", + "lint": "npx oxlint", "package": "npm run build:app && cross-env USE_HARD_LINKS=false electron-builder build --config electron-builder.config.js", "package:windows:unpacked": "npm run build:app && cross-env USE_HARD_LINKS=false electron-builder build --config electron-builder.config.js --dir", "package:windows:dist": "cross-env USE_HARD_LINKS=false electron-builder build --config electron-builder.config.js --win squirrel --prepackaged ./dist/win-unpacked", From 6dc8d2f597e3bb14e60750dde000816d73fda1e9 Mon Sep 17 00:00:00 2001 From: gatzjames Date: Thu, 27 Mar 2025 12:09:48 +0100 Subject: [PATCH 6/9] cleanup eslint from the app --- .eslintrc.js | 156 ---------------------- .gitignore | 1 - packages/insomnia-inso/tsconfig.json | 1 - packages/insomnia-smoke-test/package.json | 1 - packages/insomnia/tsconfig.json | 1 - 5 files changed, 160 deletions(-) delete mode 100644 .eslintrc.js diff --git a/.eslintrc.js b/.eslintrc.js deleted file mode 100644 index a04fbb0c674..00000000000 --- a/.eslintrc.js +++ /dev/null @@ -1,156 +0,0 @@ -const { - ERROR, - OFF, - SUCCESSOR, - TYPESCRIPT_CONVERSION, - TYPESCRIPT_EXTENSION, - UNKNOWN, -} = require('eslint-config-helpers'); - -/** @type { import('eslint').Linter.Config } */ -module.exports = { - settings: { - react: { - version: 'detect', - }, - }, - parser: '@typescript-eslint/parser', - parserOptions: { - tsconfigRootDir: __dirname, - ecmaFeatures: { - jsx: true, - }, - }, - extends: [ - 'plugin:@typescript-eslint/eslint-recommended', - 'plugin:@typescript-eslint/recommended', - 'plugin:react/recommended', - 'plugin:react-hooks/recommended', - ], - plugins: [ - '@typescript-eslint', - 'react', - 'html', - 'json', - 'filenames', - 'react-hooks', - 'import', - 'simple-import-sort', - ], - globals: { - __DEV__: true, - fail: true, - NodeJS: true, - HTMLDivElement: true, - HTMLElement: true, - HTMLInputElement: true, - HTMLSelectElement: true, - JSX: true, - }, - env: { - browser: true, - commonjs: true, - es6: true, - node: true, - }, - overrides: [ - { - files: ['*.js'], - rules: { - '@typescript-eslint/no-var-requires': OFF(UNKNOWN), - }, - }, - ], - rules: { - 'array-bracket-spacing': ERROR, - 'brace-style': SUCCESSOR(TYPESCRIPT_EXTENSION), - 'block-spacing': ERROR, - 'comma-dangle': [ERROR, 'always-multiline'], - 'comma-spacing': ERROR, - 'consistent-return': OFF('found to be too many false positives'), - 'curly': ERROR, - 'default-case': ERROR, - 'default-case-last': ERROR, - 'eol-last': [ERROR, 'always'], - 'eqeqeq': [ERROR, 'smart'], - 'arrow-parens': [ERROR, 'as-needed'], - 'arrow-spacing': ERROR, - 'keyword-spacing': SUCCESSOR(TYPESCRIPT_EXTENSION), - 'no-async-promise-executor': OFF(UNKNOWN), - 'no-case-declarations': OFF(UNKNOWN), - 'no-duplicate-imports': OFF(UNKNOWN), - 'no-prototype-builtins': OFF(UNKNOWN), - 'no-redeclare': OFF(UNKNOWN), - 'no-unused-vars': OFF(UNKNOWN), - 'no-use-before-define': OFF(UNKNOWN), - 'no-var': ERROR, - 'no-trailing-spaces': ERROR, - 'no-multiple-empty-lines': [ERROR, { 'max': 1, 'maxEOF': 0 }], - 'object-curly-spacing': [ERROR, 'always'], - 'quotes': OFF(UNKNOWN), - 'semi': SUCCESSOR(TYPESCRIPT_EXTENSION), - 'space-before-function-paren': [ERROR, { anonymous: 'always', named: 'never', asyncArrow: 'always' }], - 'space-infix-ops': SUCCESSOR(TYPESCRIPT_EXTENSION), - 'space-unary-ops': ERROR, - 'space-in-parens': ERROR, - 'spaced-comment': [ERROR, 'always', { - exceptions: ['/', '*', '-', '* '], // for ASCII art :) - markers: [ - '/', // for TypeScript directives, doxygen, vsdoc, etc. (which use `///`) - '?', // for Quokka - ], - }], - - 'react/no-unescaped-entities': OFF(TYPESCRIPT_CONVERSION), - 'react/jsx-first-prop-new-line': [ERROR, 'multiline'], - 'react/jsx-max-props-per-line': [ERROR, { maximum: 1, when: 'multiline' }], - 'react/jsx-uses-react': ERROR, - 'react/jsx-uses-vars': ERROR, - 'react/jsx-indent-props': [ERROR, 2], - 'react/prop-types': OFF(UNKNOWN), - 'react/function-component-definition': [ERROR, { - 'namedComponents': 'arrow-function', - 'unnamedComponents': 'arrow-function', - }], - 'react/jsx-closing-bracket-location': [ERROR, 'line-aligned'], - 'react/prefer-stateless-function': ERROR, - 'react/jsx-key': [ERROR, { 'checkFragmentShorthand': true }], - 'react/no-array-index-key': ERROR, - 'react/self-closing-comp': ERROR, - - 'react-hooks/exhaustive-deps': [ERROR, { - // From react-use https://github.com/streamich/react-use/issues/1703#issuecomment-770972824 - 'additionalHooks': '^use(Async|AsyncFn|AsyncRetry|Debounce|UpdateEffect|IsomorphicLayoutEffect|DeepCompareEffect|ShallowCompareEffect)$', - }], - 'react-hooks/rules-of-hooks': ERROR, - - '@typescript-eslint/array-type': [ERROR, { default: 'array', readonly: 'array' }], - '@typescript-eslint/ban-types': OFF(UNKNOWN), - '@typescript-eslint/brace-style': [ERROR, '1tbs'], - '@typescript-eslint/consistent-type-definitions': [ERROR, 'interface'], - '@typescript-eslint/explicit-module-boundary-types': OFF(UNKNOWN), - '@typescript-eslint/keyword-spacing': ERROR, - '@typescript-eslint/member-delimiter-style': ERROR, - '@typescript-eslint/no-empty-function': OFF(UNKNOWN), - '@typescript-eslint/no-empty-interface': [ERROR, { 'allowSingleExtends': true }], - '@typescript-eslint/no-namespace': [ERROR, { allowDeclarations: true }], - '@typescript-eslint/no-redeclare': ERROR, - '@typescript-eslint/no-unused-vars': [ERROR, { ignoreRestSiblings: true }], - '@typescript-eslint/space-before-blocks': ERROR, - '@typescript-eslint/space-infix-ops': ERROR, - '@typescript-eslint/semi': [ERROR, 'always'], - '@typescript-eslint/quotes': [ERROR, 'single', { avoidEscape: true }], - - 'simple-import-sort/imports': ERROR, - 'filenames/match-exported': OFF(UNKNOWN), - camelcase: OFF(UNKNOWN), - '@typescript-eslint/no-use-before-define': OFF(TYPESCRIPT_CONVERSION), - '@typescript-eslint/no-explicit-any': OFF(TYPESCRIPT_CONVERSION), - 'react/no-find-dom-node': OFF(UNKNOWN), - 'no-restricted-properties': [ERROR, { - property: 'openExternal', - message: 'use the `window.main.openInBrowser` function instead. see https://security.stackexchange.com/questions/225799/dangers-of-electrons-shell-openexternal-on-untrusted-content for more information.', - }], - 'react/display-name': OFF(UNKNOWN), - }, -}; diff --git a/.gitignore b/.gitignore index 65dcfc33f00..8cde04e2f80 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,6 @@ build/Release node_modules/ **/node_modules/ .npm -.eslintcache .node_repl_history *.tgz .yarn-integrity diff --git a/packages/insomnia-inso/tsconfig.json b/packages/insomnia-inso/tsconfig.json index 7d9cf547c18..1c0b9e4f2af 100644 --- a/packages/insomnia-inso/tsconfig.json +++ b/packages/insomnia-inso/tsconfig.json @@ -34,7 +34,6 @@ "useUnknownInCatchVariables": false, }, "include": [ - ".eslintrc.js", "esbuild.ts", "jest.config.js", "package.json", diff --git a/packages/insomnia-smoke-test/package.json b/packages/insomnia-smoke-test/package.json index bc543262af2..3918dc10d00 100644 --- a/packages/insomnia-smoke-test/package.json +++ b/packages/insomnia-smoke-test/package.json @@ -44,7 +44,6 @@ }, "description": "[![Playwright](https://img.shields.io/badge/playwright-blue.svg?style=for-the-badge&logo=playwright)](https://github.com/microsoft/playwright)", "homepage": "https://github.com/Kong/insomnia#readme", - "main": ".eslintrc.js", "directories": { "doc": "docs", "test": "tests" diff --git a/packages/insomnia/tsconfig.json b/packages/insomnia/tsconfig.json index d9799446ecc..7f7f8491a62 100644 --- a/packages/insomnia/tsconfig.json +++ b/packages/insomnia/tsconfig.json @@ -28,7 +28,6 @@ "verbatimModuleSyntax": true }, "include": [ - ".eslintrc.js", "config", "esbuild.main.ts", "esbuild.sr.ts", From c10580d1fd631b0377f668d35a74aca75f902e70 Mon Sep 17 00:00:00 2001 From: gatzjames Date: Thu, 27 Mar 2025 12:10:02 +0100 Subject: [PATCH 7/9] add recommended vscode extension --- .vscode/extensions.json | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/.vscode/extensions.json b/.vscode/extensions.json index 54ac538b5d1..43038409de6 100644 --- a/.vscode/extensions.json +++ b/.vscode/extensions.json @@ -1,18 +1,15 @@ { // See https://go.microsoft.com/fwlink/?LinkId=827846 to learn about workspace recommendations. // Extension identifier format: ${publisher}.${name}. Example: vscode.csharp - // List of extensions which should be recommended for users of this workspace. "recommendations": [ "yzhang.markdown-all-in-one", "DavidAnson.vscode-markdownlint", - "dbaeumer.vscode-eslint", + "oxc.oxc-vscode", "adrieankhisbe.vscode-ndjson", "ms-playwright.playwright", "bradlc.vscode-tailwindcss" ], // List of extensions recommended by VS Code that should not be recommended for users of this workspace. - "unwantedRecommendations": [ - - ] + "unwantedRecommendations": [] } From 33d693e8d20a0358f76cb3d5115733e68783ee5c Mon Sep 17 00:00:00 2001 From: gatzjames Date: Thu, 27 Mar 2025 12:10:47 +0100 Subject: [PATCH 8/9] update plugins on configs --- packages/insomnia-inso/.oxlintrc.json | 21 ++++++--------------- packages/insomnia-smoke-test/.oxlintrc.json | 20 +++++--------------- packages/insomnia-testing/.oxlintrc.json | 20 +++++--------------- packages/insomnia/.oxlintrc.json | 11 +++++++---- 4 files changed, 23 insertions(+), 49 deletions(-) diff --git a/packages/insomnia-inso/.oxlintrc.json b/packages/insomnia-inso/.oxlintrc.json index 49bfbc9de7b..936c6ed3f42 100644 --- a/packages/insomnia-inso/.oxlintrc.json +++ b/packages/insomnia-inso/.oxlintrc.json @@ -1,8 +1,10 @@ { - "$schema": "./node_modules/oxlint/configuration_schema.json", + "$schema": "../../node_modules/oxlint/configuration_schema.json", "plugins": [ - "react", - "typescript" + "typescript", + "oxc", + "import", + "node" ], "categories": { "correctness": "off" @@ -30,16 +32,6 @@ } ], "no-var": "error", - "react/no-unescaped-entities": "off", - "react/jsx-key": [ - "error", - { - "checkFragmentShorthand": true - } - ], - "react/no-array-index-key": "error", - "react/self-closing-comp": "error", - "react-hooks/rules-of-hooks": "error", "@typescript-eslint/array-type": [ "error", { @@ -65,7 +57,6 @@ } ], "@typescript-eslint/no-explicit-any": "off", - "react/no-find-dom-node": "off", "no-empty-function": "off" } -} \ No newline at end of file +} diff --git a/packages/insomnia-smoke-test/.oxlintrc.json b/packages/insomnia-smoke-test/.oxlintrc.json index 49bfbc9de7b..7d99ed8e4e9 100644 --- a/packages/insomnia-smoke-test/.oxlintrc.json +++ b/packages/insomnia-smoke-test/.oxlintrc.json @@ -1,8 +1,9 @@ { - "$schema": "./node_modules/oxlint/configuration_schema.json", + "$schema": "../../node_modules/oxlint/configuration_schema.json", "plugins": [ - "react", - "typescript" + "typescript", + "oxc", + "import" ], "categories": { "correctness": "off" @@ -30,16 +31,6 @@ } ], "no-var": "error", - "react/no-unescaped-entities": "off", - "react/jsx-key": [ - "error", - { - "checkFragmentShorthand": true - } - ], - "react/no-array-index-key": "error", - "react/self-closing-comp": "error", - "react-hooks/rules-of-hooks": "error", "@typescript-eslint/array-type": [ "error", { @@ -65,7 +56,6 @@ } ], "@typescript-eslint/no-explicit-any": "off", - "react/no-find-dom-node": "off", "no-empty-function": "off" } -} \ No newline at end of file +} diff --git a/packages/insomnia-testing/.oxlintrc.json b/packages/insomnia-testing/.oxlintrc.json index 49bfbc9de7b..7d99ed8e4e9 100644 --- a/packages/insomnia-testing/.oxlintrc.json +++ b/packages/insomnia-testing/.oxlintrc.json @@ -1,8 +1,9 @@ { - "$schema": "./node_modules/oxlint/configuration_schema.json", + "$schema": "../../node_modules/oxlint/configuration_schema.json", "plugins": [ - "react", - "typescript" + "typescript", + "oxc", + "import" ], "categories": { "correctness": "off" @@ -30,16 +31,6 @@ } ], "no-var": "error", - "react/no-unescaped-entities": "off", - "react/jsx-key": [ - "error", - { - "checkFragmentShorthand": true - } - ], - "react/no-array-index-key": "error", - "react/self-closing-comp": "error", - "react-hooks/rules-of-hooks": "error", "@typescript-eslint/array-type": [ "error", { @@ -65,7 +56,6 @@ } ], "@typescript-eslint/no-explicit-any": "off", - "react/no-find-dom-node": "off", "no-empty-function": "off" } -} \ No newline at end of file +} diff --git a/packages/insomnia/.oxlintrc.json b/packages/insomnia/.oxlintrc.json index 49bfbc9de7b..402bf735c86 100644 --- a/packages/insomnia/.oxlintrc.json +++ b/packages/insomnia/.oxlintrc.json @@ -1,8 +1,11 @@ { - "$schema": "./node_modules/oxlint/configuration_schema.json", + "$schema": "../../node_modules/oxlint/configuration_schema.json", "plugins": [ - "react", - "typescript" + "typescript", + "oxc", + "import", + "node", + "react" ], "categories": { "correctness": "off" @@ -68,4 +71,4 @@ "react/no-find-dom-node": "off", "no-empty-function": "off" } -} \ No newline at end of file +} From 342a9016a573bfafe6c7297605937be8096b468b Mon Sep 17 00:00:00 2001 From: gatzjames Date: Fri, 28 Mar 2025 16:17:49 +0100 Subject: [PATCH 9/9] no need for npx --- packages/insomnia-inso/package.json | 2 +- packages/insomnia-smoke-test/package.json | 1 + packages/insomnia-testing/package.json | 2 +- packages/insomnia/package.json | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/insomnia-inso/package.json b/packages/insomnia-inso/package.json index 42bbcc5892d..57f2534c89e 100644 --- a/packages/insomnia-inso/package.json +++ b/packages/insomnia-inso/package.json @@ -20,7 +20,7 @@ "inso": "bin/inso" }, "scripts": { - "lint": "npx oxlint", + "lint": "oxlint", "test:unit": "vitest run --exclude '**/cli.test.ts'", "test:bundle": "vitest cli.test.ts -t \"inso dev bundle\"", "test:binary": "vitest cli.test.ts -t \"inso packaged binary\"", diff --git a/packages/insomnia-smoke-test/package.json b/packages/insomnia-smoke-test/package.json index 3918dc10d00..9944bedefc3 100644 --- a/packages/insomnia-smoke-test/package.json +++ b/packages/insomnia-smoke-test/package.json @@ -13,6 +13,7 @@ }, "version": "11.0.1", "scripts": { + "lint": "oxlint", "test:dev": "xvfb-maybe cross-env BUNDLE=dev playwright test", "test:build": "xvfb-maybe cross-env BUNDLE=build playwright test", "test:package": "xvfb-maybe cross-env BUNDLE=package playwright test", diff --git a/packages/insomnia-testing/package.json b/packages/insomnia-testing/package.json index 65ac5651a9a..65a1bd54702 100644 --- a/packages/insomnia-testing/package.json +++ b/packages/insomnia-testing/package.json @@ -15,7 +15,7 @@ "main": "src/index.ts", "types": "src/index.ts", "scripts": { - "lint": "npx oxlint", + "lint": "oxlint", "test": "vitest run", "type-check": "tsc --noEmit --project tsconfig.json" }, diff --git a/packages/insomnia/package.json b/packages/insomnia/package.json index c7723397c24..647cf695f15 100644 --- a/packages/insomnia/package.json +++ b/packages/insomnia/package.json @@ -21,7 +21,7 @@ "build:app": "esr --cache ./scripts/build.ts --noErrorTruncation", "generate:schema": "esr ./src/schema.ts", "build:main.min.js": "cross-env NODE_ENV=development esr esbuild.main.ts", - "lint": "npx oxlint", + "lint": "oxlint", "package": "npm run build:app && cross-env USE_HARD_LINKS=false electron-builder build --config electron-builder.config.js", "package:windows:unpacked": "npm run build:app && cross-env USE_HARD_LINKS=false electron-builder build --config electron-builder.config.js --dir", "package:windows:dist": "cross-env USE_HARD_LINKS=false electron-builder build --config electron-builder.config.js --win squirrel --prepackaged ./dist/win-unpacked",