From f0ebf4ef5541b42995035cd8083b3a6e26b59a69 Mon Sep 17 00:00:00 2001 From: Kenneth Aasan Date: Tue, 23 Apr 2024 10:12:47 +0200 Subject: [PATCH 01/12] chore: migrate from tslint to eslint --- .eslintrc.json | 340 ++++++++++++++++ package-lock.json | 830 +++++++++++++++++++++++++++++++++----- package.json | 38 +- playground/.eslintrc.json | 3 - playground/package.json | 3 - 5 files changed, 1078 insertions(+), 136 deletions(-) create mode 100644 .eslintrc.json delete mode 100644 playground/.eslintrc.json diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000000000..181180bf1 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,340 @@ +{ + "env": { + "browser": true, + "es6": true + }, + "extends": [ + "next/core-web-vitals", + "plugin:@typescript-eslint/recommended", + "plugin:@typescript-eslint/recommended-requiring-type-checking", + "plugin:react/recommended", + "prettier" + ], + "settings": { + "next": { + "rootDir": "playground/" + } + }, + "parser": "@typescript-eslint/parser", + "parserOptions": { + "project": "tsconfig.base.json", + "sourceType": "module" + }, + "plugins": [ + "eslint-plugin-import", + "eslint-plugin-react", + "eslint-plugin-jsdoc", + "eslint-plugin-prefer-arrow", + "@typescript-eslint", + "@typescript-eslint/tslint" + ], + "root": true, + "rules": { + "@typescript-eslint/adjacent-overload-signatures": "error", + "@typescript-eslint/array-type": [ + "error", + { + "default": "array" + } + ], + "@typescript-eslint/ban-types": [ + "error", + { + "types": { + "Object": { + "message": "Avoid using the `Object` type. Did you mean `object`?" + }, + "Function": { + "message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`." + }, + "Boolean": { + "message": "Avoid using the `Boolean` type. Did you mean `boolean`?" + }, + "Number": { + "message": "Avoid using the `Number` type. Did you mean `number`?" + }, + "String": { + "message": "Avoid using the `String` type. Did you mean `string`?" + }, + "Symbol": { + "message": "Avoid using the `Symbol` type. Did you mean `symbol`?" + } + } + } + ], + "@typescript-eslint/consistent-type-assertions": "error", + "@typescript-eslint/dot-notation": "error", + "@typescript-eslint/explicit-function-return-type": "off", + "@typescript-eslint/explicit-member-accessibility": [ + "error", + { + "accessibility": "no-public" + } + ], + "@typescript-eslint/explicit-module-boundary-types": "off", + "@typescript-eslint/indent": "off", + "@typescript-eslint/member-delimiter-style": [ + "off", + { + "multiline": { + "delimiter": "none", + "requireLast": true + }, + "singleline": { + "delimiter": "semi", + "requireLast": false + } + } + ], + "@typescript-eslint/naming-convention": [ + "error", + { + "selector": "variable", + "format": ["camelCase", "UPPER_CASE", "PascalCase"], + "leadingUnderscore": "allow", + "trailingUnderscore": "forbid" + } + ], + "@typescript-eslint/no-empty-function": "error", + "@typescript-eslint/no-empty-interface": "error", + "@typescript-eslint/no-explicit-any": "off", + "@typescript-eslint/no-misused-new": "error", + "@typescript-eslint/no-namespace": "error", + "@typescript-eslint/no-parameter-properties": "off", + "@typescript-eslint/no-shadow": [ + "error", + { + "hoist": "all" + } + ], + "@typescript-eslint/no-unused-expressions": [ + "error", + { + "allowShortCircuit": true + } + ], + "@typescript-eslint/no-use-before-define": "off", + "@typescript-eslint/no-var-requires": "error", + "@typescript-eslint/prefer-for-of": "error", + "@typescript-eslint/prefer-function-type": "error", + "@typescript-eslint/prefer-namespace-keyword": "error", + "@typescript-eslint/quotes": "off", + "@typescript-eslint/semi": ["off", null], + "@typescript-eslint/triple-slash-reference": [ + "error", + { + "path": "always", + "types": "prefer-import", + "lib": "always" + } + ], + "@typescript-eslint/type-annotation-spacing": "off", + "@typescript-eslint/typedef": "off", + "@typescript-eslint/unified-signatures": "off", + "arrow-body-style": ["error", "always"], + "arrow-parens": ["off", "always"], + "brace-style": ["off", "off"], + "comma-dangle": "off", + "complexity": "off", + "constructor-super": "error", + "curly": "error", + "dot-notation": "off", + "eol-last": "off", + "eqeqeq": ["error", "always"], + "guard-for-in": "error", + "id-denylist": [ + "error", + "any", + "Number", + "number", + "String", + "string", + "Boolean", + "boolean", + "Undefined", + "undefined" + ], + "id-match": "error", + "import/order": [ + "off", + { + "alphabetize": { + "caseInsensitive": true, + "order": "asc" + }, + "newlines-between": "ignore", + "groups": [ + ["builtin", "external", "internal", "unknown", "object", "type"], + "parent", + ["sibling", "index"] + ], + "distinctGroup": false, + "pathGroupsExcludedImportTypes": [], + "pathGroups": [ + { + "pattern": "./", + "patternOptions": { + "nocomment": true, + "dot": true + }, + "group": "sibling", + "position": "before" + }, + { + "pattern": ".", + "patternOptions": { + "nocomment": true, + "dot": true + }, + "group": "sibling", + "position": "before" + }, + { + "pattern": "..", + "patternOptions": { + "nocomment": true, + "dot": true + }, + "group": "parent", + "position": "before" + }, + { + "pattern": "../", + "patternOptions": { + "nocomment": true, + "dot": true + }, + "group": "parent", + "position": "before" + } + ] + } + ], + "indent": "off", + "jsdoc/check-alignment": "error", + "jsdoc/check-indentation": "error", + "jsdoc/newline-after-description": "error", + "linebreak-style": "off", + "max-classes-per-file": ["error", 1], + "max-len": "off", + "new-parens": "off", + "newline-per-chained-call": "off", + "no-bitwise": "error", + "no-caller": "error", + "no-cond-assign": "error", + "no-console": [ + "error", + { + "allow": [ + "warn", + "dir", + "time", + "timeEnd", + "timeLog", + "trace", + "assert", + "clear", + "count", + "countReset", + "group", + "groupEnd", + "table", + "debug", + "dirxml", + "error", + "groupCollapsed", + "Console", + "profile", + "profileEnd", + "timeStamp", + "context" + ] + } + ], + "no-debugger": "error", + "no-duplicate-case": "error", + "no-duplicate-imports": "error", + "no-empty": "error", + "no-empty-function": "off", + "no-eval": "error", + "no-extra-semi": "off", + "no-fallthrough": "off", + "no-invalid-this": "off", + "no-irregular-whitespace": "off", + "no-multiple-empty-lines": "off", + "no-new-wrappers": "error", + "no-redeclare": "error", + "no-shadow": "off", + "no-throw-literal": "error", + "no-trailing-spaces": "off", + "no-undef-init": "error", + "no-underscore-dangle": "off", + "no-unsafe-finally": "error", + "no-unused-expressions": "off", + "no-unused-labels": "error", + "no-use-before-define": "off", + "no-var": "error", + "object-shorthand": "error", + "one-var": ["error", "never"], + "padded-blocks": [ + "off", + { + "blocks": "never" + }, + { + "allowSingleLineBlocks": true + } + ], + "prefer-arrow/prefer-arrow-functions": [ + "error", + { + "allowStandaloneDeclarations": true + } + ], + "prefer-const": "error", + "quote-props": "off", + "quotes": "off", + "radix": "error", + "react/jsx-boolean-value": "error", + "react/jsx-curly-spacing": "off", + "react/jsx-equals-spacing": "off", + "react/jsx-key": "error", + "react/jsx-no-bind": "off", + "react/jsx-tag-spacing": [ + "off", + { + "afterOpening": "allow", + "closingSlash": "allow" + } + ], + "react/jsx-wrap-multilines": "off", + "react/self-closing-comp": "error", + "semi": "off", + "space-before-function-paren": "off", + "space-in-parens": ["off", "never"], + "spaced-comment": [ + "error", + "always", + { + "markers": ["/"] + } + ], + "use-isnan": "error", + "valid-typeof": "off", + "@typescript-eslint/tslint/config": [ + "error", + { + "rules": { + "jsx-no-string-ref": true, + "react-hooks-nesting": true + } + } + ] + }, + "ignorePatterns": [ + "library/browser", + "browser/lib", + "playground/out", + "web-component/lib" + ] +} diff --git a/package-lock.json b/package-lock.json index 6a29d6a67..751232c8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -10,7 +10,17 @@ "web-component" ], "devDependencies": { + "@typescript-eslint/eslint-plugin": "^7.7.1", + "@typescript-eslint/eslint-plugin-tslint": "^7.0.2", + "@typescript-eslint/parser": "^7.7.1", "concurrently": "^6.0.1", + "eslint": "^8.57.0", + "eslint-config-next": "^14.2.2", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jsdoc": "^48.2.3", + "eslint-plugin-prefer-arrow": "^1.2.3", + "eslint-plugin-react": "^7.34.1", "husky": "^2.4.1", "lerna": "^8.1.2", "lint-staged": "15.2.2", @@ -19,10 +29,6 @@ "prettier": "^1.18.2", "react-split": "^2.0.9", "tslib": "^1.10.0", - "tslint": "^5.17.0", - "tslint-config-prettier": "^1.18.0", - "tslint-react": "^4.0.0", - "tslint-react-hooks": "^2.1.1", "typescript": "^5.3.3" }, "engines": { @@ -2465,6 +2471,20 @@ "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.0.tgz", "integrity": "sha512-VINS5vEYAscRl2ZUDiT3uMPlrFQupiKgHz5AA4bCH1miKBg4qtwkim1qPmJj/4WG6TreYMY111rEFsjupcOKHw==" }, + "node_modules/@es-joy/jsdoccomment": { + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.42.0.tgz", + "integrity": "sha512-R1w57YlVA6+YE01wch3GPYn6bCsrOV3YW/5oGGE2tmX6JcL9Nr+b5IikrjMPF+v9CV3ay+obImEdsDhovhJrzw==", + "dev": true, + "dependencies": { + "comment-parser": "1.4.1", + "esquery": "^1.5.0", + "jsdoc-type-pratt-parser": "~4.0.0" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -3632,9 +3652,9 @@ "integrity": "sha512-Py8zIo+02ht82brwwhTg36iogzFqGLPXlRGKQw5s+qP/kMNc4MAyDeEwBKDijk6zTIbegEgu8Qy7C1LboslQAw==" }, "node_modules/@next/eslint-plugin-next": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-14.1.0.tgz", - "integrity": "sha512-x4FavbNEeXx/baD/zC/SdrvkjSby8nBn8KcCREqk6UuwvwoAPZmaV8TFCAuo/cpovBRTIY67mHhe86MQQm/68Q==", + "version": "14.2.2", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-14.2.2.tgz", + "integrity": "sha512-q+Ec2648JtBpKiu/FSJm8HAsFXlNvioHeBCbTP12T1SGcHYwhqHULSfQgFkPgHDu3kzNp2Kem4J54bK4rPQ5SQ==", "dev": true, "dependencies": { "glob": "10.3.10" @@ -5529,6 +5549,12 @@ "integrity": "sha512-WZLiwShhwLRmeV6zH+GkbOFT6Z6VklCItrDioxUnv+u4Ll+8vKeFySoFyK/0ctcRpOmwAicELfmys1sDc/Rw+A==", "dev": true }, + "node_modules/@types/semver": { + "version": "7.5.8", + "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.5.8.tgz", + "integrity": "sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==", + "dev": true + }, "node_modules/@types/sinonjs__fake-timers": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-6.0.4.tgz", @@ -5596,27 +5622,34 @@ "@types/node": "*" } }, - "node_modules/@typescript-eslint/parser": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", - "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-7.7.1.tgz", + "integrity": "sha512-KwfdWXJBOviaBVhxO3p5TJiLpNuh2iyXyjmWN0f1nU87pwyvfS0EmjC6ukQVYVFJd/K1+0NWGPDXiyEyQorn0Q==", "dev": true, "dependencies": { - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", - "debug": "^4.3.4" + "@eslint-community/regexpp": "^4.10.0", + "@typescript-eslint/scope-manager": "7.7.1", + "@typescript-eslint/type-utils": "7.7.1", + "@typescript-eslint/utils": "7.7.1", + "@typescript-eslint/visitor-keys": "7.7.1", + "debug": "^4.3.4", + "graphemer": "^1.4.0", + "ignore": "^5.3.1", + "natural-compare": "^1.4.0", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" }, "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" + "@typescript-eslint/parser": "^7.0.0", + "eslint": "^8.56.0" }, "peerDependenciesMeta": { "typescript": { @@ -5624,14 +5657,13 @@ } } }, - "node_modules/@typescript-eslint/scope-manager": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", - "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "node_modules/@typescript-eslint/eslint-plugin-tslint": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin-tslint/-/eslint-plugin-tslint-7.0.2.tgz", + "integrity": "sha512-Os20XlgmnXPlfqcvO5I6asARarEXZ/BQ2WEHaphfN+d8CUq8H3lGM2ep3SGcwaF1PXpAxfNBDN8U4EYhliFfSQ==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0" + "@typescript-eslint/utils": "7.0.2" }, "engines": { "node": "^16.0.0 || >=18.0.0" @@ -5639,13 +5671,22 @@ "funding": { "type": "opencollective", "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0", + "tslint": "^5.0.0 || ^6.0.0", + "typescript": "*" } }, - "node_modules/@typescript-eslint/types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", - "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "node_modules/@typescript-eslint/eslint-plugin-tslint/node_modules/@typescript-eslint/scope-manager": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.0.2.tgz", + "integrity": "sha512-l6sa2jF3h+qgN2qUMjVR3uCNGjWw4ahGfzIYsCtFrQJCjhbrDPdiihYT8FnnqFwsWX+20hK592yX9I2rxKTP4g==", "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.0.2", + "@typescript-eslint/visitor-keys": "7.0.2" + }, "engines": { "node": "^16.0.0 || >=18.0.0" }, @@ -5654,14 +5695,27 @@ "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/@typescript-eslint/typescript-estree": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", - "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "node_modules/@typescript-eslint/eslint-plugin-tslint/node_modules/@typescript-eslint/types": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.0.2.tgz", + "integrity": "sha512-ZzcCQHj4JaXFjdOql6adYV4B/oFOFjPOC9XYwCaZFRvqN8Llfvv4gSxrkQkd2u4Ci62i2c6W6gkDwQJDaRc4nA==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/eslint-plugin-tslint/node_modules/@typescript-eslint/typescript-estree": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.0.2.tgz", + "integrity": "sha512-3AMc8khTcELFWcKcPc0xiLviEvvfzATpdPj/DXuOGIdQIIFybf4DMT1vKRbuAEOFMwhWt7NFLXRkbjsvKZQyvw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", + "@typescript-eslint/types": "7.0.2", + "@typescript-eslint/visitor-keys": "7.0.2", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -5682,7 +5736,49 @@ } } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "node_modules/@typescript-eslint/eslint-plugin-tslint/node_modules/@typescript-eslint/utils": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.0.2.tgz", + "integrity": "sha512-PZPIONBIB/X684bhT1XlrkjNZJIEevwkKDsdwfiu1WeqBxYEEdIgVDgm8/bbKHVu+6YOpeRqcfImTdImx/4Bsw==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "7.0.2", + "@typescript-eslint/types": "7.0.2", + "@typescript-eslint/typescript-estree": "7.0.2", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, + "node_modules/@typescript-eslint/eslint-plugin-tslint/node_modules/@typescript-eslint/visitor-keys": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.0.2.tgz", + "integrity": "sha512-8Y+YiBmqPighbm5xA2k4wKTxRzx9EkBu7Rlw+WHqMvRJ3RPz/BMBO9b2ru0LUNmXg120PHUXD5+SWFy2R8DqlQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.0.2", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/eslint-plugin-tslint/node_modules/brace-expansion": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", @@ -5691,7 +5787,7 @@ "balanced-match": "^1.0.0" } }, - "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "node_modules/@typescript-eslint/eslint-plugin-tslint/node_modules/minimatch": { "version": "9.0.3", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", @@ -5706,17 +5802,179 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/@typescript-eslint/parser": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-7.7.1.tgz", + "integrity": "sha512-vmPzBOOtz48F6JAGVS/kZYk4EkXao6iGrD838sp1w3NQQC0W8ry/q641KU4PrG7AKNAf56NOcR8GOpH8l9FPCw==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "7.7.1", + "@typescript-eslint/types": "7.7.1", + "@typescript-eslint/typescript-estree": "7.7.1", + "@typescript-eslint/visitor-keys": "7.7.1", + "debug": "^4.3.4" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/scope-manager": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-7.7.1.tgz", + "integrity": "sha512-PytBif2SF+9SpEUKynYn5g1RHFddJUcyynGpztX3l/ik7KmZEv19WCMhUBkHXPU9es/VWGD3/zg3wg90+Dh2rA==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.7.1", + "@typescript-eslint/visitor-keys": "7.7.1" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/type-utils": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-7.7.1.tgz", + "integrity": "sha512-ZksJLW3WF7o75zaBPScdW1Gbkwhd/lyeXGf1kQCxJaOeITscoSl0MjynVvCzuV5boUz/3fOI06Lz8La55mu29Q==", + "dev": true, + "dependencies": { + "@typescript-eslint/typescript-estree": "7.7.1", + "@typescript-eslint/utils": "7.7.1", + "debug": "^4.3.4", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/types": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-7.7.1.tgz", + "integrity": "sha512-AmPmnGW1ZLTpWa+/2omPrPfR7BcbUU4oha5VIbSbS1a1Tv966bklvLNXxp3mrbc+P2j4MNOTfDffNsk4o0c6/w==", + "dev": true, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/@typescript-eslint/typescript-estree": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-7.7.1.tgz", + "integrity": "sha512-CXe0JHCXru8Fa36dteXqmH2YxngKJjkQLjxzoj6LYwzZ7qZvgsLSc+eqItCrqIop8Vl2UKoAi0StVWu97FQZIQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "7.7.1", + "@typescript-eslint/visitor-keys": "7.7.1", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "^9.0.4", + "semver": "^7.6.0", + "ts-api-utils": "^1.3.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": { + "version": "9.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.4.tgz", + "integrity": "sha512-KqWh+VchfxcMNRAJjj2tnsSJdNbHsVgnkBhTNrW7AjVo6OvLtxw8zfT9oLw1JSohlFzJ8jCoTgaoXvJ+kHt6fw==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/@typescript-eslint/utils": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-7.7.1.tgz", + "integrity": "sha512-QUvBxPEaBXf41ZBbaidKICgVL8Hin0p6prQDu6bbetWo39BKbWJxRsErOzMNT1rXvTll+J7ChrbmMCXM9rsvOQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.15", + "@types/semver": "^7.5.8", + "@typescript-eslint/scope-manager": "7.7.1", + "@typescript-eslint/types": "7.7.1", + "@typescript-eslint/typescript-estree": "7.7.1", + "semver": "^7.6.0" + }, + "engines": { + "node": "^18.18.0 || >=20.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^8.56.0" + } + }, "node_modules/@typescript-eslint/visitor-keys": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", - "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-7.7.1.tgz", + "integrity": "sha512-gBL3Eq25uADw1LQ9kVpf3hRM+DWzs0uZknHYK3hq4jcTPqVCClHGDnB6UUUV2SFeBeA4KWHWbbLqmbGcZ4FYbw==", "dev": true, "dependencies": { - "@typescript-eslint/types": "6.21.0", - "eslint-visitor-keys": "^3.4.1" + "@typescript-eslint/types": "7.7.1", + "eslint-visitor-keys": "^3.4.3" }, "engines": { - "node": "^16.0.0 || >=18.0.0" + "node": "^18.18.0 || >=20.0.0" }, "funding": { "type": "opencollective", @@ -6418,6 +6676,15 @@ } ] }, + "node_modules/are-docs-informative": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", + "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", + "dev": true, + "engines": { + "node": ">=14" + } + }, "node_modules/are-we-there-yet": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", @@ -7593,6 +7860,7 @@ "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-1.1.1.tgz", "integrity": "sha512-wxXCdllwGhI2kCC0MnvTGYTMvnVZTvqgypkiTI8Pa5tcz2i6VqsqwYGgqwXji+4RgCzms6EajE4IxiUH6HH8nQ==", "dev": true, + "peer": true, "engines": { "node": ">=0.10.0" } @@ -8495,6 +8763,15 @@ "node": ">= 6" } }, + "node_modules/comment-parser": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", + "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", + "dev": true, + "engines": { + "node": ">= 12.0.0" + } + }, "node_modules/common-path-prefix": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", @@ -9895,6 +10172,7 @@ "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true, + "peer": true, "engines": { "node": ">=0.3.1" } @@ -10551,14 +10829,14 @@ } }, "node_modules/eslint-config-next": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-14.1.0.tgz", - "integrity": "sha512-SBX2ed7DoRFXC6CQSLc/SbLY9Ut6HxNB2wPTcoIWjUMd7aF7O/SIE7111L8FdZ9TXsNV4pulUDnfthpyPtbFUg==", + "version": "14.2.2", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-14.2.2.tgz", + "integrity": "sha512-12/uFc0KX+wUs7EDpOUGKMXBXZJiBVGdK5/m/QgXOCg2mQ0bQWoKSWNrCeOg7Vum6Kw1d1TW453W6xh+GbHquw==", "dev": true, "dependencies": { - "@next/eslint-plugin-next": "14.1.0", + "@next/eslint-plugin-next": "14.2.2", "@rushstack/eslint-patch": "^1.3.3", - "@typescript-eslint/parser": "^5.4.2 || ^6.0.0", + "@typescript-eslint/parser": "^5.4.2 || ^6.0.0 || 7.0.0 - 7.2.0", "eslint-import-resolver-node": "^0.3.6", "eslint-import-resolver-typescript": "^3.5.2", "eslint-plugin-import": "^2.28.1", @@ -10576,6 +10854,145 @@ } } }, + "node_modules/eslint-config-next/node_modules/@typescript-eslint/parser": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", + "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-config-next/node_modules/@typescript-eslint/scope-manager": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-config-next/node_modules/@typescript-eslint/types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-config-next/node_modules/@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-config-next/node_modules/@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-config-next/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/eslint-config-next/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/eslint-config-prettier": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-9.1.0.tgz", + "integrity": "sha512-NSWl5BFQWEPi1j4TjVNItzYV7dZXZ+wP6I6ZhrBGpChQhZRUaElihE9uRRkcbRnNb76UMKDF3r+WTmNcGPKsqw==", + "dev": true, + "bin": { + "eslint-config-prettier": "bin/cli.js" + }, + "peerDependencies": { + "eslint": ">=7.0.0" + } + }, "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", @@ -10708,6 +11125,39 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-jsdoc": { + "version": "48.2.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.3.tgz", + "integrity": "sha512-r9DMAmFs66VNvNqRLLjHejdnJtILrt3xGi+Qx0op0oRfFGVpOR1Hb3BC++MacseHx93d8SKYPhyrC9BS7Os2QA==", + "dev": true, + "dependencies": { + "@es-joy/jsdoccomment": "~0.42.0", + "are-docs-informative": "^0.0.2", + "comment-parser": "1.4.1", + "debug": "^4.3.4", + "escape-string-regexp": "^4.0.0", + "esquery": "^1.5.0", + "is-builtin-module": "^3.2.1", + "semver": "^7.6.0", + "spdx-expression-parse": "^4.0.0" + }, + "engines": { + "node": ">=18" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" + } + }, + "node_modules/eslint-plugin-jsdoc/node_modules/spdx-expression-parse": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", + "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", + "dev": true, + "dependencies": { + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" + } + }, "node_modules/eslint-plugin-jsx-a11y": { "version": "6.8.0", "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.8.0.tgz", @@ -10747,10 +11197,19 @@ "dequal": "^2.0.3" } }, + "node_modules/eslint-plugin-prefer-arrow": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.2.3.tgz", + "integrity": "sha512-J9I5PKCOJretVuiZRGvPQxCbllxGAV/viI20JO3LYblAodofBxyMnZAJ+WGeClHgANnSJberTNoFWWjrWKBuXQ==", + "dev": true, + "peerDependencies": { + "eslint": ">=2.0.0" + } + }, "node_modules/eslint-plugin-react": { - "version": "7.34.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.0.tgz", - "integrity": "sha512-MeVXdReleBTdkz/bvcQMSnCXGi+c9kvy51IpinjnJgutl3YTHWsDdke7Z1ufZpGfDG8xduBDKyjtB9JH1eBKIQ==", + "version": "7.34.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.1.tgz", + "integrity": "sha512-N97CxlouPT1AHt8Jn0mhhN2RrADlUAsk1/atcT2KyA/l9Q/E6ll7OIGwNumFmWfZ9skV3XXccYS19h80rHtgkw==", "dev": true, "dependencies": { "array-includes": "^3.1.7", @@ -13357,6 +13816,33 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, + "node_modules/is-builtin-module": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", + "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", + "dev": true, + "dependencies": { + "builtin-modules": "^3.3.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-builtin-module/node_modules/builtin-modules": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", + "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", + "dev": true, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -15093,6 +15579,15 @@ "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", "dev": true }, + "node_modules/jsdoc-type-pratt-parser": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", + "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", + "dev": true, + "engines": { + "node": ">=12.0.0" + } + }, "node_modules/jsdom": { "version": "16.7.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", @@ -25832,6 +26327,7 @@ "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.20.1.tgz", "integrity": "sha512-EcMxhzCFt8k+/UP5r8waCf/lzmeSyVlqxqMEDQE7rWYiQky8KpIBz1JAoYXfROHrPZ1XXd43q8yQnULOLiBRQg==", "dev": true, + "peer": true, "dependencies": { "@babel/code-frame": "^7.0.0", "builtin-modules": "^1.1.1", @@ -25857,61 +26353,12 @@ "typescript": ">=2.3.0-dev || >=2.4.0-dev || >=2.5.0-dev || >=2.6.0-dev || >=2.7.0-dev || >=2.8.0-dev || >=2.9.0-dev || >=3.0.0-dev || >= 3.1.0-dev || >= 3.2.0-dev" } }, - "node_modules/tslint-config-prettier": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/tslint-config-prettier/-/tslint-config-prettier-1.18.0.tgz", - "integrity": "sha512-xPw9PgNPLG3iKRxmK7DWr+Ea/SzrvfHtjFt5LBl61gk2UBG/DB9kCXRjv+xyIU1rUtnayLeMUVJBcMX8Z17nDg==", - "dev": true, - "bin": { - "tslint-config-prettier-check": "bin/check.js" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/tslint-react": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/tslint-react/-/tslint-react-4.1.0.tgz", - "integrity": "sha512-Y7CbFn09X7Mpg6rc7t/WPbmjx9xPI8p1RsQyiGCLWgDR6sh3+IBSlT+bEkc0PSZcWwClOkqq2wPsID8Vep6szQ==", - "dev": true, - "dependencies": { - "tsutils": "^3.9.1" - }, - "peerDependencies": { - "tslint": "^5.1.0", - "typescript": ">=2.8.0" - } - }, - "node_modules/tslint-react-hooks": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/tslint-react-hooks/-/tslint-react-hooks-2.2.2.tgz", - "integrity": "sha512-gtwA14+WevNUtlBhvAD5Ukpxt2qMegYI7IDD8zN/3JXLksdLdEuU/T/oqlI1CtZhMJffqyNn+aqq2oUqUFXiNA==", - "dev": true, - "peerDependencies": { - "tslint": "5 - 6", - "typescript": ">=2.1.0" - } - }, - "node_modules/tslint-react/node_modules/tsutils": { - "version": "3.21.0", - "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", - "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", - "dev": true, - "dependencies": { - "tslib": "^1.8.1" - }, - "engines": { - "node": ">= 6" - }, - "peerDependencies": { - "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" - } - }, "node_modules/tslint/node_modules/ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, + "peer": true, "dependencies": { "color-convert": "^1.9.0" }, @@ -25924,6 +26371,7 @@ "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, + "peer": true, "dependencies": { "sprintf-js": "~1.0.2" } @@ -25933,6 +26381,7 @@ "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, + "peer": true, "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -25947,6 +26396,7 @@ "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, + "peer": true, "dependencies": { "color-name": "1.1.3" } @@ -25955,19 +26405,22 @@ "version": "1.1.3", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "dev": true, + "peer": true }, "node_modules/tslint/node_modules/commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", - "dev": true + "dev": true, + "peer": true }, "node_modules/tslint/node_modules/escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", "dev": true, + "peer": true, "engines": { "node": ">=0.8.0" } @@ -25977,6 +26430,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "dev": true, + "peer": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -25997,6 +26451,7 @@ "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, + "peer": true, "engines": { "node": ">=4" } @@ -26006,6 +26461,7 @@ "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.1.tgz", "integrity": "sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==", "dev": true, + "peer": true, "dependencies": { "argparse": "^1.0.7", "esprima": "^4.0.0" @@ -26019,6 +26475,7 @@ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", "dev": true, + "peer": true, "dependencies": { "minimist": "^1.2.6" }, @@ -26031,6 +26488,7 @@ "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", "dev": true, + "peer": true, "bin": { "semver": "bin/semver" } @@ -26039,13 +26497,15 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==", - "dev": true + "dev": true, + "peer": true }, "node_modules/tslint/node_modules/supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, + "peer": true, "dependencies": { "has-flag": "^3.0.0" }, @@ -26058,6 +26518,7 @@ "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", "integrity": "sha512-g5JVHCIJwzfISaXpXE1qvNalca5Jwob6FjI4AoPlqMusJ6ftFE7IkkFoMhVLRgK+4Kx3gkzb8UZK5t5yTTvEmA==", "dev": true, + "peer": true, "dependencies": { "tslib": "^1.8.1" }, @@ -27656,13 +28117,21 @@ "@types/react": "^18", "@types/react-dom": "^18", "autoprefixer": "^10.0.1", - "eslint": "^8", "eslint-config-next": "14.1.0", "postcss": "^8", "tailwindcss": "^3.3.0", "typescript": "^5" } }, + "playground/node_modules/@next/eslint-plugin-next": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-14.1.0.tgz", + "integrity": "sha512-x4FavbNEeXx/baD/zC/SdrvkjSby8nBn8KcCREqk6UuwvwoAPZmaV8TFCAuo/cpovBRTIY67mHhe86MQQm/68Q==", + "dev": true, + "dependencies": { + "glob": "10.3.10" + } + }, "playground/node_modules/@types/node": { "version": "20.11.27", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.27.tgz", @@ -27692,6 +28161,159 @@ "@types/react": "*" } }, + "playground/node_modules/@typescript-eslint/parser": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", + "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "playground/node_modules/@typescript-eslint/scope-manager": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "playground/node_modules/@typescript-eslint/types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "playground/node_modules/@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "playground/node_modules/@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "playground/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "playground/node_modules/eslint-config-next": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-14.1.0.tgz", + "integrity": "sha512-SBX2ed7DoRFXC6CQSLc/SbLY9Ut6HxNB2wPTcoIWjUMd7aF7O/SIE7111L8FdZ9TXsNV4pulUDnfthpyPtbFUg==", + "dev": true, + "dependencies": { + "@next/eslint-plugin-next": "14.1.0", + "@rushstack/eslint-patch": "^1.3.3", + "@typescript-eslint/parser": "^5.4.2 || ^6.0.0", + "eslint-import-resolver-node": "^0.3.6", + "eslint-import-resolver-typescript": "^3.5.2", + "eslint-plugin-import": "^2.28.1", + "eslint-plugin-jsx-a11y": "^6.7.1", + "eslint-plugin-react": "^7.33.2", + "eslint-plugin-react-hooks": "^4.5.0 || 5.0.0-canary-7118f5dd7-20230705" + }, + "peerDependencies": { + "eslint": "^7.23.0 || ^8.0.0", + "typescript": ">=3.3.1" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "playground/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "playground/node_modules/object-hash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", diff --git a/package.json b/package.json index d99e02c21..af2554959 100644 --- a/package.json +++ b/package.json @@ -28,9 +28,8 @@ "build:library": "cd library && npm run prepare", "build:webcomponent": "cd web-component && npm run bundle", "build:playground": "cd playground && npm run build", - "lint": "tslint -c ./tslint.json --project tsconfig.base.json --format verbose && prettier --check \"**/*.{ts,tsx,js,jsx,json,html,css,yaml}\"", - "lint:fix": "tslint -c ./tslint.json --project tsconfig.base.json --format verbose --fix && prettier --write \"**/*.{ts,tsx,js,jsx,json,html,css,yaml}\"", - "conflict-check": "tslint-config-prettier-check ./tslint.json", + "lint": "eslint --max-warnings 0 .", + "lint:fix": "eslint --max-warnings 0 . --fix", "markdownlint": "markdownlint **/*.md", "prepublishOnly": "npm run build", "gen-readme-toc": "markdown-toc -i README.md", @@ -45,36 +44,23 @@ "get:version": "cd library && npm run get:version" }, "devDependencies": { + "@typescript-eslint/eslint-plugin": "^7.7.1", + "@typescript-eslint/eslint-plugin-tslint": "^7.0.2", + "@typescript-eslint/parser": "^7.7.1", "concurrently": "^6.0.1", - "husky": "^2.4.1", + "eslint": "^8.57.0", + "eslint-config-next": "^14.2.2", + "eslint-config-prettier": "^9.1.0", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jsdoc": "^48.2.3", + "eslint-plugin-prefer-arrow": "^1.2.3", + "eslint-plugin-react": "^7.34.1", "lerna": "^8.1.2", - "lint-staged": "15.2.2", "markdown-toc": "^1.2.0", "markdownlint-cli": "^0.17.0", "prettier": "^1.18.2", "react-split": "^2.0.9", "tslib": "^1.10.0", - "tslint": "^5.17.0", - "tslint-config-prettier": "^1.18.0", - "tslint-react": "^4.0.0", - "tslint-react-hooks": "^2.1.1", "typescript": "^5.3.3" - }, - "lint-staged": { - "linters": { - "**/*.{ts,tsx,js,jsx,json,css,html,yaml}": [ - "prettier --write", - "git add" - ] - }, - "ignore": [ - "package.json", - "package-lock.json" - ] - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } } } diff --git a/playground/.eslintrc.json b/playground/.eslintrc.json deleted file mode 100644 index bffb357a7..000000000 --- a/playground/.eslintrc.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": "next/core-web-vitals" -} diff --git a/playground/package.json b/playground/package.json index f3fc4d2bb..32d40510c 100644 --- a/playground/package.json +++ b/playground/package.json @@ -5,7 +5,6 @@ "scripts": { "build": "next build && touch out/.nojekyll", "start": "next dev", - "lint": "next lint", "install:reactcomp": "chmod +x ./bump-react-comp.sh && ./bump-react-comp.sh" }, "dependencies": { @@ -24,8 +23,6 @@ "@types/react": "^18", "@types/react-dom": "^18", "autoprefixer": "^10.0.1", - "eslint": "^8", - "eslint-config-next": "14.1.0", "postcss": "^8", "tailwindcss": "^3.3.0", "typescript": "^5" From e9d4fae939889c1e8dc3ca94307b8015d783807b Mon Sep 17 00:00:00 2001 From: Kenneth Aasan Date: Tue, 23 Apr 2024 10:59:20 +0200 Subject: [PATCH 02/12] chore: migrate from tslint to eslint --- .eslintrc.json | 51 +------------------ .../src/components/__tests__/Schema.test.tsx | 22 ++++---- .../src/containers/AsyncApi/Standalone.tsx | 4 +- .../containers/Messages/MessageExample.tsx | 3 ++ .../src/containers/Operations/Operation.tsx | 36 ++++--------- library/src/containers/Servers/Security.tsx | 1 + library/src/containers/Sidebar/Sidebar.tsx | 3 ++ .../Sidebar/__tests__/SideBar.test.tsx | 14 ++--- library/src/helpers/__tests__/schema.test.ts | 39 ++++++-------- library/src/helpers/marked.ts | 13 +++-- library/src/helpers/message.ts | 5 +- library/src/helpers/parser.ts | 3 ++ library/src/helpers/schema.ts | 20 +++++++- library/src/helpers/specification.ts | 8 +-- library/src/standalone-codebase.ts | 8 ++- library/src/standalone-without-parser.ts | 2 + library/src/standalone.ts | 2 + package.json | 1 - playground/app/layout.tsx | 1 + playground/app/page.tsx | 2 +- playground/components/CodeEditorComponent.tsx | 2 +- playground/components/SplitWrapper.tsx | 2 +- playground/components/Tab.tsx | 2 +- playground/components/Tabs.tsx | 3 +- playground/utils/helpers.ts | 6 ++- tslint.json | 42 --------------- 26 files changed, 117 insertions(+), 178 deletions(-) delete mode 100644 tslint.json diff --git a/.eslintrc.json b/.eslintrc.json index 181180bf1..a9d31a41a 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -24,44 +24,12 @@ "eslint-plugin-import", "eslint-plugin-react", "eslint-plugin-jsdoc", - "eslint-plugin-prefer-arrow", "@typescript-eslint", "@typescript-eslint/tslint" ], "root": true, "rules": { "@typescript-eslint/adjacent-overload-signatures": "error", - "@typescript-eslint/array-type": [ - "error", - { - "default": "array" - } - ], - "@typescript-eslint/ban-types": [ - "error", - { - "types": { - "Object": { - "message": "Avoid using the `Object` type. Did you mean `object`?" - }, - "Function": { - "message": "Avoid using the `Function` type. Prefer a specific function type, like `() => void`." - }, - "Boolean": { - "message": "Avoid using the `Boolean` type. Did you mean `boolean`?" - }, - "Number": { - "message": "Avoid using the `Number` type. Did you mean `number`?" - }, - "String": { - "message": "Avoid using the `String` type. Did you mean `string`?" - }, - "Symbol": { - "message": "Avoid using the `Symbol` type. Did you mean `symbol`?" - } - } - } - ], "@typescript-eslint/consistent-type-assertions": "error", "@typescript-eslint/dot-notation": "error", "@typescript-eslint/explicit-function-return-type": "off", @@ -131,7 +99,6 @@ "@typescript-eslint/type-annotation-spacing": "off", "@typescript-eslint/typedef": "off", "@typescript-eslint/unified-signatures": "off", - "arrow-body-style": ["error", "always"], "arrow-parens": ["off", "always"], "brace-style": ["off", "off"], "comma-dangle": "off", @@ -213,7 +180,6 @@ "indent": "off", "jsdoc/check-alignment": "error", "jsdoc/check-indentation": "error", - "jsdoc/newline-after-description": "error", "linebreak-style": "off", "max-classes-per-file": ["error", 1], "max-len": "off", @@ -285,12 +251,6 @@ "allowSingleLineBlocks": true } ], - "prefer-arrow/prefer-arrow-functions": [ - "error", - { - "allowStandaloneDeclarations": true - } - ], "prefer-const": "error", "quote-props": "off", "quotes": "off", @@ -320,16 +280,7 @@ } ], "use-isnan": "error", - "valid-typeof": "off", - "@typescript-eslint/tslint/config": [ - "error", - { - "rules": { - "jsx-no-string-ref": true, - "react-hooks-nesting": true - } - } - ] + "valid-typeof": "off" }, "ignorePatterns": [ "library/browser", diff --git a/library/src/components/__tests__/Schema.test.tsx b/library/src/components/__tests__/Schema.test.tsx index 2c840fd9b..0756993bc 100644 --- a/library/src/components/__tests__/Schema.test.tsx +++ b/library/src/components/__tests__/Schema.test.tsx @@ -9,20 +9,20 @@ import { SchemaV2 as SchemaModel } from '@asyncapi/parser'; import { Schema } from '../Schema'; describe('Schema component', () => { - test('should work with true schema', async () => { + test('should work with true schema', () => { const schema = true; - const schemaModel = new SchemaModel(schema as any); + const schemaModel = new SchemaModel(schema as never); render(); }); - test('should work with false schema', async () => { + test('should work with false schema', () => { const schema = false; - const schemaModel = new SchemaModel(schema as any); + const schemaModel = new SchemaModel(schema as never); render(); }); - test('should work with circular references in schema', async () => { + test('should work with circular references in schema', () => { const schema = { type: 'object', properties: { @@ -35,7 +35,7 @@ describe('Schema component', () => { }; schema.properties.circular = schema; schema.properties.circularTwo = schema; - const schemaModel = new SchemaModel(schema as any); + const schemaModel = new SchemaModel(schema as never); render(); @@ -49,7 +49,7 @@ describe('Schema component', () => { }); describe('should render boolean values', () => { - test('defined as defaults', async () => { + test('defined as defaults', () => { const schema = { type: 'object', properties: { @@ -63,7 +63,7 @@ describe('Schema component', () => { }, }, }; - const schemaModel = new SchemaModel(schema as any); + const schemaModel = new SchemaModel(schema as never); render(); @@ -71,7 +71,7 @@ describe('Schema component', () => { expect(screen.getByText('false')).toBeDefined(); }); - test('defined as const', async () => { + test('defined as const', () => { const schema = { type: 'object', properties: { @@ -85,7 +85,7 @@ describe('Schema component', () => { }, }, }; - const schemaModel = new SchemaModel(schema as any); + const schemaModel = new SchemaModel(schema as never); render(); @@ -95,7 +95,7 @@ describe('Schema component', () => { }); describe('should render arrays', () => { - test('which includes oneOf', async () => { + test('which includes oneOf', () => { const schemaModel = new SchemaModel({ title: 'Sets', type: 'array', diff --git a/library/src/containers/AsyncApi/Standalone.tsx b/library/src/containers/AsyncApi/Standalone.tsx index 4f5d72fb6..3d9f6e243 100644 --- a/library/src/containers/AsyncApi/Standalone.tsx +++ b/library/src/containers/AsyncApi/Standalone.tsx @@ -34,13 +34,13 @@ class AsyncApiComponent extends Component { } } - async componentDidMount() { + componentDidMount() { if (!this.state.asyncapi) { this.updateState(this.props.schema); } } - async componentDidUpdate(prevProps: AsyncApiProps) { + componentDidUpdate(prevProps: AsyncApiProps) { const oldSchema = prevProps.schema; const newSchema = this.props.schema; diff --git a/library/src/containers/Messages/MessageExample.tsx b/library/src/containers/Messages/MessageExample.tsx index 7b32ae4ad..42a3b5102 100644 --- a/library/src/containers/Messages/MessageExample.tsx +++ b/library/src/containers/Messages/MessageExample.tsx @@ -59,6 +59,7 @@ export const Example: React.FunctionComponent = ({ setExpanded( (config && config.expand && config.expand.messageExamples) || false, ); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [config.expand]); return ( @@ -93,6 +94,7 @@ export const Example: React.FunctionComponent = ({ )}
@@ -102,6 +104,7 @@ export const Example: React.FunctionComponent = ({ ) : (
diff --git a/library/src/containers/Operations/Operation.tsx b/library/src/containers/Operations/Operation.tsx index 2e46ce0a3..ffaf58fdf 100644 --- a/library/src/containers/Operations/Operation.tsx +++ b/library/src/containers/Operations/Operation.tsx @@ -75,11 +75,7 @@ export const Operation: React.FunctionComponent = props => { config, )} > - +
)} @@ -145,7 +141,7 @@ export const Operation: React.FunctionComponent = props => { .all() .map((msg, idx) => (
  • - +
  • ))} @@ -154,10 +150,7 @@ export const Operation: React.FunctionComponent = props => {

    Accepts the following message:

    - +
    )} @@ -266,7 +259,7 @@ export const OperationReplyInfo: React.FunctionComponent = props => {
    = props => {
    @@ -344,11 +337,7 @@ export const OperationReplyInfo: React.FunctionComponent = props => {
      {replyMessages.all().map((msg, idx) => (
    • - +
    • ))}
    @@ -358,7 +347,7 @@ export const OperationReplyInfo: React.FunctionComponent = props => {
    @@ -439,7 +428,7 @@ export const OperationReplyChannelInfo: React.FunctionComponent = ({ .all() .map((msg, idx) => (
  • - +
  • ))} @@ -448,10 +437,7 @@ export const OperationReplyChannelInfo: React.FunctionComponent = ({
    Message:
    - +
    )} @@ -463,7 +449,7 @@ export const OperationReplyChannelInfo: React.FunctionComponent = ({ config, )} > - +
    )} {channel.bindings() && ( @@ -493,7 +479,7 @@ export const OperationReplyAddressInfo: React.FunctionComponent = ({
    diff --git a/library/src/containers/Servers/Security.tsx b/library/src/containers/Servers/Security.tsx index ad125cd04..167573319 100644 --- a/library/src/containers/Servers/Security.tsx +++ b/library/src/containers/Servers/Security.tsx @@ -50,6 +50,7 @@ export const Security: React.FunctionComponent = ({ diff --git a/library/src/containers/Sidebar/Sidebar.tsx b/library/src/containers/Sidebar/Sidebar.tsx index d3ff1846e..803ba6524 100644 --- a/library/src/containers/Sidebar/Sidebar.tsx +++ b/library/src/containers/Sidebar/Sidebar.tsx @@ -16,6 +16,7 @@ export const Sidebar: React.FunctionComponent = () => { const asyncapi = useSpec(); const info = asyncapi.info(); + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const logo = info .extensions() .get('x-logo') @@ -123,7 +124,9 @@ export const Sidebar: React.FunctionComponent = () => {
    {logo ? ( + // eslint-disable-next-line @next/next/no-img-element {`${info.title()} diff --git a/library/src/containers/Sidebar/__tests__/SideBar.test.tsx b/library/src/containers/Sidebar/__tests__/SideBar.test.tsx index 9c6b8da5a..0228782f6 100644 --- a/library/src/containers/Sidebar/__tests__/SideBar.test.tsx +++ b/library/src/containers/Sidebar/__tests__/SideBar.test.tsx @@ -17,7 +17,7 @@ describe('Sidebar component', () => { expect(parsedDoc.asyncapi).toBeDefined(); parsed = parsedDoc.asyncapi!; }); - test('should render sidebar with showOperations: byDefault', async () => { + test('should render sidebar with showOperations: byDefault', () => { render( { , ); }); - test('should render sidebar with showOperations: byOperationsTags', async () => { + test('should render sidebar with showOperations: byOperationsTags', () => { render( { , ); }); - test('should render sidebar with showOperations: bySpecTags', async () => { + test('should render sidebar with showOperations: bySpecTags', () => { render( { , ); }); - test('should render sidebar with showServers: byDefault', async () => { + test('should render sidebar with showServers: byDefault', () => { render( @@ -59,7 +59,7 @@ describe('Sidebar component', () => { , ); }); - test('should render sidebar with showServers: byServersTags', async () => { + test('should render sidebar with showServers: byServersTags', () => { render( { , ); }); - test('should render sidebar with showServers: bySpecTags', async () => { + test('should render sidebar with showServers: bySpecTags', () => { render( { , ); }); - test('should render with showOperations: byDefault, showServers: byDefault', async () => { + test('should render with showOperations: byDefault, showServers: byDefault', () => { render( { describe('.toSchemaType', () => { test('should handle falsy value', () => { - const result = SchemaHelpers.toSchemaType(null as any); + const result = SchemaHelpers.toSchemaType(null as never); expect(result).toEqual(SchemaCustomTypes.UNKNOWN); }); test('should handle object without .json() function', () => { - const result = SchemaHelpers.toSchemaType({} as any); + const result = SchemaHelpers.toSchemaType({} as never); expect(result).toEqual(SchemaCustomTypes.UNKNOWN); }); @@ -427,7 +427,8 @@ describe('SchemaHelpers', () => { const variables = new ServerVariablesV2([ new ServerVariable( { enum: ['foo', 'bar'], default: 'foo' }, - { asyncapi: {} as any, pointer: '', id: 'foo' }, + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + { asyncapi: {} as never, pointer: '', id: 'foo' }, ), new ServerVariable( { @@ -436,7 +437,7 @@ describe('SchemaHelpers', () => { examples: ['foo', 'bar'], description: 'Some description', }, - { asyncapi: {} as any, pointer: '', id: 'bar' }, + { asyncapi: {} as never, pointer: '', id: 'bar' }, ), ]); const schema = new Schema({ @@ -469,7 +470,7 @@ describe('SchemaHelpers', () => { for (const [paramProperty, param] of Object.entries(parameters)) { params.push( new ChannelParameter(param as ParameterObject, { - asyncapi: {} as any, + asyncapi: {} as never, pointer: '', id: paramProperty, }), @@ -545,8 +546,7 @@ describe('SchemaHelpers', () => { const: 'foobar', 'x-schema-private-raw-value': true, }); - const result = SchemaHelpers.jsonToSchema(json); - expect(result).toEqual(schema); + expect(SchemaHelpers.jsonToSchema(json)).toEqual(schema); }); test('should transform number to schema', () => { @@ -556,8 +556,7 @@ describe('SchemaHelpers', () => { const: '2137', 'x-schema-private-raw-value': true, }); - const result = SchemaHelpers.jsonToSchema(json); - expect(result).toEqual(schema); + expect(SchemaHelpers.jsonToSchema(json)).toEqual(schema); }); test('should transform boolean to schema', () => { @@ -567,8 +566,7 @@ describe('SchemaHelpers', () => { const: 'true', 'x-schema-private-raw-value': true, }); - const result = SchemaHelpers.jsonToSchema(json); - expect(result).toEqual(schema); + expect(SchemaHelpers.jsonToSchema(json)).toEqual(schema); }); test('should transform array to schema', () => { @@ -594,8 +592,7 @@ describe('SchemaHelpers', () => { ], 'x-schema-private-render-additional-info': false, }); - const result = SchemaHelpers.jsonToSchema(json); - expect(result).toEqual(schema); + expect(SchemaHelpers.jsonToSchema(json)).toEqual(schema); }); test('should transform object to schema', () => { @@ -613,8 +610,7 @@ describe('SchemaHelpers', () => { }, 'x-schema-private-render-additional-info': false, }); - const result = SchemaHelpers.jsonToSchema(json); - expect(result).toEqual(schema); + expect(SchemaHelpers.jsonToSchema(json)).toEqual(schema); }); test('should transform complex data to schema', () => { @@ -654,28 +650,25 @@ describe('SchemaHelpers', () => { }, 'x-schema-private-render-additional-info': false, }); - const result = SchemaHelpers.jsonToSchema(json); - expect(result).toEqual(schema); + expect(SchemaHelpers.jsonToSchema(json)).toEqual(schema); }); test('should return empty string when data is null', () => { - const result = SchemaHelpers.jsonToSchema(null); const schema = new Schema({ type: 'string', const: '', 'x-schema-private-raw-value': true, }); - expect(result).toEqual(schema); + expect(SchemaHelpers.jsonToSchema(null)).toEqual(schema); }); test('should return empty string when data is undefined', () => { - const result = SchemaHelpers.jsonToSchema(undefined); const schema = new Schema({ type: 'string', const: '', 'x-schema-private-raw-value': true, }); - expect(result).toEqual(schema); + expect(SchemaHelpers.jsonToSchema(undefined)).toEqual(schema); }); }); @@ -806,7 +799,7 @@ describe('SchemaHelpers', () => { }, }, }; - const schema = new Schema(jsonSchema as any); + const schema = new Schema(jsonSchema as never); const expected = new Schema({ type: 'object', properties: { @@ -851,7 +844,7 @@ describe('SchemaHelpers', () => { }, }, }; - const schema = new Schema(jsonSchema as any); + const schema = new Schema(jsonSchema as never); const expected = new Schema({ type: 'object', properties: { diff --git a/library/src/helpers/marked.ts b/library/src/helpers/marked.ts index 12deb76a4..5fd1a38e2 100644 --- a/library/src/helpers/marked.ts +++ b/library/src/helpers/marked.ts @@ -1,27 +1,32 @@ import { marked } from 'marked'; -// @ts-ignore +// @ts-expect-error no types import hljs from 'highlight.js/lib/core'; -// @ts-ignore +// @ts-expect-error no types import json from 'highlight.js/lib/languages/json'; +// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access hljs.registerLanguage('json', json); -// @ts-ignore +// @ts-expect-error no types import yaml from 'highlight.js/lib/languages/yaml'; +// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call hljs.registerLanguage('yaml', yaml); -// @ts-ignore +// @ts-expect-error no types import bash from 'highlight.js/lib/languages/bash'; +// eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access hljs.registerLanguage('bash', bash); const markedOptions: marked.MarkedOptions = { langPrefix: 'hljs language-', highlight: (code, language) => { + // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access if (!hljs.getLanguage(language)) { return code; } try { + // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access return hljs.highlight(code, { language }).value; } catch (e) { return code; diff --git a/library/src/helpers/message.ts b/library/src/helpers/message.ts index bf21d946a..184d64ecb 100644 --- a/library/src/helpers/message.ts +++ b/library/src/helpers/message.ts @@ -1,5 +1,4 @@ import { MessageInterface } from '@asyncapi/parser'; -// @ts-ignore import { sample } from 'openapi-sampler'; import { MessageExample } from '../types'; @@ -7,6 +6,7 @@ import { MessageExample } from '../types'; export class MessageHelpers { static generateExample(schema: any, options: any = {}) { try { + // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-argument return this.sanitizeExample(sample(schema, options)) || ''; } catch (e) { return ''; @@ -15,6 +15,7 @@ export class MessageHelpers { static sanitizeExample(schema: any): any { if (typeof schema === 'object' && schema && !Array.isArray(schema)) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument return Object.entries(schema).reduce((obj, [propertyName, property]) => { if ( !propertyName.startsWith('x-parser-') && @@ -54,6 +55,7 @@ export class MessageHelpers { const payload = msg.payload(); if (payload?.examples()) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment return payload.examples()?.map(example => ({ example })); } return; @@ -84,6 +86,7 @@ export class MessageHelpers { const headers = msg.headers(); if (headers?.examples()) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment return headers.examples()?.map(example => ({ example })); } return undefined; diff --git a/library/src/helpers/parser.ts b/library/src/helpers/parser.ts index a078bcef9..afd6edc60 100644 --- a/library/src/helpers/parser.ts +++ b/library/src/helpers/parser.ts @@ -14,10 +14,12 @@ asyncapiParser.registerSchemaParser(ProtoBuffSchemaParser()); export class Parser { static async parse( + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents content: string | any, parserOptions?: any, ): Promise { try { + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const { document } = await asyncapiParser.parse(content, parserOptions); return { asyncapi: document }; } catch (err) { @@ -35,6 +37,7 @@ export class Parser { arg.url, arg.requestOptions as any, ); + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument const { document } = await fromResult.parse(parserOptions); return { asyncapi: document }; } catch (err) { diff --git a/library/src/helpers/schema.ts b/library/src/helpers/schema.ts index b2c8ebbe3..d7b5a68ec 100644 --- a/library/src/helpers/schema.ts +++ b/library/src/helpers/schema.ts @@ -122,6 +122,7 @@ export class SchemaHelpers { static prettifyValue(value: any, strict = true): string { const typeOf = typeof value; if (typeOf === 'string') { + // eslint-disable-next-line @typescript-eslint/no-unsafe-return return strict ? `"${value}"` : value; } if (typeOf === 'number' || typeOf === 'bigint' || typeOf === 'boolean') { @@ -234,6 +235,7 @@ export class SchemaHelpers { required: Object.keys(obj), [this.extRenderAdditionalInfo]: false, }; + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument return new SchemaClass(json as any); } @@ -261,11 +263,14 @@ export class SchemaHelpers { required: Object.keys(obj), [this.extRenderAdditionalInfo]: false, }; + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument return new SchemaClass(json as any); } static jsonToSchema(value: any): any { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const json = this.jsonFieldToSchema(value); + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument return new SchemaClass(json); } @@ -276,9 +281,11 @@ export class SchemaHelpers { * @param value */ static getCustomExtensions(value: any) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access if (!value || typeof value.extensions !== 'function') { return; } + // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access const extensions = value.extensions() as ExtensionsInterface; const filteredExtensions: Record = {}; for (const ext of extensions.all()) { @@ -345,7 +352,8 @@ export class SchemaHelpers { properties: Object.entries(records).reduce( (obj, [propertyName, propertySchema]) => { obj[propertyName] = { - ...(propertySchema.json() as Record), + // @ts-expect-error add proper check + ...propertySchema.json(), }; return obj; }, @@ -353,6 +361,7 @@ export class SchemaHelpers { ), [this.extRenderAdditionalInfo]: false, }; + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument return new SchemaClass(json as any); } @@ -418,6 +427,7 @@ export class SchemaHelpers { return types; } + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const constValue = schema.const(); if (constValue !== undefined) { return typeof constValue; @@ -515,10 +525,13 @@ export class SchemaHelpers { }; } if (typeof value !== 'object') { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const str = + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call typeof value.toString === 'function' ? value.toString() : value; return { type: 'string', + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const: str, [this.extRawValue]: true, }; @@ -529,12 +542,14 @@ export class SchemaHelpers { if (Array.isArray(value)) { return { type: 'array', + // eslint-disable-next-line @typescript-eslint/no-unsafe-return items: value.map(v => this.jsonFieldToSchema(v)), [this.extRenderAdditionalInfo]: false, }; } return { type: 'object', + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument properties: Object.entries(value).reduce((obj, [k, v]) => { obj[k] = this.jsonFieldToSchema(v); return obj; @@ -547,8 +562,11 @@ export class SchemaHelpers { if ( value && typeof value === 'object' && + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access (jsonSchemaTypes.includes(value.type) || + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access (Array.isArray(value.type) && + // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access value.type.some((t: string) => !jsonSchemaTypes.includes(t)))) ) { return true; diff --git a/library/src/helpers/specification.ts b/library/src/helpers/specification.ts index fd27be001..79c160146 100644 --- a/library/src/helpers/specification.ts +++ b/library/src/helpers/specification.ts @@ -32,7 +32,7 @@ export class SpecificationHelpers { // check if input is a string and try parse it if (typeof schema === 'string') { try { - schema = JSON.parse(schema); + schema = JSON.parse(schema) as Record; } catch (e) { return undefined; } @@ -53,14 +53,16 @@ export class SpecificationHelpers { schema: any, tags: TagInterface | TagInterface[], ): boolean { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const tagsToCheck = + // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call typeof schema.tags === 'function' ? schema.tags() : undefined; if (tagsToCheck === undefined || !Array.isArray(tagsToCheck)) { return false; } tags = Array.isArray(tags) ? tags : [tags]; return tagsToCheck.some((tag: TagInterface) => - (tags as TagInterface[]).some(t => t.name() === tag.name()), + tags.some(t => t.name() === tag.name()), ); } @@ -69,7 +71,7 @@ export class SpecificationHelpers { */ static operationsTags(spec: AsyncAPIDocumentInterface) { const tags = new Map(); - Object.entries(spec.operations().all()).forEach(([_, operation]) => { + Object.entries(spec.operations().all()).forEach(([, operation]) => { if (operation?.tags().length > 0) { operation .tags() diff --git a/library/src/standalone-codebase.ts b/library/src/standalone-codebase.ts index f69f2cbb7..d6380629b 100644 --- a/library/src/standalone-codebase.ts +++ b/library/src/standalone-codebase.ts @@ -1,6 +1,8 @@ import React from 'react'; import { + // eslint-disable-next-line react/no-deprecated hydrate as hydrateComponent, + // eslint-disable-next-line react/no-deprecated render as renderComponent, } from 'react-dom'; @@ -16,7 +18,7 @@ function querySelector(selector: string): Element | DocumentFragment | null { * * @param {Any} component of any kind */ -export function createRender

    (component: any) { +export function createRender

    (component: any) { return ( props: P, container?: Element | DocumentFragment | null, @@ -27,6 +29,7 @@ export function createRender

    (component: any) { return; } + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument renderComponent(React.createElement(component, props), container, callback); }; } @@ -36,7 +39,7 @@ export function createRender

    (component: any) { * * @param {Any} component of any kind */ -export function createHydrate

    (component: any) { +export function createHydrate

    (component: any) { return ( props: P, container?: Element | DocumentFragment | null, @@ -48,6 +51,7 @@ export function createHydrate

    (component: any) { } hydrateComponent( + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument React.createElement(component, props), container, callback, diff --git a/library/src/standalone-without-parser.ts b/library/src/standalone-without-parser.ts index 746c7e6b0..63bbc3816 100644 --- a/library/src/standalone-without-parser.ts +++ b/library/src/standalone-without-parser.ts @@ -5,8 +5,10 @@ import AsyncApiComponent, { import { createRender, createHydrate } from './standalone-codebase'; import { hljs } from './helpers'; +// eslint-disable-next-line import/no-anonymous-default-export export default { render: createRender(AsyncApiComponent), hydrate: createHydrate(AsyncApiComponent), + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment hljs, }; diff --git a/library/src/standalone.ts b/library/src/standalone.ts index 1c9ba6abd..5ed62e13a 100644 --- a/library/src/standalone.ts +++ b/library/src/standalone.ts @@ -5,8 +5,10 @@ import AsyncApiComponent, { import { createRender, createHydrate } from './standalone-codebase'; import { hljs } from './helpers'; +// eslint-disable-next-line import/no-anonymous-default-export export default { render: createRender(AsyncApiComponent), hydrate: createHydrate(AsyncApiComponent), + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment hljs, }; diff --git a/package.json b/package.json index af2554959..a2946dbcb 100644 --- a/package.json +++ b/package.json @@ -53,7 +53,6 @@ "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", "eslint-plugin-jsdoc": "^48.2.3", - "eslint-plugin-prefer-arrow": "^1.2.3", "eslint-plugin-react": "^7.34.1", "lerna": "^8.1.2", "markdown-toc": "^1.2.0", diff --git a/playground/app/layout.tsx b/playground/app/layout.tsx index 86b72c916..3d0043744 100644 --- a/playground/app/layout.tsx +++ b/playground/app/layout.tsx @@ -1,3 +1,4 @@ +import React from 'react'; import { Metadata } from 'next'; import { Inter } from 'next/font/google'; import './globals.css'; diff --git a/playground/app/page.tsx b/playground/app/page.tsx index 075a2d127..70db8ba3c 100644 --- a/playground/app/page.tsx +++ b/playground/app/page.tsx @@ -26,7 +26,7 @@ interface State { refreshing: boolean; } -class Playground extends Component<{}, State> { +class Playground extends Component { updateSchemaFn: (value: string) => void; updateConfigFn: (value: string) => void; diff --git a/playground/components/CodeEditorComponent.tsx b/playground/components/CodeEditorComponent.tsx index d2c1afdad..d185e441b 100644 --- a/playground/components/CodeEditorComponent.tsx +++ b/playground/components/CodeEditorComponent.tsx @@ -33,7 +33,7 @@ class CodeEditorComponent extends Component { return ( - {/* @ts-ignore remove when library and web-component is upgraded to React v18 */} + {/* @ts-expect-error remove when library and web-component is upgraded to React v18 */} ( <> - {/* @ts-ignore */} + {/* @ts-expect-error upgrade React to v18 */} { return ( { + onClick={event => { event.preventDefault(); if (parentCallback && tabIndex) { parentCallback(tabIndex); diff --git a/playground/components/Tabs.tsx b/playground/components/Tabs.tsx index 6389224a5..38655e1a6 100644 --- a/playground/components/Tabs.tsx +++ b/playground/components/Tabs.tsx @@ -37,7 +37,7 @@ class Tabs extends Component { renderHeader = (children: Array>) => React.Children.map(children, (child, index) => { - const c = child as React.ReactElement; + const c = child; return React.cloneElement(c, { title: c.props.title, parentCallback: this.handleTabClick, @@ -56,6 +56,7 @@ class Tabs extends Component { render() { const { additionalHeaderContent } = this.props; const children = [] + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument .concat(...(this.props.children as any)) .filter(child => child !== null && child !== undefined); diff --git a/playground/utils/helpers.ts b/playground/utils/helpers.ts index 9d8b6088d..5c3700d67 100644 --- a/playground/utils/helpers.ts +++ b/playground/utils/helpers.ts @@ -1,3 +1,4 @@ +// eslint-disable-next-line @typescript-eslint/ban-types export const parse = (str?: string): T => { if (!str) { return {} as T; @@ -10,6 +11,7 @@ export const parse = (str?: string): T => { } }; +// eslint-disable-next-line @typescript-eslint/ban-types export const stringify = (content?: T): string => { if (!content) { return ''; @@ -31,10 +33,11 @@ export const fetchSchema = async (link: string): Promise => { }; function handleResponse(response: any) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, arrow-body-style return response.text().then((data: string) => data); } -export function debounce( +export function debounce( func: (...args: any[]) => void, wait: number, onStart: () => void, @@ -48,6 +51,7 @@ export function debounce( onStart(); timeout = setTimeout(() => { timeout = undefined; + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument func(...args); onCancel(); }, wait || 1000); diff --git a/tslint.json b/tslint.json deleted file mode 100644 index 8cd2cfc56..000000000 --- a/tslint.json +++ /dev/null @@ -1,42 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": [ - "tslint:recommended", - "tslint-react", - "tslint-react-hooks", - "tslint-config-prettier" - ], - "rules": { - "interface-name": [true, "never-prefix"], - "member-access": [true, "no-public"], - "no-console": [true, "log", "info"], - "no-unused-expression": [true, "allow-fast-null-checks"], - "object-literal-sort-keys": false, - "ordered-imports": false, - "unified-signatures": false, - "curly": true, - "jsx-no-lambda": false, - "prefer-const": true, - "arrow-return-shorthand": [true, "multiline"], - "no-duplicate-super": true, - "no-duplicate-imports": true, - "no-duplicate-switch-case": true, - "no-duplicate-variable": true, - "no-var-keyword": true, - "triple-equals": true, - "use-isnan": true, - "no-debugger": true, - "radix": true, - "react-hooks-nesting": "error" - }, - "jsRules": {}, - "linterOptions": { - "exclude": ["*/node_modules/**/*"] - }, - "ban-types": [ - true, - ["Object", "Use {} instead."], - ["String"], - ["Function", "Use more precise type"] - ] -} From bf5e17e69afb4ecd653bcfbde59d6b27451887a6 Mon Sep 17 00:00:00 2001 From: Kenneth Aasan Date: Tue, 23 Apr 2024 11:05:16 +0200 Subject: [PATCH 03/12] chore: migrate from tslint to eslint --- library/src/contexts/useSpec.ts | 1 + library/src/helpers/__tests__/message.test.ts | 35 ++++++++++--------- playground/components/FetchSchema.tsx | 4 ++- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/library/src/contexts/useSpec.ts b/library/src/contexts/useSpec.ts index 6af268243..da346a13f 100644 --- a/library/src/contexts/useSpec.ts +++ b/library/src/contexts/useSpec.ts @@ -3,6 +3,7 @@ import { AsyncAPIDocumentInterface } from '@asyncapi/parser'; export const SpecificationContext = React.createContext< AsyncAPIDocumentInterface + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument >(null as any); export function useSpec() { diff --git a/library/src/helpers/__tests__/message.test.ts b/library/src/helpers/__tests__/message.test.ts index c0b5ece8a..e76311287 100644 --- a/library/src/helpers/__tests__/message.test.ts +++ b/library/src/helpers/__tests__/message.test.ts @@ -4,18 +4,18 @@ import { MessageV2 as Message } from '@asyncapi/parser'; describe('MessageHelpers', () => { describe('.generateExample', () => { test('should return empty string by default', () => { - const result = MessageHelpers.generateExample({}); - expect(result).toEqual(''); + expect(MessageHelpers.generateExample({})).toEqual(''); }); test('should instantiate all properties', () => { - const result = MessageHelpers.generateExample({ - properties: { - a: { type: 'string' }, - b: { type: 'integer' }, - }, - }); - expect(result).toEqual({ + expect( + MessageHelpers.generateExample({ + properties: { + a: { type: 'string' }, + b: { type: 'integer' }, + }, + }), + ).toEqual({ a: 'string', b: 0, }); @@ -24,14 +24,15 @@ describe('MessageHelpers', () => { describe('.sanitizeExample', () => { test('should sanitize example', () => { - const result = MessageHelpers.sanitizeExample({ - properties: { - a: { type: 'string' }, - b: { type: 'integer', 'x-schema-private-foo': true }, - }, - 'x-parser-foo': true, - }); - expect(result).toEqual({ + expect( + MessageHelpers.sanitizeExample({ + properties: { + a: { type: 'string' }, + b: { type: 'integer', 'x-schema-private-foo': true }, + }, + 'x-parser-foo': true, + }), + ).toEqual({ properties: { a: { type: 'string' }, b: { type: 'integer' }, diff --git a/playground/components/FetchSchema.tsx b/playground/components/FetchSchema.tsx index e14795251..6acec1d47 100644 --- a/playground/components/FetchSchema.tsx +++ b/playground/components/FetchSchema.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-misused-promises */ import React, { Component } from 'react'; import { InputWrapper, InputField, Button } from './styled'; import { fetchSchema } from '@/utils'; @@ -23,7 +24,7 @@ class FetchSchema extends Component { this.setState({ link: e.target.value })} + onChange={e => this.setState({ link: e.target.value })} />

    )} diff --git a/library/webpack.config.js b/library/webpack.config.js index 5df644176..9fddc67b5 100644 --- a/library/webpack.config.js +++ b/library/webpack.config.js @@ -144,7 +144,7 @@ const standaloneBundle = { const bundles = []; -process.env['BUILD_MODE'] === 'umd' && bundles.push(umdBundle); -process.env['BUILD_MODE'] === 'standalone' && bundles.push(standaloneBundle); +process.env.BUILD_MODE === 'umd' && bundles.push(umdBundle); +process.env.BUILD_MODE === 'standalone' && bundles.push(standaloneBundle); module.exports = bundles; From 2f3048428577be6ee37e4e2934ec3ae25ed6bc18 Mon Sep 17 00:00:00 2001 From: Kenneth Aasan Date: Tue, 23 Apr 2024 11:40:02 +0200 Subject: [PATCH 05/12] chore: migrate from tslint to eslint --- .eslintrc.json | 19 +++++++++++++++---- library/loaders/remove-hashbag-loader.js | 3 +++ library/src/components/Bindings.tsx | 2 ++ library/src/components/Extensions.tsx | 4 ++++ library/src/components/Schema.tsx | 10 +++++----- .../components/__tests__/Bindings.test.tsx | 8 ++++---- .../components/__tests__/Extensions.test.tsx | 7 +++---- playground/app/page.tsx | 2 +- tsconfig.base.json | 2 +- web-component/src/AsyncApiWebComponent.tsx | 8 +++++++- 10 files changed, 45 insertions(+), 20 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index a9d31a41a..142891f54 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -17,8 +17,13 @@ }, "parser": "@typescript-eslint/parser", "parserOptions": { - "project": "tsconfig.base.json", - "sourceType": "module" + "project": [ + "./tsconfig.base.json", + "./library/tsconfig.json", + "./library/e2e/tsconfig.json", + "./playground/tsconfig.json", + "./web-component/tsconfig.json" + ] }, "plugins": [ "eslint-plugin-import", @@ -284,8 +289,14 @@ }, "ignorePatterns": [ "library/browser", - "browser/lib", + "library/lib", + "library/e2e/plugins/index.js", + "library/postcss.config.js", + "library/webpack.config.js", + "library/tailwind.config.js", "playground/out", - "web-component/lib" + "playground/postcss.config.js", + "web-component/lib", + "web-component/webpack.config.js" ] } diff --git a/library/loaders/remove-hashbag-loader.js b/library/loaders/remove-hashbag-loader.js index 43960049f..9fff13ace 100644 --- a/library/loaders/remove-hashbag-loader.js +++ b/library/loaders/remove-hashbag-loader.js @@ -1,3 +1,6 @@ +/* eslint-disable @typescript-eslint/no-unsafe-call */ +/* eslint-disable @typescript-eslint/no-unsafe-return */ +/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /** * Make sure code does not contain properties such as `#property` */ diff --git a/library/src/components/Bindings.tsx b/library/src/components/Bindings.tsx index 657275609..7b77e7c88 100644 --- a/library/src/components/Bindings.tsx +++ b/library/src/components/Bindings.tsx @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ import React from 'react'; import { Schema } from './Schema'; import { SchemaHelpers } from '../helpers'; @@ -18,6 +19,7 @@ export const Bindings: React.FunctionComponent = ({ const renderedBindings = bindings.all().map(binding => { const bindingValue = binding.value(); + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const schema = SchemaHelpers.jsonToSchema(bindingValue); const protocol = binding.protocol(); const schemaName = ( diff --git a/library/src/components/Extensions.tsx b/library/src/components/Extensions.tsx index 9904d02aa..d8143dca7 100644 --- a/library/src/components/Extensions.tsx +++ b/library/src/components/Extensions.tsx @@ -1,3 +1,6 @@ +/* eslint-disable @typescript-eslint/no-unsafe-return */ +/* eslint-disable @typescript-eslint/no-unsafe-assignment */ + import React from 'react'; import { Schema } from './Schema'; @@ -19,6 +22,7 @@ export const Extensions: React.FunctionComponent = ({ } const schema = SchemaHelpers.jsonToSchema(extensions); + return ( schema && (
    diff --git a/library/src/components/Schema.tsx b/library/src/components/Schema.tsx index e547aa2f7..65e06ccd5 100644 --- a/library/src/components/Schema.tsx +++ b/library/src/components/Schema.tsx @@ -42,13 +42,13 @@ export const Schema: React.FunctionComponent = ({ if (!isArray) { setDeepExpand(deepExpanded); } - }, [deepExpanded, setDeepExpand]); + }, [isArray, deepExpanded, setDeepExpand]); useEffect(() => { if (!isArray) { setExpanded(deepExpand); } - }, [deepExpand, setExpanded]); + }, [isArray, deepExpand, setExpanded]); if ( !schema || @@ -276,7 +276,7 @@ export const Schema: React.FunctionComponent = ({ reverse ? 'bg-gray-200' : '' } ${expanded ? 'block' : 'hidden'}`} > - + {schema.oneOf() && @@ -374,12 +374,10 @@ export const Schema: React.FunctionComponent = ({ interface SchemaPropertiesProps { schema: SchemaInterface; - isArray: boolean; } const SchemaProperties: React.FunctionComponent = ({ schema, - isArray, }) => { const properties = schema.properties(); if (properties === undefined || !Object.keys(properties)) { @@ -521,6 +519,7 @@ const AdditionalItems: React.FunctionComponent = ({ return null; } + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const additionalItems = schema.additionalItems() as any; if (additionalItems === true || additionalItems === undefined) { return ( @@ -536,5 +535,6 @@ const AdditionalItems: React.FunctionComponent = ({

    ); } + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment return ; }; diff --git a/library/src/components/__tests__/Bindings.test.tsx b/library/src/components/__tests__/Bindings.test.tsx index a7d5a1807..09909884d 100644 --- a/library/src/components/__tests__/Bindings.test.tsx +++ b/library/src/components/__tests__/Bindings.test.tsx @@ -11,13 +11,13 @@ import { import { Bindings } from '../Bindings'; function createBinding(bindingObj: Record) { - const bindings: BindingSchema[] = []; + const bindings: BindingSchema[] = []; for (const [protocol, binding] of Object.entries(bindingObj)) { const obj: Record = {}; obj[protocol] = binding; bindings.push( new BindingSchema(binding, { - asyncapi: {} as any, + asyncapi: {} as never, pointer: '', protocol, }), @@ -26,7 +26,7 @@ function createBinding(bindingObj: Record) { return new BindingsSchema(bindings); } describe('Bindings component', () => { - test('should work with simple data', async () => { + test('should work with simple data', () => { const bindings = { mqtt: { fooMqtt: 'barMqtt', @@ -47,7 +47,7 @@ describe('Bindings component', () => { expect(screen.getByText('barKafka')).toBeDefined(); }); - test('should render empty binding as string', async () => { + test('should render empty binding as string', () => { const bindings = { mqtt: { foo: 'bar', diff --git a/library/src/components/__tests__/Extensions.test.tsx b/library/src/components/__tests__/Extensions.test.tsx index 02cc1da4f..d7e5e5e41 100644 --- a/library/src/components/__tests__/Extensions.test.tsx +++ b/library/src/components/__tests__/Extensions.test.tsx @@ -5,13 +5,12 @@ import React from 'react'; import { render, screen } from '@testing-library/react'; -// @ts-ignore import { SchemaV2 as SchemaModel } from '@asyncapi/parser'; import { Extensions } from '../Extensions'; describe('Extensions component', () => { - test('should work with simple data', async () => { + test('should work with simple data', () => { const schema = { 'x-foo': 'xBar', 'x-bar': 'xFoo', @@ -26,7 +25,7 @@ describe('Extensions component', () => { expect(screen.getByText('xFoo')).toBeDefined(); }); - test('should filter non extensions', async () => { + test('should filter non extensions', () => { const schema = { foo: { foo: 'bar', @@ -49,7 +48,7 @@ describe('Extensions component', () => { expect(screen.queryByText('bar')).toEqual(null); }); - test('should render empty extension as string', async () => { + test('should render empty extension as string', () => { const schema = { 'x-foo': 'xBar', 'x-bar': undefined, diff --git a/playground/app/page.tsx b/playground/app/page.tsx index 70db8ba3c..0453226da 100644 --- a/playground/app/page.tsx +++ b/playground/app/page.tsx @@ -92,7 +92,7 @@ class Playground extends Component { - {/* @ts-ignore remove when library and web-component is upgraded to React v18 */} + {/* @ts-expect-error remove when library and web-component is upgraded to React v18 */} diff --git a/tsconfig.base.json b/tsconfig.base.json index bd0bcd7f7..112aef34d 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -23,6 +23,6 @@ "noUnusedLocals": true, "resolveJsonModule": true }, - "include": ["./library", "./playground"], + "include": ["./library"], "exclude": ["*/node_modules/**/*", "*/lib/**/*"] } diff --git a/web-component/src/AsyncApiWebComponent.tsx b/web-component/src/AsyncApiWebComponent.tsx index 6635d76df..a828881ca 100644 --- a/web-component/src/AsyncApiWebComponent.tsx +++ b/web-component/src/AsyncApiWebComponent.tsx @@ -1,5 +1,6 @@ +/* eslint-disable react/no-unescaped-entities */ import * as React from 'react'; -// @ts-ignore +// @ts-expect-error no types import { register } from 'web-react-components'; import AsyncApiComponent, { AsyncApiProps, @@ -25,17 +26,21 @@ function retrieveSchemaProp( let schemaFetchOptions = props.schemaFetchOptions; if (!schemaUrl || schemaUrl === 'undefined') { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment schemaUrl = undefined as any; } if (!schemaFetchOptions) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment schemaFetchOptions = undefined as any; } let schema = props.schema || {}; if (schemaUrl) { + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const schemaRequestOptions = schemaFetchOptions ? JSON.parse(JSON.stringify(schemaFetchOptions)) : (schema as FetchingSchemaInterface).requestOptions || {}; + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment schema = { url: schemaUrl, requestOptions: schemaRequestOptions }; } @@ -90,6 +95,7 @@ export class AsyncApiWebComponent extends React.Component< } } +// eslint-disable-next-line @typescript-eslint/no-unsafe-call register(AsyncApiWebComponent, 'asyncapi-component', [ 'schema', 'schemaFetchOptions', From 59b5eb0b3610ca0703f95a5b0fc8f123315a7e7c Mon Sep 17 00:00:00 2001 From: Kenneth Aasan Date: Tue, 23 Apr 2024 11:47:14 +0200 Subject: [PATCH 06/12] chore: migrate from tslint to eslint --- .eslintrc.json | 3 ++- library/loaders/remove-hashbag-loader.js | 3 --- tsconfig.base.json | 4 +--- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 142891f54..c75588a77 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -18,7 +18,6 @@ "parser": "@typescript-eslint/parser", "parserOptions": { "project": [ - "./tsconfig.base.json", "./library/tsconfig.json", "./library/e2e/tsconfig.json", "./playground/tsconfig.json", @@ -291,6 +290,8 @@ "library/browser", "library/lib", "library/e2e/plugins/index.js", + "library/loaders/remove-hashbag-loader.js", + "library/jest.config.js", "library/postcss.config.js", "library/webpack.config.js", "library/tailwind.config.js", diff --git a/library/loaders/remove-hashbag-loader.js b/library/loaders/remove-hashbag-loader.js index 9fff13ace..43960049f 100644 --- a/library/loaders/remove-hashbag-loader.js +++ b/library/loaders/remove-hashbag-loader.js @@ -1,6 +1,3 @@ -/* eslint-disable @typescript-eslint/no-unsafe-call */ -/* eslint-disable @typescript-eslint/no-unsafe-return */ -/* eslint-disable @typescript-eslint/no-unsafe-member-access */ /** * Make sure code does not contain properties such as `#property` */ diff --git a/tsconfig.base.json b/tsconfig.base.json index 112aef34d..9573a2192 100644 --- a/tsconfig.base.json +++ b/tsconfig.base.json @@ -22,7 +22,5 @@ "strictNullChecks": true, "noUnusedLocals": true, "resolveJsonModule": true - }, - "include": ["./library"], - "exclude": ["*/node_modules/**/*", "*/lib/**/*"] + } } From fbfb2e8c628d42411ecd55b06a1cd4a33f274c54 Mon Sep 17 00:00:00 2001 From: Kenneth Aasan Date: Tue, 23 Apr 2024 14:43:56 +0200 Subject: [PATCH 07/12] chore: migrate from tslint to eslint --- .eslintrc.json | 261 +-- library/src/components/Extensions.tsx | 1 + library/src/components/Schema.tsx | 2 +- .../components/__tests__/Bindings.test.tsx | 2 + library/src/config/config.ts | 1 + library/src/containers/AsyncApi/AsyncApi.tsx | 5 +- .../src/containers/Operations/Operation.tsx | 9 +- library/src/containers/Servers/Security.tsx | 1 + library/src/containers/Sidebar/Sidebar.tsx | 7 +- .../Sidebar/__tests__/SideBar.test.tsx | 2 +- library/src/contexts/useSpec.ts | 2 +- library/src/helpers/__tests__/sidebar.test.ts | 6 +- library/src/helpers/bindingsHelpers.ts | 1 + library/src/helpers/common.ts | 1 + library/src/helpers/marked.ts | 8 +- library/src/helpers/message.ts | 3 + library/src/helpers/parser.ts | 6 +- library/src/helpers/schema.ts | 12 +- library/src/helpers/server.ts | 1 + library/src/helpers/sidebar.ts | 1 + library/src/helpers/specification.ts | 8 +- library/src/standalone-codebase.ts | 2 + library/src/types.ts | 4 +- package-lock.json | 1603 ++--------------- package.json | 1 - playground/app/page.tsx | 1 + playground/components/FetchSchema.tsx | 2 +- playground/components/Tabs.tsx | 2 +- playground/utils/helpers.ts | 8 +- web-component/src/AsyncApiWebComponent.tsx | 10 +- 30 files changed, 264 insertions(+), 1709 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index c75588a77..35e066cd7 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -4,10 +4,10 @@ "es6": true }, "extends": [ - "next/core-web-vitals", - "plugin:@typescript-eslint/recommended", - "plugin:@typescript-eslint/recommended-requiring-type-checking", + "eslint:recommended", + "plugin:@typescript-eslint/strict", "plugin:react/recommended", + "next/core-web-vitals", "prettier" ], "settings": { @@ -27,264 +27,13 @@ "plugins": [ "eslint-plugin-import", "eslint-plugin-react", - "eslint-plugin-jsdoc", "@typescript-eslint", "@typescript-eslint/tslint" + // "prettier" uncomment when prettier is upgraded to the newest version ], "root": true, "rules": { - "@typescript-eslint/adjacent-overload-signatures": "error", - "@typescript-eslint/consistent-type-assertions": "error", - "@typescript-eslint/dot-notation": "error", - "@typescript-eslint/explicit-function-return-type": "off", - "@typescript-eslint/explicit-member-accessibility": [ - "error", - { - "accessibility": "no-public" - } - ], - "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/indent": "off", - "@typescript-eslint/member-delimiter-style": [ - "off", - { - "multiline": { - "delimiter": "none", - "requireLast": true - }, - "singleline": { - "delimiter": "semi", - "requireLast": false - } - } - ], - "@typescript-eslint/naming-convention": [ - "error", - { - "selector": "variable", - "format": ["camelCase", "UPPER_CASE", "PascalCase"], - "leadingUnderscore": "allow", - "trailingUnderscore": "forbid" - } - ], - "@typescript-eslint/no-empty-function": "error", - "@typescript-eslint/no-empty-interface": "error", - "@typescript-eslint/no-explicit-any": "off", - "@typescript-eslint/no-misused-new": "error", - "@typescript-eslint/no-namespace": "error", - "@typescript-eslint/no-parameter-properties": "off", - "@typescript-eslint/no-shadow": [ - "error", - { - "hoist": "all" - } - ], - "@typescript-eslint/no-unused-expressions": [ - "error", - { - "allowShortCircuit": true - } - ], - "@typescript-eslint/no-use-before-define": "off", - "@typescript-eslint/no-var-requires": "error", - "@typescript-eslint/prefer-for-of": "error", - "@typescript-eslint/prefer-function-type": "error", - "@typescript-eslint/prefer-namespace-keyword": "error", - "@typescript-eslint/quotes": "off", - "@typescript-eslint/semi": ["off", null], - "@typescript-eslint/triple-slash-reference": [ - "error", - { - "path": "always", - "types": "prefer-import", - "lib": "always" - } - ], - "@typescript-eslint/type-annotation-spacing": "off", - "@typescript-eslint/typedef": "off", - "@typescript-eslint/unified-signatures": "off", - "arrow-parens": ["off", "always"], - "brace-style": ["off", "off"], - "comma-dangle": "off", - "complexity": "off", - "constructor-super": "error", - "curly": "error", - "dot-notation": "off", - "eol-last": "off", - "eqeqeq": ["error", "always"], - "guard-for-in": "error", - "id-denylist": [ - "error", - "any", - "Number", - "number", - "String", - "string", - "Boolean", - "boolean", - "Undefined", - "undefined" - ], - "id-match": "error", - "import/order": [ - "off", - { - "alphabetize": { - "caseInsensitive": true, - "order": "asc" - }, - "newlines-between": "ignore", - "groups": [ - ["builtin", "external", "internal", "unknown", "object", "type"], - "parent", - ["sibling", "index"] - ], - "distinctGroup": false, - "pathGroupsExcludedImportTypes": [], - "pathGroups": [ - { - "pattern": "./", - "patternOptions": { - "nocomment": true, - "dot": true - }, - "group": "sibling", - "position": "before" - }, - { - "pattern": ".", - "patternOptions": { - "nocomment": true, - "dot": true - }, - "group": "sibling", - "position": "before" - }, - { - "pattern": "..", - "patternOptions": { - "nocomment": true, - "dot": true - }, - "group": "parent", - "position": "before" - }, - { - "pattern": "../", - "patternOptions": { - "nocomment": true, - "dot": true - }, - "group": "parent", - "position": "before" - } - ] - } - ], - "indent": "off", - "jsdoc/check-alignment": "error", - "jsdoc/check-indentation": "error", - "linebreak-style": "off", - "max-classes-per-file": ["error", 1], - "max-len": "off", - "new-parens": "off", - "newline-per-chained-call": "off", - "no-bitwise": "error", - "no-caller": "error", - "no-cond-assign": "error", - "no-console": [ - "error", - { - "allow": [ - "warn", - "dir", - "time", - "timeEnd", - "timeLog", - "trace", - "assert", - "clear", - "count", - "countReset", - "group", - "groupEnd", - "table", - "debug", - "dirxml", - "error", - "groupCollapsed", - "Console", - "profile", - "profileEnd", - "timeStamp", - "context" - ] - } - ], - "no-debugger": "error", - "no-duplicate-case": "error", - "no-duplicate-imports": "error", - "no-empty": "error", - "no-empty-function": "off", - "no-eval": "error", - "no-extra-semi": "off", - "no-fallthrough": "off", - "no-invalid-this": "off", - "no-irregular-whitespace": "off", - "no-multiple-empty-lines": "off", - "no-new-wrappers": "error", - "no-redeclare": "error", - "no-shadow": "off", - "no-throw-literal": "error", - "no-trailing-spaces": "off", - "no-undef-init": "error", - "no-underscore-dangle": "off", - "no-unsafe-finally": "error", - "no-unused-expressions": "off", - "no-unused-labels": "error", - "no-use-before-define": "off", - "no-var": "error", - "object-shorthand": "error", - "one-var": ["error", "never"], - "padded-blocks": [ - "off", - { - "blocks": "never" - }, - { - "allowSingleLineBlocks": true - } - ], - "prefer-const": "error", - "quote-props": "off", - "quotes": "off", - "radix": "error", - "react/jsx-boolean-value": "error", - "react/jsx-curly-spacing": "off", - "react/jsx-equals-spacing": "off", - "react/jsx-key": "error", - "react/jsx-no-bind": "off", - "react/jsx-tag-spacing": [ - "off", - { - "afterOpening": "allow", - "closingSlash": "allow" - } - ], - "react/jsx-wrap-multilines": "off", - "react/self-closing-comp": "error", - "semi": "off", - "space-before-function-paren": "off", - "space-in-parens": ["off", "never"], - "spaced-comment": [ - "error", - "always", - { - "markers": ["/"] - } - ], - "use-isnan": "error", - "valid-typeof": "off" + // "prettier/prettier": "error" uncomment when prettier is upgraded to the newest version }, "ignorePatterns": [ "library/browser", diff --git a/library/src/components/Extensions.tsx b/library/src/components/Extensions.tsx index d8143dca7..b98d44c00 100644 --- a/library/src/components/Extensions.tsx +++ b/library/src/components/Extensions.tsx @@ -9,6 +9,7 @@ import { SchemaHelpers } from '../helpers'; interface Props { name?: string; + // eslint-disable-next-line @typescript-eslint/no-explicit-any item: any; } diff --git a/library/src/components/Schema.tsx b/library/src/components/Schema.tsx index 65e06ccd5..9aa9040c8 100644 --- a/library/src/components/Schema.tsx +++ b/library/src/components/Schema.tsx @@ -519,7 +519,7 @@ const AdditionalItems: React.FunctionComponent = ({ return null; } - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any const additionalItems = schema.additionalItems() as any; if (additionalItems === true || additionalItems === undefined) { return ( diff --git a/library/src/components/__tests__/Bindings.test.tsx b/library/src/components/__tests__/Bindings.test.tsx index 09909884d..76a118b2b 100644 --- a/library/src/components/__tests__/Bindings.test.tsx +++ b/library/src/components/__tests__/Bindings.test.tsx @@ -10,7 +10,9 @@ import { } from '@asyncapi/parser'; import { Bindings } from '../Bindings'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any function createBinding(bindingObj: Record) { + // eslint-disable-next-line @typescript-eslint/no-explicit-any const bindings: BindingSchema[] = []; for (const [protocol, binding] of Object.entries(bindingObj)) { const obj: Record = {}; diff --git a/library/src/config/config.ts b/library/src/config/config.ts index 8967f6b0e..0218996eb 100644 --- a/library/src/config/config.ts +++ b/library/src/config/config.ts @@ -3,6 +3,7 @@ export interface ConfigInterface { show?: ShowConfig; expand?: ExpandConfig; sidebar?: SideBarConfig; + // eslint-disable-next-line @typescript-eslint/no-explicit-any parserOptions?: any; publishLabel?: string; subscribeLabel?: string; diff --git a/library/src/containers/AsyncApi/AsyncApi.tsx b/library/src/containers/AsyncApi/AsyncApi.tsx index d8921c3dd..3310a59a7 100644 --- a/library/src/containers/AsyncApi/AsyncApi.tsx +++ b/library/src/containers/AsyncApi/AsyncApi.tsx @@ -27,10 +27,6 @@ class AsyncApiComponent extends Component { error: undefined, }; - constructor(props: AsyncApiProps) { - super(props); - } - async componentDidMount() { if (this.props.schema) { const { schema, config } = this.props; @@ -61,6 +57,7 @@ class AsyncApiComponent extends Component { ); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private async parseSchema(schema: PropsSchema, parserOptions?: any) { const parsedSpec = SpecificationHelpers.retrieveParsedSpec(schema); if (parsedSpec) { diff --git a/library/src/containers/Operations/Operation.tsx b/library/src/containers/Operations/Operation.tsx index ffaf58fdf..c9c7d99c1 100644 --- a/library/src/containers/Operations/Operation.tsx +++ b/library/src/containers/Operations/Operation.tsx @@ -469,10 +469,15 @@ export const OperationReplyAddressInfo: React.FunctionComponent = ({ return <>; } const reply = operation.reply(); - if (reply === undefined || !reply.hasAddress()) { + if (!reply || !reply.address) { return <>; } - const replyAddress = reply.address()!; + const replyAddress = reply.address(); + + if (!replyAddress) { + return <>; + } + const replyAddressLocation = replyAddress.location(); return ( diff --git a/library/src/containers/Servers/Security.tsx b/library/src/containers/Servers/Security.tsx index 167573319..3a8e86fb5 100644 --- a/library/src/containers/Servers/Security.tsx +++ b/library/src/containers/Servers/Security.tsx @@ -41,6 +41,7 @@ export const Security: React.FunctionComponent = ({ const requirements = requirement.all(); const key = Object.keys(requirements)[0]; const def = securitySchemes[Number(key)]; + // eslint-disable-next-line @typescript-eslint/no-explicit-any const requiredScopes: any = requirements[Number(key)]; if (!def) { diff --git a/library/src/containers/Sidebar/Sidebar.tsx b/library/src/containers/Sidebar/Sidebar.tsx index 803ba6524..d82a763d9 100644 --- a/library/src/containers/Sidebar/Sidebar.tsx +++ b/library/src/containers/Sidebar/Sidebar.tsx @@ -262,11 +262,10 @@ const OperationsList: React.FunctionComponent = () => { // old version uses different labels for the operations const operationChannels = operationChannel.all(); const channelAddress = operationChannels[0]?.address(); - label = operation.hasSummary() - ? operation.summary()! - : channelAddress ?? ''; + const operationSummary = operation.summary(); + label = operationSummary ? operationSummary : channelAddress ?? ''; } else { - label = operation.id()!; + label = operation.id() || ''; } return { name: `${type}-${operation.id()}`, diff --git a/library/src/containers/Sidebar/__tests__/SideBar.test.tsx b/library/src/containers/Sidebar/__tests__/SideBar.test.tsx index 0228782f6..ad0a3e6ba 100644 --- a/library/src/containers/Sidebar/__tests__/SideBar.test.tsx +++ b/library/src/containers/Sidebar/__tests__/SideBar.test.tsx @@ -15,7 +15,7 @@ describe('Sidebar component', () => { const parsedDoc = await Parser.parse(asyncapi, {}); expect(parsedDoc.error).toBeUndefined(); expect(parsedDoc.asyncapi).toBeDefined(); - parsed = parsedDoc.asyncapi!; + parsed = parsedDoc.asyncapi as AsyncAPIDocumentInterface; }); test('should render sidebar with showOperations: byDefault', () => { render( diff --git a/library/src/contexts/useSpec.ts b/library/src/contexts/useSpec.ts index da346a13f..785448d7f 100644 --- a/library/src/contexts/useSpec.ts +++ b/library/src/contexts/useSpec.ts @@ -3,7 +3,7 @@ import { AsyncAPIDocumentInterface } from '@asyncapi/parser'; export const SpecificationContext = React.createContext< AsyncAPIDocumentInterface - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any >(null as any); export function useSpec() { diff --git a/library/src/helpers/__tests__/sidebar.test.ts b/library/src/helpers/__tests__/sidebar.test.ts index 32b89c85c..668881a80 100644 --- a/library/src/helpers/__tests__/sidebar.test.ts +++ b/library/src/helpers/__tests__/sidebar.test.ts @@ -13,7 +13,7 @@ describe('sidebar', () => { test('should handle find one instance', () => { const tagsToFind = ['test']; const tagsToSearch = new TagsV2([new TagV2({ name: 'test' })]); - const objects: Array> = [ + const objects: Array> = [ { data: {}, name: '', tags: tagsToSearch }, ]; const filteredTags = filterObjectsByTags(tagsToFind, objects); @@ -37,10 +37,10 @@ describe('sidebar', () => { name: '', tags: new TagsV2([new TagV2({ name: 'test' })]), }; - const objects: Array> = [obj1, obj2, obj3]; + const objects: Array> = [obj1, obj2, obj3]; const filteredTags = filterObjectsByTags(tagsToFind, objects); expect(filteredTags.tagged.size).toEqual(1); - expect(filteredTags.tagged.get('test')!.length).toEqual(2); + expect(filteredTags.tagged.get('test')?.length).toEqual(2); expect(filteredTags.untagged.length).toEqual(1); }); }); diff --git a/library/src/helpers/bindingsHelpers.ts b/library/src/helpers/bindingsHelpers.ts index 5b63b673e..5f2657f0c 100644 --- a/library/src/helpers/bindingsHelpers.ts +++ b/library/src/helpers/bindingsHelpers.ts @@ -18,6 +18,7 @@ class BindingsHelper { return this.schemaObjectKeys.includes(`${bindingType}.${context}`); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any isObject(value: any): boolean { return !!value && typeof value === 'object'; } diff --git a/library/src/helpers/common.ts b/library/src/helpers/common.ts index cfc71694b..bb4d2eafd 100644 --- a/library/src/helpers/common.ts +++ b/library/src/helpers/common.ts @@ -9,6 +9,7 @@ import { SEND_LABEL_DEFAULT_TEXT, SUBSCRIBE_LABEL_DEFAULT_TEXT, } from '../constants'; +// eslint-disable-next-line @typescript-eslint/no-extraneous-class export class CommonHelpers { static getIdentifier(id: string, config?: ConfigInterface) { const schemaID = config?.schemaID; diff --git a/library/src/helpers/marked.ts b/library/src/helpers/marked.ts index 5fd1a38e2..30428d3a9 100644 --- a/library/src/helpers/marked.ts +++ b/library/src/helpers/marked.ts @@ -1,19 +1,19 @@ import { marked } from 'marked'; -// @ts-expect-error no types +// @ts-expect-error no types exists import hljs from 'highlight.js/lib/core'; -// @ts-expect-error no types +// @ts-expect-error no types exists import json from 'highlight.js/lib/languages/json'; // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access hljs.registerLanguage('json', json); -// @ts-expect-error no types +// @ts-expect-error no types exists import yaml from 'highlight.js/lib/languages/yaml'; // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access, @typescript-eslint/no-unsafe-call hljs.registerLanguage('yaml', yaml); -// @ts-expect-error no types +// @ts-expect-error no types exists import bash from 'highlight.js/lib/languages/bash'; // eslint-disable-next-line @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access hljs.registerLanguage('bash', bash); diff --git a/library/src/helpers/message.ts b/library/src/helpers/message.ts index 184d64ecb..d16277d5b 100644 --- a/library/src/helpers/message.ts +++ b/library/src/helpers/message.ts @@ -3,7 +3,9 @@ import { sample } from 'openapi-sampler'; import { MessageExample } from '../types'; +// eslint-disable-next-line @typescript-eslint/no-extraneous-class export class MessageHelpers { + // eslint-disable-next-line @typescript-eslint/no-explicit-any static generateExample(schema: any, options: any = {}) { try { // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-argument @@ -13,6 +15,7 @@ export class MessageHelpers { } } + // eslint-disable-next-line @typescript-eslint/no-explicit-any static sanitizeExample(schema: any): any { if (typeof schema === 'object' && schema && !Array.isArray(schema)) { // eslint-disable-next-line @typescript-eslint/no-unsafe-argument diff --git a/library/src/helpers/parser.ts b/library/src/helpers/parser.ts index afd6edc60..44947ca09 100644 --- a/library/src/helpers/parser.ts +++ b/library/src/helpers/parser.ts @@ -12,10 +12,12 @@ asyncapiParser.registerSchemaParser(OpenAPISchemaParser()); asyncapiParser.registerSchemaParser(AvroSchemaParser()); asyncapiParser.registerSchemaParser(ProtoBuffSchemaParser()); +// eslint-disable-next-line @typescript-eslint/no-extraneous-class export class Parser { static async parse( - // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents + // eslint-disable-next-line @typescript-eslint/no-redundant-type-constituents, @typescript-eslint/no-explicit-any content: string | any, + // eslint-disable-next-line @typescript-eslint/no-explicit-any parserOptions?: any, ): Promise { try { @@ -29,12 +31,14 @@ export class Parser { static async parseFromUrl( arg: FetchingSchemaInterface, + // eslint-disable-next-line @typescript-eslint/no-explicit-any parserOptions?: any, ): Promise { try { const fromResult = fromURL( asyncapiParser, arg.url, + // eslint-disable-next-line @typescript-eslint/no-explicit-any arg.requestOptions as any, ); // eslint-disable-next-line @typescript-eslint/no-unsafe-argument diff --git a/library/src/helpers/schema.ts b/library/src/helpers/schema.ts index d7b5a68ec..3590ff6f8 100644 --- a/library/src/helpers/schema.ts +++ b/library/src/helpers/schema.ts @@ -59,6 +59,7 @@ const jsonSchemaKeywordTypes: Record = { }; const jsonSchemaKeywords = Object.keys(jsonSchemaKeywordTypes); +// eslint-disable-next-line @typescript-eslint/no-extraneous-class export class SchemaHelpers { static extRenderAdditionalInfo = 'x-schema-private-render-additional-info'; static extRawValue = 'x-schema-private-raw-value'; @@ -119,6 +120,7 @@ export class SchemaHelpers { } } + // eslint-disable-next-line @typescript-eslint/no-explicit-any static prettifyValue(value: any, strict = true): string { const typeOf = typeof value; if (typeOf === 'string') { @@ -235,7 +237,7 @@ export class SchemaHelpers { required: Object.keys(obj), [this.extRenderAdditionalInfo]: false, }; - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any return new SchemaClass(json as any); } @@ -263,10 +265,11 @@ export class SchemaHelpers { required: Object.keys(obj), [this.extRenderAdditionalInfo]: false, }; - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any return new SchemaClass(json as any); } + // eslint-disable-next-line @typescript-eslint/no-explicit-any static jsonToSchema(value: any): any { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const json = this.jsonFieldToSchema(value); @@ -280,6 +283,7 @@ export class SchemaHelpers { * * @param value */ + // eslint-disable-next-line @typescript-eslint/no-explicit-any static getCustomExtensions(value: any) { // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access if (!value || typeof value.extensions !== 'function') { @@ -361,7 +365,7 @@ export class SchemaHelpers { ), [this.extRenderAdditionalInfo]: false, }; - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any return new SchemaClass(json as any); } @@ -516,6 +520,7 @@ export class SchemaHelpers { return stringRange; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private static jsonFieldToSchema(value: any): any { if (value === undefined || value === null) { return { @@ -558,6 +563,7 @@ export class SchemaHelpers { }; } + // eslint-disable-next-line @typescript-eslint/no-explicit-any private static isJSONSchema(value: any): boolean { if ( value && diff --git a/library/src/helpers/server.ts b/library/src/helpers/server.ts index c5e9d2f9d..72ff5bd09 100644 --- a/library/src/helpers/server.ts +++ b/library/src/helpers/server.ts @@ -1,5 +1,6 @@ import { SecuritySchemeInterface } from '@asyncapi/parser'; +// eslint-disable-next-line @typescript-eslint/no-extraneous-class export class ServerHelpers { static securityType(value: string) { switch (value) { diff --git a/library/src/helpers/sidebar.ts b/library/src/helpers/sidebar.ts index affab80f0..fe54cc6d2 100644 --- a/library/src/helpers/sidebar.ts +++ b/library/src/helpers/sidebar.ts @@ -1,5 +1,6 @@ import { TagsInterface } from '@asyncapi/parser'; +// eslint-disable-next-line @typescript-eslint/no-explicit-any export interface TagObject { name: string; tags: TagsInterface; diff --git a/library/src/helpers/specification.ts b/library/src/helpers/specification.ts index 79c160146..cfb770d47 100644 --- a/library/src/helpers/specification.ts +++ b/library/src/helpers/specification.ts @@ -8,12 +8,13 @@ import { } from '@asyncapi/parser'; import { isStringifiedDocument } from '@asyncapi/parser/cjs/document'; +// eslint-disable-next-line @typescript-eslint/no-extraneous-class export class SpecificationHelpers { /** * Returns parsed AsyncAPI specification. */ static retrieveParsedSpec( - schema: any, + schema: unknown, ): AsyncAPIDocumentInterface | undefined { if (!schema) { return undefined; @@ -50,6 +51,7 @@ export class SpecificationHelpers { * Check if given schema have one of the specified tags. */ static containTags( + // eslint-disable-next-line @typescript-eslint/no-explicit-any schema: any, tags: TagInterface | TagInterface[], ): boolean { @@ -60,9 +62,9 @@ export class SpecificationHelpers { if (tagsToCheck === undefined || !Array.isArray(tagsToCheck)) { return false; } - tags = Array.isArray(tags) ? tags : [tags]; + const tagsArr = Array.isArray(tags) ? tags : [tags]; return tagsToCheck.some((tag: TagInterface) => - tags.some(t => t.name() === tag.name()), + tagsArr.some(t => t.name() === tag.name()), ); } diff --git a/library/src/standalone-codebase.ts b/library/src/standalone-codebase.ts index d6380629b..e15b6bb34 100644 --- a/library/src/standalone-codebase.ts +++ b/library/src/standalone-codebase.ts @@ -18,6 +18,7 @@ function querySelector(selector: string): Element | DocumentFragment | null { * * @param {Any} component of any kind */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function createRender

    (component: any) { return ( props: P, @@ -39,6 +40,7 @@ export function createRender

    (component: any) { * * @param {Any} component of any kind */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any export function createHydrate

    (component: any) { return ( props: P, diff --git a/library/src/types.ts b/library/src/types.ts index d6d1e2db4..734191b0e 100644 --- a/library/src/types.ts +++ b/library/src/types.ts @@ -39,7 +39,7 @@ export enum PayloadType { export interface MessageExample { name?: string; summary?: string; - example: any; + example: unknown; } export interface ValidationError { @@ -59,7 +59,7 @@ export interface ErrorObject { type: string; title: string; detail?: string; - parsedJSON?: any; + parsedJSON?: unknown; validationErrors?: ValidationError[]; location?: { startLine: number; diff --git a/package-lock.json b/package-lock.json index 751232c8a..e8ea23163 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,12 +18,8 @@ "eslint-config-next": "^14.2.2", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-jsdoc": "^48.2.3", - "eslint-plugin-prefer-arrow": "^1.2.3", "eslint-plugin-react": "^7.34.1", - "husky": "^2.4.1", "lerna": "^8.1.2", - "lint-staged": "15.2.2", "markdown-toc": "^1.2.0", "markdownlint-cli": "^0.17.0", "prettier": "^1.18.2", @@ -2471,20 +2467,6 @@ "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.8.0.tgz", "integrity": "sha512-VINS5vEYAscRl2ZUDiT3uMPlrFQupiKgHz5AA4bCH1miKBg4qtwkim1qPmJj/4WG6TreYMY111rEFsjupcOKHw==" }, - "node_modules/@es-joy/jsdoccomment": { - "version": "0.42.0", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.42.0.tgz", - "integrity": "sha512-R1w57YlVA6+YE01wch3GPYn6bCsrOV3YW/5oGGE2tmX6JcL9Nr+b5IikrjMPF+v9CV3ay+obImEdsDhovhJrzw==", - "dev": true, - "dependencies": { - "comment-parser": "1.4.1", - "esquery": "^1.5.0", - "jsdoc-type-pratt-parser": "~4.0.0" - }, - "engines": { - "node": ">=16" - } - }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", @@ -6676,15 +6658,6 @@ } ] }, - "node_modules/are-docs-informative": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/are-docs-informative/-/are-docs-informative-0.0.2.tgz", - "integrity": "sha512-ixiS0nLNNG5jNQzgZJNoUpBKdo9yTYZMGJ+QgT2jmjR7G7+QHRCc4v6LQ3NgE7EBJq+o0ams3waJwkrlBom8Ig==", - "dev": true, - "engines": { - "node": ">=14" - } - }, "node_modules/are-we-there-yet": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", @@ -8356,72 +8329,6 @@ "@colors/colors": "1.5.0" } }, - "node_modules/cli-truncate": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-4.0.0.tgz", - "integrity": "sha512-nPdaFdQ0h/GEigbPClz11D0v/ZJEwxmeVZGeMo3Z5StPtUTkA9o1lD6QwoirYiSDzbcwn2XcjwmCp68W1IS4TA==", - "dev": true, - "dependencies": { - "slice-ansi": "^5.0.0", - "string-width": "^7.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-truncate/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/cli-truncate/node_modules/emoji-regex": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", - "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", - "dev": true - }, - "node_modules/cli-truncate/node_modules/string-width": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", - "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", - "dev": true, - "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/cli-truncate/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dev": true, - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, "node_modules/cli-width": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", @@ -8763,15 +8670,6 @@ "node": ">= 6" } }, - "node_modules/comment-parser": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.4.1.tgz", - "integrity": "sha512-buhp5kePrmda3vhc5B9t7pUQXAb2Tnd0qgpkIhPhkHXxJpiPJ11H0ZEU0oBpJ2QztSbzG/ZxMj/CHsYJqRHmyg==", - "dev": true, - "engines": { - "node": ">= 12.0.0" - } - }, "node_modules/common-path-prefix": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-3.0.0.tgz", @@ -11125,39 +11023,6 @@ "semver": "bin/semver.js" } }, - "node_modules/eslint-plugin-jsdoc": { - "version": "48.2.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-48.2.3.tgz", - "integrity": "sha512-r9DMAmFs66VNvNqRLLjHejdnJtILrt3xGi+Qx0op0oRfFGVpOR1Hb3BC++MacseHx93d8SKYPhyrC9BS7Os2QA==", - "dev": true, - "dependencies": { - "@es-joy/jsdoccomment": "~0.42.0", - "are-docs-informative": "^0.0.2", - "comment-parser": "1.4.1", - "debug": "^4.3.4", - "escape-string-regexp": "^4.0.0", - "esquery": "^1.5.0", - "is-builtin-module": "^3.2.1", - "semver": "^7.6.0", - "spdx-expression-parse": "^4.0.0" - }, - "engines": { - "node": ">=18" - }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0" - } - }, - "node_modules/eslint-plugin-jsdoc/node_modules/spdx-expression-parse": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-4.0.0.tgz", - "integrity": "sha512-Clya5JIij/7C6bRR22+tnGXbc4VKlibKSVj2iHvVeX5iMW7s1SIQlqu699JkODJJIhh/pUu8L0/VLh8xflD+LQ==", - "dev": true, - "dependencies": { - "spdx-exceptions": "^2.1.0", - "spdx-license-ids": "^3.0.0" - } - }, "node_modules/eslint-plugin-jsx-a11y": { "version": "6.8.0", "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.8.0.tgz", @@ -11197,15 +11062,6 @@ "dequal": "^2.0.3" } }, - "node_modules/eslint-plugin-prefer-arrow": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-prefer-arrow/-/eslint-plugin-prefer-arrow-1.2.3.tgz", - "integrity": "sha512-J9I5PKCOJretVuiZRGvPQxCbllxGAV/viI20JO3LYblAodofBxyMnZAJ+WGeClHgANnSJberTNoFWWjrWKBuXQ==", - "dev": true, - "peerDependencies": { - "eslint": ">=2.0.0" - } - }, "node_modules/eslint-plugin-react": { "version": "7.34.1", "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.34.1.tgz", @@ -12200,18 +12056,6 @@ "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/get-east-asian-width": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/get-east-asian-width/-/get-east-asian-width-1.2.0.tgz", - "integrity": "sha512-2nk+7SIVb14QrgXFHcm84tD4bKQz0RxPuMT8Ag5KPOq7J5fEmAg0UbXdTOSHqNuHSU28k55qnceesxXRZGzKWA==", - "dev": true, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/get-intrinsic": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", @@ -12269,15 +12113,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/get-stdin": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-7.0.0.tgz", - "integrity": "sha512-zRKcywvrXlXsA0v0i9Io4KDRaAw7+a1ZpjRwl9Wox8PFlVCCHra7E9c4kqXCoCM9nR5tBkaTTZRBoCm60bFqTQ==", - "dev": true, - "engines": { - "node": ">=8" - } - }, "node_modules/get-stream": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", @@ -13057,426 +12892,146 @@ "ms": "^2.0.0" } }, - "node_modules/husky": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/husky/-/husky-2.7.0.tgz", - "integrity": "sha512-LIi8zzT6PyFpcYKdvWRCn/8X+6SuG2TgYYMrM6ckEYhlp44UcEduVymZGIZNLiwOUjrEud+78w/AsAiqJA/kRg==", - "dev": true, - "hasInstallScript": true, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dependencies": { - "cosmiconfig": "^5.2.0", - "execa": "^1.0.0", - "find-up": "^3.0.0", - "get-stdin": "^7.0.0", - "is-ci": "^2.0.0", - "pkg-dir": "^4.1.0", - "please-upgrade-node": "^3.1.1", - "read-pkg": "^5.1.1", - "run-node": "^1.0.0", - "slash": "^3.0.0" - }, - "bin": { - "husky-upgrade": "lib/upgrader/bin.js" + "safer-buffer": ">= 2.1.2 < 3" }, "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/husky/node_modules/ci-info": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", - "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", - "dev": true + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] }, - "node_modules/husky/node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "node_modules/ignore": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", + "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", "dev": true, - "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, "engines": { - "node": ">=4.8" + "node": ">= 4" } }, - "node_modules/husky/node_modules/execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "node_modules/ignore-walk": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-5.0.1.tgz", + "integrity": "sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==", "dev": true, "dependencies": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" + "minimatch": "^5.0.1" }, "engines": { - "node": ">=6" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/husky/node_modules/find-up": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "node_modules/ignore-walk/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", "dev": true, "dependencies": { - "locate-path": "^3.0.0" - }, - "engines": { - "node": ">=6" + "balanced-match": "^1.0.0" } }, - "node_modules/husky/node_modules/get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "node_modules/ignore-walk/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", "dev": true, "dependencies": { - "pump": "^3.0.0" + "brace-expansion": "^2.0.1" }, "engines": { - "node": ">=6" + "node": ">=10" + } + }, + "node_modules/immer": { + "version": "9.0.21", + "resolved": "https://registry.npmjs.org/immer/-/immer-9.0.21.tgz", + "integrity": "sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/immer" } }, - "node_modules/husky/node_modules/is-ci": { + "node_modules/import-fresh": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", - "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", + "integrity": "sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg==", "dev": true, "dependencies": { - "ci-info": "^2.0.0" + "caller-path": "^2.0.0", + "resolve-from": "^3.0.0" }, - "bin": { - "is-ci": "bin.js" + "engines": { + "node": ">=4" } }, - "node_modules/husky/node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", + "node_modules/import-local": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", + "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", "dev": true, + "dependencies": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "bin": { + "import-local-fixture": "fixtures/cli.js" + }, "engines": { - "node": ">=0.10.0" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/husky/node_modules/locate-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "node_modules/import-local/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "dependencies": { - "p-locate": "^3.0.0", - "path-exists": "^3.0.0" + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/husky/node_modules/npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==", + "node_modules/import-local/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "dependencies": { - "path-key": "^2.0.0" + "p-locate": "^4.1.0" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/husky/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/husky/node_modules/p-locate": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", - "dev": true, - "dependencies": { - "p-limit": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/husky/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/husky/node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/husky/node_modules/pkg-dir": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", - "dev": true, - "dependencies": { - "find-up": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/husky/node_modules/pkg-dir/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/husky/node_modules/pkg-dir/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/husky/node_modules/pkg-dir/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "dependencies": { - "p-limit": "^2.2.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/husky/node_modules/pkg-dir/node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "dev": true, - "engines": { - "node": ">=8" - } - }, - "node_modules/husky/node_modules/semver": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.2.tgz", - "integrity": "sha512-cBznnQ9KjJqU67B52RMC65CMarK2600WFnbkcaiwWq3xy/5haFJlshgnpjovMVJ+Hff49d8GEn0b87C5pDQ10g==", - "dev": true, - "bin": { - "semver": "bin/semver" - } - }, - "node_modules/husky/node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", - "dev": true, - "dependencies": { - "shebang-regex": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/husky/node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/husky/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" - } - }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "dev": true, - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/ignore": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.1.tgz", - "integrity": "sha512-5Fytz/IraMjqpwfd34ke28PTVMjZjJG2MPn5t7OE4eUCUNf8BAa7b5WUS9/Qvr6mwOQS7Mk6vdsMno5he+T8Xw==", - "dev": true, - "engines": { - "node": ">= 4" - } - }, - "node_modules/ignore-walk": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-5.0.1.tgz", - "integrity": "sha512-yemi4pMf51WKT7khInJqAvsIGzoqYXblnsz0ql8tM+yi1EKYTY1evX4NAbJrLL/Aanr2HyZeluqU+Oi7MGHokw==", - "dev": true, - "dependencies": { - "minimatch": "^5.0.1" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" - } - }, - "node_modules/ignore-walk/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "node_modules/ignore-walk/node_modules/minimatch": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", - "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/immer": { - "version": "9.0.21", - "resolved": "https://registry.npmjs.org/immer/-/immer-9.0.21.tgz", - "integrity": "sha512-bc4NBHqOqSfRW7POMkHd51LvClaeMXpm8dx0e8oE2GORbq5aRK7Bxl4FyzVLdGtLmvLKL7BTDBG5ACQm4HWjTA==", - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/immer" - } - }, - "node_modules/import-fresh": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-2.0.0.tgz", - "integrity": "sha512-eZ5H8rcgYazHbKC3PG4ClHNykCSxtAhxSSEM+2mb+7evD2CKF5V7c0dNum7AdpDh0ZdICwZY9sRSn8f+KH96sg==", - "dev": true, - "dependencies": { - "caller-path": "^2.0.0", - "resolve-from": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/import-local": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.1.0.tgz", - "integrity": "sha512-ASB07uLtnDs1o6EHjKpX34BKYDSqnFerfTOJL2HvMqF70LnxpjkzDB8J44oT9pu4AMPkQwf8jl6szgvNd2tRIg==", - "dev": true, - "dependencies": { - "pkg-dir": "^4.2.0", - "resolve-cwd": "^3.0.0" - }, - "bin": { - "import-local-fixture": "fixtures/cli.js" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/import-local/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/import-local/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/import-local/node_modules/p-limit": { + "node_modules/import-local/node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", @@ -13816,33 +13371,6 @@ "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", "dev": true }, - "node_modules/is-builtin-module": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.1.tgz", - "integrity": "sha512-BSLE3HnV2syZ0FK0iMA/yUGplUeMmNz4AW5fnTunbCIqZi4vG3WjJT9FHMy5D69xmAYBHXQhJdALdpwVxV501A==", - "dev": true, - "dependencies": { - "builtin-modules": "^3.3.0" - }, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/is-builtin-module/node_modules/builtin-modules": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.3.0.tgz", - "integrity": "sha512-zhaCDicdLuWN5UbN5IMnFqNMhNfo919sH85y2/ea+5Yg9TsTkeZxpL+JLbp6cgYFS4sRLp3YV4S6yDuqVWHYOw==", - "dev": true, - "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/is-callable": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", @@ -15579,15 +15107,6 @@ "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", "dev": true }, - "node_modules/jsdoc-type-pratt-parser": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/jsdoc-type-pratt-parser/-/jsdoc-type-pratt-parser-4.0.0.tgz", - "integrity": "sha512-YtOli5Cmzy3q4dP26GraSOeAhqecewG04hoO8DY56CH4KJ9Fvv5qKWUCCo3HZob7esJQHCv6/+bnTy72xZZaVQ==", - "dev": true, - "engines": { - "node": ">=12.0.0" - } - }, "node_modules/jsdom": { "version": "16.7.0", "resolved": "https://registry.npmjs.org/jsdom/-/jsdom-16.7.0.tgz", @@ -16443,428 +15962,126 @@ }, "node_modules/libnpmaccess/node_modules/npm-package-arg": { "version": "10.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", - "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^6.0.0", - "proc-log": "^3.0.0", - "semver": "^7.3.5", - "validate-npm-package-name": "^5.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/libnpmpublish": { - "version": "7.3.0", - "resolved": "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-7.3.0.tgz", - "integrity": "sha512-fHUxw5VJhZCNSls0KLNEG0mCD2PN1i14gH5elGOgiVnU3VgTcRahagYP2LKI1m0tFCJ+XrAm0zVYyF5RCbXzcg==", - "dev": true, - "dependencies": { - "ci-info": "^3.6.1", - "normalize-package-data": "^5.0.0", - "npm-package-arg": "^10.1.0", - "npm-registry-fetch": "^14.0.3", - "proc-log": "^3.0.0", - "semver": "^7.3.7", - "sigstore": "^1.4.0", - "ssri": "^10.0.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/libnpmpublish/node_modules/hosted-git-info": { - "version": "6.1.1", - "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", - "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", - "dev": true, - "dependencies": { - "lru-cache": "^7.5.1" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/libnpmpublish/node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "dev": true, - "engines": { - "node": ">=12" - } - }, - "node_modules/libnpmpublish/node_modules/normalize-package-data": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz", - "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==", - "dev": true, - "dependencies": { - "hosted-git-info": "^6.0.0", - "is-core-module": "^2.8.1", - "semver": "^7.3.5", - "validate-npm-package-license": "^3.0.4" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/libnpmpublish/node_modules/npm-package-arg": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", - "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", - "dev": true, - "dependencies": { - "hosted-git-info": "^6.0.0", - "proc-log": "^3.0.0", - "semver": "^7.3.5", - "validate-npm-package-name": "^5.0.0" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/libnpmpublish/node_modules/ssri": { - "version": "10.0.5", - "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.5.tgz", - "integrity": "sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==", - "dev": true, - "dependencies": { - "minipass": "^7.0.3" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/lilconfig": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", - "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", - "dev": true, - "engines": { - "node": ">=10" - } - }, - "node_modules/lines-and-columns": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.4.tgz", - "integrity": "sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - } - }, - "node_modules/linkify-it": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", - "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", - "dev": true, - "dependencies": { - "uc.micro": "^1.0.1" - } - }, - "node_modules/lint-staged": { - "version": "15.2.2", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-15.2.2.tgz", - "integrity": "sha512-TiTt93OPh1OZOsb5B7k96A/ATl2AjIZo+vnzFZ6oHK5FuTk63ByDtxGQpHm+kFETjEWqgkF95M8FRXKR/LEBcw==", - "dev": true, - "dependencies": { - "chalk": "5.3.0", - "commander": "11.1.0", - "debug": "4.3.4", - "execa": "8.0.1", - "lilconfig": "3.0.0", - "listr2": "8.0.1", - "micromatch": "4.0.5", - "pidtree": "0.6.0", - "string-argv": "0.3.2", - "yaml": "2.3.4" - }, - "bin": { - "lint-staged": "bin/lint-staged.js" - }, - "engines": { - "node": ">=18.12.0" - }, - "funding": { - "url": "https://opencollective.com/lint-staged" - } - }, - "node_modules/lint-staged/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/lint-staged/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/lint-staged/node_modules/chalk": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.3.0.tgz", - "integrity": "sha512-dLitG79d+GV1Nb/VYcCDFivJeK1hiukt9QjRNVOsUtTy1rR1YJsmpGGTZ3qJos+uw7WmWF4wUwBd9jxjocFC2w==", - "dev": true, - "engines": { - "node": "^12.17.0 || ^14.13 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/lint-staged/node_modules/commander": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", - "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", - "dev": true, - "engines": { - "node": ">=16" - } - }, - "node_modules/lint-staged/node_modules/emoji-regex": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", - "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", - "dev": true - }, - "node_modules/lint-staged/node_modules/eventemitter3": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", - "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", - "dev": true - }, - "node_modules/lint-staged/node_modules/execa": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/execa/-/execa-8.0.1.tgz", - "integrity": "sha512-VyhnebXciFV2DESc+p6B+y0LjSm0krU4OgJN44qFAhBY0TJ+1V61tYD2+wHusZ6F9n5K+vl8k0sTy7PEfV4qpg==", - "dev": true, - "dependencies": { - "cross-spawn": "^7.0.3", - "get-stream": "^8.0.1", - "human-signals": "^5.0.0", - "is-stream": "^3.0.0", - "merge-stream": "^2.0.0", - "npm-run-path": "^5.1.0", - "onetime": "^6.0.0", - "signal-exit": "^4.1.0", - "strip-final-newline": "^3.0.0" - }, - "engines": { - "node": ">=16.17" - }, - "funding": { - "url": "https://github.com/sindresorhus/execa?sponsor=1" - } - }, - "node_modules/lint-staged/node_modules/get-stream": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-8.0.1.tgz", - "integrity": "sha512-VaUJspBffn/LMCJVoMvSAdmscJyS1auj5Zulnn5UoYcY531UWmdwhRWkcGKnGU93m5HSXP9LP2usOryrBtQowA==", - "dev": true, - "engines": { - "node": ">=16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lint-staged/node_modules/human-signals": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-5.0.0.tgz", - "integrity": "sha512-AXcZb6vzzrFAUE61HnN4mpLqd/cSIwNQjtNWR0euPm6y0iqx3G4gOXaIDdtdDwZmhwe82LA6+zinmW4UBWVePQ==", - "dev": true, - "engines": { - "node": ">=16.17.0" - } - }, - "node_modules/lint-staged/node_modules/is-stream": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-3.0.0.tgz", - "integrity": "sha512-LnQR4bZ9IADDRSkvpqMGvt/tEJWclzklNgSw48V5EAaAeDd6qGvN8ei6k5p0tvxSR171VmGyHuTiAOfxAbr8kA==", - "dev": true, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lint-staged/node_modules/lilconfig": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-3.0.0.tgz", - "integrity": "sha512-K2U4W2Ff5ibV7j7ydLr+zLAkIg5JJ4lPn1Ltsdt+Tz/IjQ8buJ55pZAxoP34lqIiwtF9iAvtLv3JGv7CAyAg+g==", - "dev": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/lint-staged/node_modules/listr2": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-8.0.1.tgz", - "integrity": "sha512-ovJXBXkKGfq+CwmKTjluEqFi3p4h8xvkxGQQAQan22YCgef4KZ1mKGjzfGh6PL6AW5Csw0QiQPNuQyH+6Xk3hA==", - "dev": true, - "dependencies": { - "cli-truncate": "^4.0.0", - "colorette": "^2.0.20", - "eventemitter3": "^5.0.1", - "log-update": "^6.0.0", - "rfdc": "^1.3.0", - "wrap-ansi": "^9.0.0" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/lint-staged/node_modules/mimic-fn": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-4.0.0.tgz", - "integrity": "sha512-vqiC06CuhBTUdZH+RYl8sFrL096vA45Ok5ISO6sE/Mr1jRbGH4Csnhi8f3wKVl7x8mO4Au7Ir9D3Oyv1VYMFJw==", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", + "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", "dev": true, - "engines": { - "node": ">=12" + "dependencies": { + "hosted-git-info": "^6.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^5.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/lint-staged/node_modules/npm-run-path": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-5.3.0.tgz", - "integrity": "sha512-ppwTtiJZq0O/ai0z7yfudtBpWIoxM8yE6nHi1X47eFR2EWORqfbu6CnPlNsjeN683eT0qG6H/Pyf9fCcvjnnnQ==", + "node_modules/libnpmpublish": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/libnpmpublish/-/libnpmpublish-7.3.0.tgz", + "integrity": "sha512-fHUxw5VJhZCNSls0KLNEG0mCD2PN1i14gH5elGOgiVnU3VgTcRahagYP2LKI1m0tFCJ+XrAm0zVYyF5RCbXzcg==", "dev": true, "dependencies": { - "path-key": "^4.0.0" + "ci-info": "^3.6.1", + "normalize-package-data": "^5.0.0", + "npm-package-arg": "^10.1.0", + "npm-registry-fetch": "^14.0.3", + "proc-log": "^3.0.0", + "semver": "^7.3.7", + "sigstore": "^1.4.0", + "ssri": "^10.0.1" }, "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/lint-staged/node_modules/onetime": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-6.0.0.tgz", - "integrity": "sha512-1FlR+gjXK7X+AsAHso35MnyN5KqGwJRi/31ft6x0M194ht7S+rWAvd7PHss9xSKMzE0asv1pyIHaJYq+BbacAQ==", + "node_modules/libnpmpublish/node_modules/hosted-git-info": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-6.1.1.tgz", + "integrity": "sha512-r0EI+HBMcXadMrugk0GCQ+6BQV39PiWAZVfq7oIckeGiN7sjRGyQxPdft3nQekFTCQbYxLBH+/axZMeH8UX6+w==", "dev": true, "dependencies": { - "mimic-fn": "^4.0.0" + "lru-cache": "^7.5.1" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/lint-staged/node_modules/path-key": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-4.0.0.tgz", - "integrity": "sha512-haREypq7xkM7ErfgIyA0z+Bj4AGKlMSdlQE2jvJo6huWD1EdkKYV+G/T4nq0YEF2vgTT8kqMFKo1uHn950r4SQ==", + "node_modules/libnpmpublish/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", "dev": true, "engines": { "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/lint-staged/node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", + "node_modules/libnpmpublish/node_modules/normalize-package-data": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-5.0.0.tgz", + "integrity": "sha512-h9iPVIfrVZ9wVYQnxFgtw1ugSvGEMOlyPWWtm8BMJhnwyEL/FLbYbTY3V3PpjI/BUK67n9PEWDu6eHzu1fB15Q==", "dev": true, - "engines": { - "node": ">=14" + "dependencies": { + "hosted-git-info": "^6.0.0", + "is-core-module": "^2.8.1", + "semver": "^7.3.5", + "validate-npm-package-license": "^3.0.4" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "engines": { + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/lint-staged/node_modules/string-width": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", - "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", + "node_modules/libnpmpublish/node_modules/npm-package-arg": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/npm-package-arg/-/npm-package-arg-10.1.0.tgz", + "integrity": "sha512-uFyyCEmgBfZTtrKk/5xDfHp6+MdrqGotX/VoOyEEl3mBwiEE5FlBaePanazJSVMPT7vKepcjYBY2ztg9A3yPIA==", "dev": true, "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" + "hosted-git-info": "^6.0.0", + "proc-log": "^3.0.0", + "semver": "^7.3.5", + "validate-npm-package-name": "^5.0.0" }, "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/lint-staged/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "node_modules/libnpmpublish/node_modules/ssri": { + "version": "10.0.5", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-10.0.5.tgz", + "integrity": "sha512-bSf16tAFkGeRlUNDjXu8FzaMQt6g2HZJrun7mtMbIPOddxt3GLMSz5VWUWcqTJUPfLEaDIepGxv+bYQW49596A==", "dev": true, "dependencies": { - "ansi-regex": "^6.0.1" + "minipass": "^7.0.3" }, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/lint-staged/node_modules/strip-final-newline": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-3.0.0.tgz", - "integrity": "sha512-dOESqjYr96iWYylGObzd39EuNTa5VJxyvVAEm5Jnh7KGo75V43Hk1odPQkNDyXNmUR6k+gEiDVXnjB8HJ3crXw==", + "node_modules/lilconfig": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.1.0.tgz", + "integrity": "sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==", "dev": true, "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=10" } }, - "node_modules/lint-staged/node_modules/wrap-ansi": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", - "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", + "node_modules/lines-and-columns": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-2.0.4.tgz", + "integrity": "sha512-wM1+Z03eypVAVUCE7QdSqpVIvelbOakn1M0bPDoA4SGWPx3sNDVUiMo3L6To6WWGClB7VyXnhQ4Sn7gxiJbE6A==", "dev": true, - "dependencies": { - "ansi-styles": "^6.2.1", - "string-width": "^7.0.0", - "strip-ansi": "^7.1.0" - }, "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" } }, - "node_modules/lint-staged/node_modules/yaml": { - "version": "2.3.4", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-2.3.4.tgz", - "integrity": "sha512-8aAvwVUSHpfEqTQ4w/KMlf3HcRdt50E5ODIQJBw1fQ5RL34xabzxtUlzTXVqc4rkZsPbvrXKWnABCD7kWSmocA==", + "node_modules/linkify-it": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.2.0.tgz", + "integrity": "sha512-GnAl/knGn+i1U/wjBz3akz2stz+HrHLsxMwHQGofCDfPvlf+gDKN58UtfmUquTY4/MXeE2x7k19KQmeoZi94Iw==", "dev": true, - "engines": { - "node": ">= 14" + "dependencies": { + "uc.micro": "^1.0.1" } }, "node_modules/list-item": { @@ -17170,231 +16387,44 @@ "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", "dev": true, "dependencies": { - "lodash._reinterpolate": "^3.0.0", - "lodash.templatesettings": "^4.0.0" - } - }, - "node_modules/lodash.templatesettings": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", - "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", - "dev": true, - "dependencies": { - "lodash._reinterpolate": "^3.0.0" - } - }, - "node_modules/lodash.topath": { - "version": "4.5.2", - "resolved": "https://registry.npmjs.org/lodash.topath/-/lodash.topath-4.5.2.tgz", - "integrity": "sha512-1/W4dM+35DwvE/iEd1M9ekewOSTlpFekhw9mhAtrwjVqUr83/ilQiyAvmg4tVX7Unkcfl1KC+i9WdaT4B6aQcg==" - }, - "node_modules/lodash.uniq": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", - "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", - "dev": true - }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-update": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.0.0.tgz", - "integrity": "sha512-niTvB4gqvtof056rRIrTZvjNYE4rCUzO6X/X+kYjd7WFxXeJ0NwEFnRxX6ehkvv3jTwrXnNdtAak5XYZuIyPFw==", - "dev": true, - "dependencies": { - "ansi-escapes": "^6.2.0", - "cli-cursor": "^4.0.0", - "slice-ansi": "^7.0.0", - "strip-ansi": "^7.1.0", - "wrap-ansi": "^9.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-update/node_modules/ansi-escapes": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-6.2.0.tgz", - "integrity": "sha512-kzRaCqXnpzWs+3z5ABPQiVke+iq0KXkHo8xiWV4RPTi5Yli0l97BEQuhXV1s7+aSU/fu1kUuxgS4MsQ0fRuygw==", - "dev": true, - "dependencies": { - "type-fest": "^3.0.0" - }, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-update/node_modules/ansi-regex": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", - "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/log-update/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/log-update/node_modules/cli-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", - "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", - "dev": true, - "dependencies": { - "restore-cursor": "^4.0.0" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-update/node_modules/emoji-regex": { - "version": "10.3.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.3.0.tgz", - "integrity": "sha512-QpLs9D9v9kArv4lfDEgg1X/gN5XLnf/A6l9cs8SPZLRZR3ZkY9+kwIQTxm+fsSej5UMYGE8fdoaZVIBlqG0XTw==", - "dev": true - }, - "node_modules/log-update/node_modules/is-fullwidth-code-point": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-5.0.0.tgz", - "integrity": "sha512-OVa3u9kkBbw7b8Xw5F9P+D/T9X+Z4+JruYVNapTjPYZYUznQ5YfWeFkOj606XYYW8yugTfC8Pj0hYqvi4ryAhA==", - "dev": true, - "dependencies": { - "get-east-asian-width": "^1.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-update/node_modules/restore-cursor": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", - "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", - "dev": true, - "dependencies": { - "onetime": "^5.1.0", - "signal-exit": "^3.0.2" - }, - "engines": { - "node": "^12.20.0 || ^14.13.1 || >=16.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/log-update/node_modules/slice-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-7.1.0.tgz", - "integrity": "sha512-bSiSngZ/jWeX93BqeIAbImyTbEihizcwNjFoRUIY/T1wWQsfsm2Vw1agPKylXvQTU7iASGdHhyqRlqQzfz+Htg==", - "dev": true, - "dependencies": { - "ansi-styles": "^6.2.1", - "is-fullwidth-code-point": "^5.0.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/log-update/node_modules/string-width": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-7.1.0.tgz", - "integrity": "sha512-SEIJCWiX7Kg4c129n48aDRwLbFb2LJmXXFrWBG4NGaRtMQ3myKPKbwrD1BKqQn74oCoNMBVrfDEr5M9YxCsrkw==", - "dev": true, - "dependencies": { - "emoji-regex": "^10.3.0", - "get-east-asian-width": "^1.0.0", - "strip-ansi": "^7.1.0" - }, - "engines": { - "node": ">=18" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "lodash._reinterpolate": "^3.0.0", + "lodash.templatesettings": "^4.0.0" } }, - "node_modules/log-update/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", + "node_modules/lodash.templatesettings": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", + "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", "dev": true, "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" + "lodash._reinterpolate": "^3.0.0" } }, - "node_modules/log-update/node_modules/type-fest": { - "version": "3.13.1", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-3.13.1.tgz", - "integrity": "sha512-tLq3bSNx+xSpwvAJnzrK0Ep5CLNWjvFTOp71URMaAEWBfRb9nnJiBoUe0tF8bI4ZFO3omgBR6NvnbzVUT3Ly4g==", - "dev": true, - "engines": { - "node": ">=14.16" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "node_modules/lodash.topath": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/lodash.topath/-/lodash.topath-4.5.2.tgz", + "integrity": "sha512-1/W4dM+35DwvE/iEd1M9ekewOSTlpFekhw9mhAtrwjVqUr83/ilQiyAvmg4tVX7Unkcfl1KC+i9WdaT4B6aQcg==" }, - "node_modules/log-update/node_modules/wrap-ansi": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-9.0.0.tgz", - "integrity": "sha512-G8ura3S+3Z2G+mkgNRq8dqaFZAuxfsxpBB8OCTGRTCtp+l/v9nbFNmCUP1BZMts3G1142MsZfn6eeUKrr4PD1Q==", + "node_modules/lodash.uniq": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", + "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==", + "dev": true + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", "dev": true, "dependencies": { - "ansi-styles": "^6.2.1", - "string-width": "^7.0.0", - "strip-ansi": "^7.1.0" + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" }, "engines": { - "node": ">=18" + "node": ">=10" }, "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/long": { @@ -20495,18 +19525,6 @@ "url": "https://github.com/sponsors/jonschlinkert" } }, - "node_modules/pidtree": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/pidtree/-/pidtree-0.6.0.tgz", - "integrity": "sha512-eG2dWTVw5bzqGRztnHExczNxt5VGsE6OwTeCG3fdUf9KBsZzO3R5OIIIzWR+iZA0NtZ+RDVdaoE2dK1cn6jH4g==", - "dev": true, - "bin": { - "pidtree": "bin/pidtree.js" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/pify": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", @@ -20633,15 +19651,6 @@ "resolved": "playground", "link": true }, - "node_modules/please-upgrade-node": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", - "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", - "dev": true, - "dependencies": { - "semver-compare": "^1.0.0" - } - }, "node_modules/pony-cause": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/pony-cause/-/pony-cause-1.1.1.tgz", @@ -23410,18 +22419,6 @@ "node": ">=0.12.0" } }, - "node_modules/run-node": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/run-node/-/run-node-1.0.0.tgz", - "integrity": "sha512-kc120TBlQ3mih1LSzdAJXo4xn/GWS2ec0l3S+syHDXP9uRr0JAT8Qd3mdMuyjqCzeZktgP3try92cEgf9Nks8A==", - "dev": true, - "bin": { - "run-node": "run-node" - }, - "engines": { - "node": ">=4" - } - }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -23897,12 +22894,6 @@ "node": ">=10" } }, - "node_modules/semver-compare": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", - "integrity": "sha512-YM3/ITh2MJ5MtzaM429anh+x2jiLVjqILF4m4oyQB18W7Ggea7BfqdH/wGMK7dDiMghv/6WG7znWMwUDzJiXow==", - "dev": true - }, "node_modules/semver/node_modules/lru-cache": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", @@ -24321,46 +23312,6 @@ "node": ">=8" } }, - "node_modules/slice-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-5.0.0.tgz", - "integrity": "sha512-FC+lgizVPfie0kkhqUScwRu1O/lF6NOgJmlCgK+/LYxDCTk8sGelYaHDhFcDN+Sn3Cv+3VSa4Byeo+IMCzpMgQ==", - "dev": true, - "dependencies": { - "ansi-styles": "^6.0.0", - "is-fullwidth-code-point": "^4.0.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/slice-ansi?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/slice-ansi/node_modules/is-fullwidth-code-point": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-4.0.0.tgz", - "integrity": "sha512-O4L094N2/dZ7xqVdrXhh9r1KODPJpFms8B5sGdJLPy664AgvXsreZUyCQQNItZRDlYug4xStLjNp/sz3HvBowQ==", - "dev": true, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, "node_modules/smart-buffer": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", @@ -24904,15 +23855,6 @@ "safe-buffer": "~5.2.0" } }, - "node_modules/string-argv": { - "version": "0.3.2", - "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", - "integrity": "sha512-aqD2Q0144Z+/RqG52NeHEkZauTAUWJO8c6yTftGJKO3Tja5tUgIfmIl6kExvhtxSDP7fXB6DvzkfMpCd/F3G+Q==", - "dev": true, - "engines": { - "node": ">=0.6.19" - } - }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -28117,21 +27059,11 @@ "@types/react": "^18", "@types/react-dom": "^18", "autoprefixer": "^10.0.1", - "eslint-config-next": "14.1.0", "postcss": "^8", "tailwindcss": "^3.3.0", "typescript": "^5" } }, - "playground/node_modules/@next/eslint-plugin-next": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/@next/eslint-plugin-next/-/eslint-plugin-next-14.1.0.tgz", - "integrity": "sha512-x4FavbNEeXx/baD/zC/SdrvkjSby8nBn8KcCREqk6UuwvwoAPZmaV8TFCAuo/cpovBRTIY67mHhe86MQQm/68Q==", - "dev": true, - "dependencies": { - "glob": "10.3.10" - } - }, "playground/node_modules/@types/node": { "version": "20.11.27", "resolved": "https://registry.npmjs.org/@types/node/-/node-20.11.27.tgz", @@ -28161,159 +27093,6 @@ "@types/react": "*" } }, - "playground/node_modules/@typescript-eslint/parser": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-6.21.0.tgz", - "integrity": "sha512-tbsV1jPne5CkFQCgPBcDOt30ItF7aJoZL997JSF7MhGQqOeT3svWRYxiqlfA5RUdlHN6Fi+EI9bxqbdyAUZjYQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/scope-manager": "6.21.0", - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/typescript-estree": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", - "debug": "^4.3.4" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependencies": { - "eslint": "^7.0.0 || ^8.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "playground/node_modules/@typescript-eslint/scope-manager": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", - "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "playground/node_modules/@typescript-eslint/types": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", - "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", - "dev": true, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "playground/node_modules/@typescript-eslint/typescript-estree": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", - "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.21.0", - "@typescript-eslint/visitor-keys": "6.21.0", - "debug": "^4.3.4", - "globby": "^11.1.0", - "is-glob": "^4.0.3", - "minimatch": "9.0.3", - "semver": "^7.5.4", - "ts-api-utils": "^1.0.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "playground/node_modules/@typescript-eslint/visitor-keys": { - "version": "6.21.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", - "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", - "dev": true, - "dependencies": { - "@typescript-eslint/types": "6.21.0", - "eslint-visitor-keys": "^3.4.1" - }, - "engines": { - "node": "^16.0.0 || >=18.0.0" - }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/typescript-eslint" - } - }, - "playground/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "dependencies": { - "balanced-match": "^1.0.0" - } - }, - "playground/node_modules/eslint-config-next": { - "version": "14.1.0", - "resolved": "https://registry.npmjs.org/eslint-config-next/-/eslint-config-next-14.1.0.tgz", - "integrity": "sha512-SBX2ed7DoRFXC6CQSLc/SbLY9Ut6HxNB2wPTcoIWjUMd7aF7O/SIE7111L8FdZ9TXsNV4pulUDnfthpyPtbFUg==", - "dev": true, - "dependencies": { - "@next/eslint-plugin-next": "14.1.0", - "@rushstack/eslint-patch": "^1.3.3", - "@typescript-eslint/parser": "^5.4.2 || ^6.0.0", - "eslint-import-resolver-node": "^0.3.6", - "eslint-import-resolver-typescript": "^3.5.2", - "eslint-plugin-import": "^2.28.1", - "eslint-plugin-jsx-a11y": "^6.7.1", - "eslint-plugin-react": "^7.33.2", - "eslint-plugin-react-hooks": "^4.5.0 || 5.0.0-canary-7118f5dd7-20230705" - }, - "peerDependencies": { - "eslint": "^7.23.0 || ^8.0.0", - "typescript": ">=3.3.1" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - } - } - }, - "playground/node_modules/minimatch": { - "version": "9.0.3", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", - "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", - "dev": true, - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, "playground/node_modules/object-hash": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/object-hash/-/object-hash-3.0.0.tgz", diff --git a/package.json b/package.json index a2946dbcb..2b7c2c39b 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,6 @@ "eslint-config-next": "^14.2.2", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", - "eslint-plugin-jsdoc": "^48.2.3", "eslint-plugin-react": "^7.34.1", "lerna": "^8.1.2", "markdown-toc": "^1.2.0", diff --git a/playground/app/page.tsx b/playground/app/page.tsx index 0453226da..a3a9ba62b 100644 --- a/playground/app/page.tsx +++ b/playground/app/page.tsx @@ -37,6 +37,7 @@ class Playground extends Component { refreshing: false, }; + // eslint-disable-next-line @typescript-eslint/no-explicit-any constructor(props: any) { super(props); this.updateSchemaFn = debounce( diff --git a/playground/components/FetchSchema.tsx b/playground/components/FetchSchema.tsx index 6acec1d47..a4b2a1a4e 100644 --- a/playground/components/FetchSchema.tsx +++ b/playground/components/FetchSchema.tsx @@ -45,7 +45,7 @@ class FetchSchema extends Component { state: { link }, } = this; // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call - parentCallback(await fetchSchema(link)); + parentCallback((await fetchSchema(link)) as string); }; } diff --git a/playground/components/Tabs.tsx b/playground/components/Tabs.tsx index 38655e1a6..3c23d45dd 100644 --- a/playground/components/Tabs.tsx +++ b/playground/components/Tabs.tsx @@ -56,7 +56,7 @@ class Tabs extends Component { render() { const { additionalHeaderContent } = this.props; const children = [] - // eslint-disable-next-line @typescript-eslint/no-unsafe-argument + // eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-explicit-any .concat(...(this.props.children as any)) .filter(child => child !== null && child !== undefined); diff --git a/playground/utils/helpers.ts b/playground/utils/helpers.ts index 5c3700d67..55a8f3de7 100644 --- a/playground/utils/helpers.ts +++ b/playground/utils/helpers.ts @@ -24,7 +24,7 @@ export const stringify = (content?: T): string => { } }; -export const fetchSchema = async (link: string): Promise => { +export const fetchSchema = async (link: string): Promise => { const requestOptions = { method: 'GET', }; @@ -32,18 +32,22 @@ export const fetchSchema = async (link: string): Promise => { return fetch(link, requestOptions).then(handleResponse); }; +// eslint-disable-next-line @typescript-eslint/no-explicit-any function handleResponse(response: any) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access, arrow-body-style + // eslint-disable-next-line @typescript-eslint/no-unsafe-return, @typescript-eslint/no-unsafe-call, @typescript-eslint/no-unsafe-member-access return response.text().then((data: string) => data); } export function debounce( + // eslint-disable-next-line @typescript-eslint/no-explicit-any func: (...args: any[]) => void, wait: number, onStart: () => void, onCancel: () => void, + // eslint-disable-next-line @typescript-eslint/no-explicit-any ): () => any { let timeout: NodeJS.Timeout | undefined; + // eslint-disable-next-line @typescript-eslint/no-explicit-any return (...args: any[]) => { if (timeout) { clearTimeout(timeout); diff --git a/web-component/src/AsyncApiWebComponent.tsx b/web-component/src/AsyncApiWebComponent.tsx index a828881ca..83692fae5 100644 --- a/web-component/src/AsyncApiWebComponent.tsx +++ b/web-component/src/AsyncApiWebComponent.tsx @@ -1,6 +1,6 @@ /* eslint-disable react/no-unescaped-entities */ import * as React from 'react'; -// @ts-expect-error no types +// @ts-expect-error no types exists import { register } from 'web-react-components'; import AsyncApiComponent, { AsyncApiProps, @@ -26,11 +26,11 @@ function retrieveSchemaProp( let schemaFetchOptions = props.schemaFetchOptions; if (!schemaUrl || schemaUrl === 'undefined') { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any schemaUrl = undefined as any; } if (!schemaFetchOptions) { - // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment + // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-explicit-any schemaFetchOptions = undefined as any; } @@ -58,10 +58,6 @@ export class AsyncApiWebComponent extends React.Component< > { private lastUrlCheck: number = Date.now(); - constructor(props: AsyncApiWebComponentProps) { - super(props); - } - shouldComponentUpdate(nextProps: Readonly) { const prevSchema = retrieveSchemaProp(this.props); const nextSchema = retrieveSchemaProp(nextProps); From 80c3317119ce3d45d565773b0307b1d1fb8a373e Mon Sep 17 00:00:00 2001 From: Kenneth Aasan Date: Tue, 23 Apr 2024 14:52:24 +0200 Subject: [PATCH 08/12] chore: migrate from tslint to eslint --- .eslintrc.json | 3 +- library/src/components/CollapseButton.tsx | 2 +- library/src/components/Schema.tsx | 95 +++++++++---------- library/src/components/Tag.tsx | 2 +- library/src/containers/AsyncApi/AsyncApi.tsx | 2 +- library/src/containers/AsyncApi/Layout.tsx | 4 +- .../src/containers/AsyncApi/Standalone.tsx | 2 +- library/src/containers/Error/Error.tsx | 4 +- library/src/containers/Info/Info.tsx | 8 +- library/src/containers/Messages/Message.tsx | 2 +- .../containers/Messages/MessageExample.tsx | 6 +- .../src/containers/Operations/Operation.tsx | 2 +- library/src/containers/Servers/Security.tsx | 10 +- library/src/containers/Sidebar/Sidebar.tsx | 64 +++++++------ .../Sidebar/__tests__/SideBar.test.tsx | 2 +- library/src/helpers/__tests__/sidebar.test.ts | 6 +- library/src/helpers/schema.ts | 12 +-- library/src/helpers/sidebar.ts | 2 +- library/src/standalone-codebase.ts | 4 +- library/src/types.ts | 4 +- playground/components/FetchSchema.tsx | 3 +- playground/components/Tabs.tsx | 4 +- playground/utils/defaultConfig.ts | 2 +- web-component/src/AsyncApiWebComponent.tsx | 4 +- 24 files changed, 118 insertions(+), 131 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 35e066cd7..640ff1578 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -5,7 +5,8 @@ }, "extends": [ "eslint:recommended", - "plugin:@typescript-eslint/strict", + "plugin:@typescript-eslint/recommended-type-checked", + "plugin:@typescript-eslint/stylistic-type-checked", "plugin:react/recommended", "next/core-web-vitals", "prettier" diff --git a/library/src/components/CollapseButton.tsx b/library/src/components/CollapseButton.tsx index 5b34db9ca..bea5a7a00 100644 --- a/library/src/components/CollapseButton.tsx +++ b/library/src/components/CollapseButton.tsx @@ -41,7 +41,7 @@ export const CollapseButton: React.FunctionComponent = ({ {...chevronProps} className={`inline-block align-baseline cursor-pointer ml-0.5 -mb-1 w-5 h-5 transform transition-transform duration-150 ease-linear ${ expanded ? '-rotate-90' : '' - } ${chevronProps?.className || ''}`} + } ${chevronProps?.className ?? ''}`} /> ); diff --git a/library/src/components/Schema.tsx b/library/src/components/Schema.tsx index 9aa9040c8..0b2971ac5 100644 --- a/library/src/components/Schema.tsx +++ b/library/src/components/Schema.tsx @@ -246,7 +246,7 @@ export const Schema: React.FunctionComponent = ({ Documentation @@ -279,51 +279,42 @@ export const Schema: React.FunctionComponent = ({ - {schema.oneOf() && - schema - .oneOf() - ?.map((s, idx) => ( - - ))} - {schema.anyOf() && - schema - .anyOf() - ?.map((s, idx) => ( - - ))} - {schema.allOf() && - schema - .allOf() - ?.map((s, idx) => ( - - ))} + {schema.oneOf()?.map((s, idx) => ( + + ))} + {schema.anyOf()?.map((s, idx) => ( + + ))} + {schema.allOf()?.map((s, idx) => ( + + ))} {schema.not() && ( )} @@ -384,7 +375,7 @@ const SchemaProperties: React.FunctionComponent = ({ return null; } - const required = schema.required() || []; + const required = schema.required() ?? []; const patternProperties = schema.patternProperties(); return ( @@ -403,7 +394,7 @@ const SchemaProperties: React.FunctionComponent = ({ key={propertyName} /> ))} - {Object.entries(patternProperties || {}).map( + {Object.entries(patternProperties ?? {}).map( ([propertyName, property]) => ( = } const type = schema.type(); - if (type === undefined || !type.includes('object')) { + if (!type?.includes('object')) { return null; } @@ -466,7 +457,7 @@ interface SchemaItemsProps { const SchemaItems: React.FunctionComponent = ({ schema }) => { const type = schema.type(); - if (type === undefined || !type.includes('array')) { + if (!type?.includes('array')) { return null; } const items = schema.items(); @@ -475,7 +466,7 @@ const SchemaItems: React.FunctionComponent = ({ schema }) => { if ( items && !Array.isArray(items) && - Object.keys(items.properties() || {}).length + Object.keys(items.properties() ?? {}).length ) { return ; } else if (Array.isArray(items)) { @@ -512,7 +503,7 @@ const AdditionalItems: React.FunctionComponent = ({ } const type = schema.type(); - if (type === undefined || !type.includes('array')) { + if (!type?.includes('array')) { return null; } if (!Array.isArray(schema.items())) { diff --git a/library/src/components/Tag.tsx b/library/src/components/Tag.tsx index 74e8e27e0..6806b651f 100644 --- a/library/src/components/Tag.tsx +++ b/library/src/components/Tag.tsx @@ -9,7 +9,7 @@ interface Props { export const Tag: React.FunctionComponent = ({ tag }) => { const name = `#${tag.name()}`; - const description = tag.description() || ''; + const description = tag.description() ?? ''; const externalDocs = tag.externalDocs(); const element = ( diff --git a/library/src/containers/AsyncApi/AsyncApi.tsx b/library/src/containers/AsyncApi/AsyncApi.tsx index 3310a59a7..dd3d37d18 100644 --- a/library/src/containers/AsyncApi/AsyncApi.tsx +++ b/library/src/containers/AsyncApi/AsyncApi.tsx @@ -50,7 +50,7 @@ class AsyncApiComponent extends Component { return ( diff --git a/library/src/containers/AsyncApi/Layout.tsx b/library/src/containers/AsyncApi/Layout.tsx index ef72b95f3..5bf6bac38 100644 --- a/library/src/containers/AsyncApi/Layout.tsx +++ b/library/src/containers/AsyncApi/Layout.tsx @@ -43,14 +43,14 @@ const AsyncApiLayout: React.FunctionComponent = ({ }, }); - const configShow = config.show || {}; + const configShow = config.show ?? {}; return (

    {configShow.sidebar && } diff --git a/library/src/containers/AsyncApi/Standalone.tsx b/library/src/containers/AsyncApi/Standalone.tsx index 3d9f6e243..658aa9b4e 100644 --- a/library/src/containers/AsyncApi/Standalone.tsx +++ b/library/src/containers/AsyncApi/Standalone.tsx @@ -53,7 +53,7 @@ class AsyncApiComponent extends Component { const { config, error: propError } = this.props; const { asyncapi, error: stateError } = this.state; - const error = propError || stateError; + const error = propError ?? stateError; const concatenatedConfig: ConfigInterface = { ...defaultConfig, ...config, diff --git a/library/src/containers/Error/Error.tsx b/library/src/containers/Error/Error.tsx index d526a92d5..984cc8fa2 100644 --- a/library/src/containers/Error/Error.tsx +++ b/library/src/containers/Error/Error.tsx @@ -10,7 +10,7 @@ const renderErrors = (errors: ValidationError[]): React.ReactNode => { return errors .map((singleError: ValidationError, index: number) => { - if (!singleError || !singleError.title || !singleError.location) { + if (!singleError?.title || !singleError.location) { return null; } return ( @@ -42,7 +42,7 @@ export const Error: React.FunctionComponent = ({ error }) => {

    {title ? `${ERROR_TEXT}: ${title}` : ERROR_TEXT}

    - {validationErrors && validationErrors.length ? ( + {validationErrors?.length ? (
    {renderErrors(validationErrors)}
    diff --git a/library/src/containers/Info/Info.tsx b/library/src/containers/Info/Info.tsx index 8e43b25fd..49a4d40d7 100644 --- a/library/src/containers/Info/Info.tsx +++ b/library/src/containers/Info/Info.tsx @@ -25,7 +25,7 @@ export const Info: React.FunctionComponent = () => { const contact = info.contact(); const showInfoList = - license || termsOfService || defaultContentType || contact || externalDocs; + license ?? termsOfService ?? defaultContentType ?? contact ?? externalDocs; return (
    @@ -41,7 +41,7 @@ export const Info: React.FunctionComponent = () => { {license.url() ? ( {license.name()} @@ -88,9 +88,9 @@ export const Info: React.FunctionComponent = () => {
  • - {contact.name() || URL_SUPPORT_TEXT} + {contact.name() ?? URL_SUPPORT_TEXT}
  • )} diff --git a/library/src/containers/Messages/Message.tsx b/library/src/containers/Messages/Message.tsx index 7024c2d25..4d5c5fbf3 100644 --- a/library/src/containers/Messages/Message.tsx +++ b/library/src/containers/Messages/Message.tsx @@ -47,7 +47,7 @@ export const Message: React.FunctionComponent = ({ const contentType = message.contentType(); const externalDocs = message.externalDocs(); - const showInfoList = contentType || externalDocs; + const showInfoList = contentType ?? externalDocs; return (
    diff --git a/library/src/containers/Messages/MessageExample.tsx b/library/src/containers/Messages/MessageExample.tsx index 42a3b5102..6818da632 100644 --- a/library/src/containers/Messages/MessageExample.tsx +++ b/library/src/containers/Messages/MessageExample.tsx @@ -52,13 +52,11 @@ export const Example: React.FunctionComponent = ({ }) => { const config = useConfig(); const [expanded, setExpanded] = useState( - (config && config.expand && config.expand.messageExamples) || false, + config?.expand?.messageExamples ?? false, ); useEffect(() => { - setExpanded( - (config && config.expand && config.expand.messageExamples) || false, - ); + setExpanded(config?.expand?.messageExamples ?? false); // eslint-disable-next-line react-hooks/exhaustive-deps }, [config.expand]); diff --git a/library/src/containers/Operations/Operation.tsx b/library/src/containers/Operations/Operation.tsx index c9c7d99c1..78dfad2c3 100644 --- a/library/src/containers/Operations/Operation.tsx +++ b/library/src/containers/Operations/Operation.tsx @@ -469,7 +469,7 @@ export const OperationReplyAddressInfo: React.FunctionComponent = ({ return <>; } const reply = operation.reply(); - if (!reply || !reply.address) { + if (!reply?.address) { return <>; } const replyAddress = reply.address(); diff --git a/library/src/containers/Servers/Security.tsx b/library/src/containers/Servers/Security.tsx index 3a8e86fb5..2174636e3 100644 --- a/library/src/containers/Servers/Security.tsx +++ b/library/src/containers/Servers/Security.tsx @@ -103,7 +103,7 @@ function collectSecuritySchemas( if (securitySchema.openIdConnectUrl()) { schemas.push( Connect URL @@ -169,16 +169,16 @@ const SecurityItem: React.FunctionComponent = ({ const flows = securitySchema?.flows(); const unwrappedFlows: Record = {}; if (flows?.hasImplicit()) { - unwrappedFlows.implicit = flows.implicit() as OAuthFlowInterface; + unwrappedFlows.implicit = flows.implicit()!; } if (flows?.hasAuthorizationCode()) { - unwrappedFlows.authorizationCode = flows.authorizationCode() as OAuthFlowInterface; + unwrappedFlows.authorizationCode = flows.authorizationCode()!; } if (flows?.hasClientCredentials()) { - unwrappedFlows.clientCredentials = flows.clientCredentials() as OAuthFlowInterface; + unwrappedFlows.clientCredentials = flows.clientCredentials()!; } if (flows?.hasPassword()) { - unwrappedFlows.password = flows.implicit() as OAuthFlowInterface; + unwrappedFlows.password = flows.implicit()!; } const renderedFlows = Object.entries(unwrappedFlows).map( ([flowName, flow]) => { diff --git a/library/src/containers/Sidebar/Sidebar.tsx b/library/src/containers/Sidebar/Sidebar.tsx index d82a763d9..4d42f6a1b 100644 --- a/library/src/containers/Sidebar/Sidebar.tsx +++ b/library/src/containers/Sidebar/Sidebar.tsx @@ -245,38 +245,40 @@ const OperationsList: React.FunctionComponent = () => { const operations = asyncapi.operations().all(); const showOperations = sidebarConfig?.showOperations ?? 'byDefault'; - const processedOperations: Array> = operations.map(operation => { - const operationChannel = operation.channels(); - const operationHrefId = CommonHelpers.getOperationIdentifier({ - operation, - config, - }); - const type = CommonHelpers.getOperationType(operation); + const processedOperations: TagObject[] = operations.map( + operation => { + const operationChannel = operation.channels(); + const operationHrefId = CommonHelpers.getOperationIdentifier({ + operation, + config, + }); + const type = CommonHelpers.getOperationType(operation); - const specV = asyncapi.version(); - const version = specV.localeCompare('2.6.0', undefined, { numeric: true }); - let label: string = ''; - if (version === 0) { - // old version uses different labels for the operations - const operationChannels = operationChannel.all(); - const channelAddress = operationChannels[0]?.address(); - const operationSummary = operation.summary(); - label = operationSummary ? operationSummary : channelAddress ?? ''; - } else { - label = operation.id() || ''; - } - return { - name: `${type}-${operation.id()}`, - tags: operation.tags(), - data: { - label, - type, - operationHrefId, - }, - }; - }); + const specV = asyncapi.version(); + const version = specV.localeCompare('2.6.0', undefined, { + numeric: true, + }); + let label = ''; + if (version === 0) { + // old version uses different labels for the operations + const operationChannels = operationChannel.all(); + const channelAddress = operationChannels[0]?.address(); + const operationSummary = operation.summary(); + label = operationSummary ? operationSummary : channelAddress ?? ''; + } else { + label = operation.id() ?? ''; + } + return { + name: `${type}-${operation.id()}`, + tags: operation.tags(), + data: { + label, + type, + operationHrefId, + }, + }; + }, + ); if (showOperations === 'byDefault') { return ( diff --git a/library/src/containers/Sidebar/__tests__/SideBar.test.tsx b/library/src/containers/Sidebar/__tests__/SideBar.test.tsx index ad0a3e6ba..0228782f6 100644 --- a/library/src/containers/Sidebar/__tests__/SideBar.test.tsx +++ b/library/src/containers/Sidebar/__tests__/SideBar.test.tsx @@ -15,7 +15,7 @@ describe('Sidebar component', () => { const parsedDoc = await Parser.parse(asyncapi, {}); expect(parsedDoc.error).toBeUndefined(); expect(parsedDoc.asyncapi).toBeDefined(); - parsed = parsedDoc.asyncapi as AsyncAPIDocumentInterface; + parsed = parsedDoc.asyncapi!; }); test('should render sidebar with showOperations: byDefault', () => { render( diff --git a/library/src/helpers/__tests__/sidebar.test.ts b/library/src/helpers/__tests__/sidebar.test.ts index 668881a80..ecd504f87 100644 --- a/library/src/helpers/__tests__/sidebar.test.ts +++ b/library/src/helpers/__tests__/sidebar.test.ts @@ -5,7 +5,7 @@ describe('sidebar', () => { describe('.filterObjectsByTags', () => { test('should handle empty objects and find nothing', () => { const tagsToFind = ['test']; - const objects: Array> = []; + const objects: TagObject[] = []; const filteredTags = filterObjectsByTags(tagsToFind, objects); expect(filteredTags.tagged.size).toEqual(0); expect(filteredTags.untagged.length).toEqual(0); @@ -13,7 +13,7 @@ describe('sidebar', () => { test('should handle find one instance', () => { const tagsToFind = ['test']; const tagsToSearch = new TagsV2([new TagV2({ name: 'test' })]); - const objects: Array> = [ + const objects: TagObject[] = [ { data: {}, name: '', tags: tagsToSearch }, ]; const filteredTags = filterObjectsByTags(tagsToFind, objects); @@ -37,7 +37,7 @@ describe('sidebar', () => { name: '', tags: new TagsV2([new TagV2({ name: 'test' })]), }; - const objects: Array> = [obj1, obj2, obj3]; + const objects: TagObject[] = [obj1, obj2, obj3]; const filteredTags = filterObjectsByTags(tagsToFind, objects); expect(filteredTags.tagged.size).toEqual(1); expect(filteredTags.tagged.get('test')?.length).toEqual(2); diff --git a/library/src/helpers/schema.ts b/library/src/helpers/schema.ts index 3590ff6f8..520de16a3 100644 --- a/library/src/helpers/schema.ts +++ b/library/src/helpers/schema.ts @@ -198,14 +198,10 @@ export class SchemaHelpers { } if ( - schema.oneOf() || - schema.anyOf() || - schema.allOf() || - Object.keys(schema.properties() || {}).length > 0 || - schema.items() || - schema.not() || - schema.if() || - schema.then() || + ((schema.oneOf() ?? + schema.anyOf() ?? + schema.allOf() ?? Object.keys(schema.properties() ?? {}).length > 0) || + (schema.items() ?? schema.not() ?? schema.if() ?? schema.then())) ?? schema.else() ) { return true; diff --git a/library/src/helpers/sidebar.ts b/library/src/helpers/sidebar.ts index fe54cc6d2..02485632e 100644 --- a/library/src/helpers/sidebar.ts +++ b/library/src/helpers/sidebar.ts @@ -16,7 +16,7 @@ export interface SortedReturnType { */ export function filterObjectsByTags( tags: string[], - objects: Array>, + objects: TagObject[], ): SortedReturnType { const taggedObjects = new Set(); const tagged = new Map(); diff --git a/library/src/standalone-codebase.ts b/library/src/standalone-codebase.ts index e15b6bb34..39fcd2575 100644 --- a/library/src/standalone-codebase.ts +++ b/library/src/standalone-codebase.ts @@ -25,7 +25,7 @@ export function createRender

    (component: any) { container?: Element | DocumentFragment | null, callback?: () => void, ) => { - container = container || querySelector('asyncapi'); + container = container ?? querySelector('asyncapi'); if (container === null) { return; } @@ -47,7 +47,7 @@ export function createHydrate

    (component: any) { container?: Element | DocumentFragment | null, callback?: () => void, ) => { - container = container || querySelector('asyncapi'); + container = container ?? querySelector('asyncapi'); if (container === null) { return; } diff --git a/library/src/types.ts b/library/src/types.ts index 734191b0e..c1d52ae4c 100644 --- a/library/src/types.ts +++ b/library/src/types.ts @@ -66,7 +66,7 @@ export interface ErrorObject { startColumn: number; startOffset: number; }; - refs?: Array<{ + refs?: { title: string; jsonPointer: string; startLine: number; @@ -75,5 +75,5 @@ export interface ErrorObject { endLine: number; endColumn: number; endOffset: number; - }>; + }[]; } diff --git a/playground/components/FetchSchema.tsx b/playground/components/FetchSchema.tsx index a4b2a1a4e..62aa6871d 100644 --- a/playground/components/FetchSchema.tsx +++ b/playground/components/FetchSchema.tsx @@ -35,8 +35,7 @@ class FetchSchema extends Component { private fetchSchemaFromExternalResources = async () => { try { - // tslint:disable-next-line - new URL(this.state.link); + new URL(this.state.link); } catch (e) { return; } diff --git a/playground/components/Tabs.tsx b/playground/components/Tabs.tsx index 3c23d45dd..fd077ab7f 100644 --- a/playground/components/Tabs.tsx +++ b/playground/components/Tabs.tsx @@ -35,7 +35,7 @@ class Tabs extends Component { }); }; - renderHeader = (children: Array>) => + renderHeader = (children: React.ReactElement[]) => React.Children.map(children, (child, index) => { const c = child; return React.cloneElement(c, { @@ -46,7 +46,7 @@ class Tabs extends Component { }); }); - renderActiveTab = (children: Array>) => { + renderActiveTab = (children: React.ReactElement[]) => { if (children[this.state.activeTabIndex]) { return children[this.state.activeTabIndex].props.children; } diff --git a/playground/utils/defaultConfig.ts b/playground/utils/defaultConfig.ts index 5de5538b4..b95e0bd20 100644 --- a/playground/utils/defaultConfig.ts +++ b/playground/utils/defaultConfig.ts @@ -1,4 +1,4 @@ -export const defaultConfig: string = `{ +export const defaultConfig = `{ "show": { "sidebar": false, "info": true, diff --git a/web-component/src/AsyncApiWebComponent.tsx b/web-component/src/AsyncApiWebComponent.tsx index 83692fae5..ef744ffec 100644 --- a/web-component/src/AsyncApiWebComponent.tsx +++ b/web-component/src/AsyncApiWebComponent.tsx @@ -39,7 +39,7 @@ function retrieveSchemaProp( // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment const schemaRequestOptions = schemaFetchOptions ? JSON.parse(JSON.stringify(schemaFetchOptions)) - : (schema as FetchingSchemaInterface).requestOptions || {}; + : (schema as FetchingSchemaInterface).requestOptions ?? {}; // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment schema = { url: schemaUrl, requestOptions: schemaRequestOptions }; } @@ -79,7 +79,7 @@ export class AsyncApiWebComponent extends React.Component< render() { const props = this.props; - const finalCssImportPath = props.cssImportPath || 'assets/default.min.css'; + const finalCssImportPath = props.cssImportPath ?? 'assets/default.min.css'; const schema = retrieveSchemaProp(this.props); return ( From 37f340b0375b0db0563ce346bdff218b793d718d Mon Sep 17 00:00:00 2001 From: Kenneth Aasan Date: Tue, 23 Apr 2024 15:07:29 +0200 Subject: [PATCH 09/12] chore: migrate from tslint to eslint --- .eslintrc.json | 27 ++- library/e2e/integration/standalone.e2e.ts | 1 + library/src/__tests__/index.test.tsx | 1 + library/src/components/Schema.tsx | 1 + .../components/__tests__/Bindings.test.tsx | 1 + .../src/components/__tests__/Schema.test.tsx | 2 + .../Sidebar/__tests__/SideBar.test.tsx | 9 + library/src/helpers/__tests__/common.test.ts | 2 +- library/src/helpers/__tests__/message.test.ts | 1 + library/src/helpers/__tests__/schema.test.ts | 3 +- .../helpers/__tests__/specification.test.ts | 2 +- library/src/helpers/common.ts | 18 +- library/src/helpers/message.ts | 3 +- library/src/helpers/schema.ts | 13 +- package-lock.json | 170 +++++++++++++++++- package.json | 2 + 16 files changed, 225 insertions(+), 31 deletions(-) diff --git a/.eslintrc.json b/.eslintrc.json index 640ff1578..dabc669f2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -1,7 +1,8 @@ { "env": { "browser": true, - "es6": true + "es6": true, + "jest/globals": true }, "extends": [ "eslint:recommended", @@ -9,8 +10,19 @@ "plugin:@typescript-eslint/stylistic-type-checked", "plugin:react/recommended", "next/core-web-vitals", + "plugin:sonarjs/recommended", + "plugin:jest/recommended", "prettier" ], + "plugins": [ + "eslint-plugin-import", + "eslint-plugin-react", + "@typescript-eslint", + "@typescript-eslint/tslint", + "sonarjs", + "jest" + // "prettier" uncomment when prettier is upgraded to the newest version + ], "settings": { "next": { "rootDir": "playground/" @@ -25,16 +37,15 @@ "./web-component/tsconfig.json" ] }, - "plugins": [ - "eslint-plugin-import", - "eslint-plugin-react", - "@typescript-eslint", - "@typescript-eslint/tslint" - // "prettier" uncomment when prettier is upgraded to the newest version - ], "root": true, "rules": { // "prettier/prettier": "error" uncomment when prettier is upgraded to the newest version + "jest/expect-expect": [ + "error", + { + "assertFunctionNames": ["expect", "cy"] + } + ] }, "ignorePatterns": [ "library/browser", diff --git a/library/e2e/integration/standalone.e2e.ts b/library/e2e/integration/standalone.e2e.ts index bc16d8bf3..2e9e55715 100644 --- a/library/e2e/integration/standalone.e2e.ts +++ b/library/e2e/integration/standalone.e2e.ts @@ -1,3 +1,4 @@ +/* eslint-disable jest/valid-title */ describe('Standalone bundle', () => { testSuite('With parser', 'e2e/sites/standalone.html'); testSuite('With parser for v3', 'e2e/sites/standalone-v3.html'); diff --git a/library/src/__tests__/index.test.tsx b/library/src/__tests__/index.test.tsx index 70a8c0951..de04eaaaa 100644 --- a/library/src/__tests__/index.test.tsx +++ b/library/src/__tests__/index.test.tsx @@ -1,3 +1,4 @@ +/* eslint-disable sonarjs/no-duplicate-string */ /** * @jest-environment jsdom */ diff --git a/library/src/components/Schema.tsx b/library/src/components/Schema.tsx index 0b2971ac5..328d6cd27 100644 --- a/library/src/components/Schema.tsx +++ b/library/src/components/Schema.tsx @@ -33,6 +33,7 @@ export const Schema: React.FunctionComponent = ({ expanded: propExpanded = false, onlyTitle = false, isArray = false, + // eslint-disable-next-line sonarjs/cognitive-complexity }) => { const { reverse, deepExpanded } = useContext(SchemaContext); const [expanded, setExpanded] = useState(propExpanded || isArray); diff --git a/library/src/components/__tests__/Bindings.test.tsx b/library/src/components/__tests__/Bindings.test.tsx index 76a118b2b..a92046367 100644 --- a/library/src/components/__tests__/Bindings.test.tsx +++ b/library/src/components/__tests__/Bindings.test.tsx @@ -1,3 +1,4 @@ +/* eslint-disable sonarjs/no-duplicate-string */ /** * @jest-environment jsdom */ diff --git a/library/src/components/__tests__/Schema.test.tsx b/library/src/components/__tests__/Schema.test.tsx index 0756993bc..9222fbffc 100644 --- a/library/src/components/__tests__/Schema.test.tsx +++ b/library/src/components/__tests__/Schema.test.tsx @@ -9,6 +9,7 @@ import { SchemaV2 as SchemaModel } from '@asyncapi/parser'; import { Schema } from '../Schema'; describe('Schema component', () => { + // eslint-disable-next-line jest/expect-expect test('should work with true schema', () => { const schema = true; const schemaModel = new SchemaModel(schema as never); @@ -16,6 +17,7 @@ describe('Schema component', () => { render(); }); + // eslint-disable-next-line jest/expect-expect test('should work with false schema', () => { const schema = false; const schemaModel = new SchemaModel(schema as never); diff --git a/library/src/containers/Sidebar/__tests__/SideBar.test.tsx b/library/src/containers/Sidebar/__tests__/SideBar.test.tsx index 0228782f6..f98d53b22 100644 --- a/library/src/containers/Sidebar/__tests__/SideBar.test.tsx +++ b/library/src/containers/Sidebar/__tests__/SideBar.test.tsx @@ -13,10 +13,13 @@ describe('Sidebar component', () => { let parsed: AsyncAPIDocumentInterface; beforeAll(async () => { const parsedDoc = await Parser.parse(asyncapi, {}); + // eslint-disable-next-line jest/no-standalone-expect expect(parsedDoc.error).toBeUndefined(); + // eslint-disable-next-line jest/no-standalone-expect expect(parsedDoc.asyncapi).toBeDefined(); parsed = parsedDoc.asyncapi!; }); + // eslint-disable-next-line jest/expect-expect test('should render sidebar with showOperations: byDefault', () => { render( { , ); }); + // eslint-disable-next-line jest/expect-expect test('should render sidebar with showOperations: byOperationsTags', () => { render( { , ); }); + // eslint-disable-next-line jest/expect-expect test('should render sidebar with showOperations: bySpecTags', () => { render( { , ); }); + // eslint-disable-next-line jest/expect-expect test('should render sidebar with showServers: byDefault', () => { render( @@ -59,6 +65,7 @@ describe('Sidebar component', () => { , ); }); + // eslint-disable-next-line jest/expect-expect test('should render sidebar with showServers: byServersTags', () => { render( { , ); }); + // eslint-disable-next-line jest/expect-expect test('should render sidebar with showServers: bySpecTags', () => { render( { , ); }); + // eslint-disable-next-line jest/expect-expect test('should render with showOperations: byDefault, showServers: byDefault', () => { render( { expect(result).toEqual(`test`); }); - test('should return identifier without config argument', () => { + test('should return identifier with config argument', () => { const result = CommonHelpers.getIdentifier('test', { schemaID: 'prefix-id', }); diff --git a/library/src/helpers/__tests__/message.test.ts b/library/src/helpers/__tests__/message.test.ts index e76311287..55f5e960c 100644 --- a/library/src/helpers/__tests__/message.test.ts +++ b/library/src/helpers/__tests__/message.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable sonarjs/no-duplicate-string */ import { MessageHelpers } from '../message'; import { MessageV2 as Message } from '@asyncapi/parser'; diff --git a/library/src/helpers/__tests__/schema.test.ts b/library/src/helpers/__tests__/schema.test.ts index 12da9f904..aaa5b6f7a 100644 --- a/library/src/helpers/__tests__/schema.test.ts +++ b/library/src/helpers/__tests__/schema.test.ts @@ -1,3 +1,4 @@ +/* eslint-disable sonarjs/no-duplicate-string */ import { ParameterObject } from '@asyncapi/parser/esm/spec-types/v2'; import { SchemaHelpers, SchemaCustomTypes } from '../schema'; import { @@ -32,7 +33,7 @@ describe('SchemaHelpers', () => { expect(result).toEqual(SchemaCustomTypes.ANY); }); - test('should handle schema with non JSON Schema keywords ', () => { + test('should handle schema with non JSON Schema keywords', () => { const schema = new Schema({ foo: 'bar', 'x-ext': 'someExt' }); const result = SchemaHelpers.toSchemaType(schema); expect(result).toEqual(SchemaCustomTypes.ANY); diff --git a/library/src/helpers/__tests__/specification.test.ts b/library/src/helpers/__tests__/specification.test.ts index 48c4532c2..69d654568 100644 --- a/library/src/helpers/__tests__/specification.test.ts +++ b/library/src/helpers/__tests__/specification.test.ts @@ -20,7 +20,7 @@ describe('SpecificationHelpers', () => { expect(result instanceof AsyncAPIDocument).toEqual(true); }); - test('should return parsed specification when is passed parsed stringified spec (by string) ', () => { + test('should return parsed specification when is passed parsed stringified spec (by string)', () => { const doc = { asyncapi: '2.0.0', info: { title: 'test', version: '0.0.0' }, diff --git a/library/src/helpers/common.ts b/library/src/helpers/common.ts index bb4d2eafd..3a44bde57 100644 --- a/library/src/helpers/common.ts +++ b/library/src/helpers/common.ts @@ -26,10 +26,8 @@ export class CommonHelpers { return PayloadType.SEND; } } - if (operation.isReceive()) { - if (operation.reply() !== undefined) { - return PayloadType.REPLY; - } + if (operation.isReceive() && operation.reply() !== undefined) { + return PayloadType.REPLY; } return PayloadType.RECEIVE; } @@ -53,13 +51,11 @@ export class CommonHelpers { ); } } - if (operation.isReceive()) { - if (operation.reply() !== undefined) { - return CommonHelpers.getIdentifier( - `operation-${PayloadType.REPLY}-${operation.id()}`, - config, - ); - } + if (operation.isReceive() && operation.reply() !== undefined) { + return CommonHelpers.getIdentifier( + `operation-${PayloadType.REPLY}-${operation.id()}`, + config, + ); } return CommonHelpers.getIdentifier( `operation-${PayloadType.RECEIVE}-${operation.id()}`, diff --git a/library/src/helpers/message.ts b/library/src/helpers/message.ts index d16277d5b..8e78deded 100644 --- a/library/src/helpers/message.ts +++ b/library/src/helpers/message.ts @@ -61,7 +61,8 @@ export class MessageHelpers { // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment return payload.examples()?.map(example => ({ example })); } - return; + + return undefined; } static getHeadersExamples( diff --git a/library/src/helpers/schema.ts b/library/src/helpers/schema.ts index 520de16a3..176c72a3d 100644 --- a/library/src/helpers/schema.ts +++ b/library/src/helpers/schema.ts @@ -200,7 +200,8 @@ export class SchemaHelpers { if ( ((schema.oneOf() ?? schema.anyOf() ?? - schema.allOf() ?? Object.keys(schema.properties() ?? {}).length > 0) || + schema.allOf() ?? + Object.keys(schema.properties() ?? {}).length > 0) || (schema.items() ?? schema.not() ?? schema.if() ?? schema.then())) ?? schema.else() ) { @@ -208,11 +209,8 @@ export class SchemaHelpers { } const customExtensions = this.getCustomExtensions(schema); - if (customExtensions && Object.keys(customExtensions).length) { - return true; - } - return false; + return !!(customExtensions && Object.keys(customExtensions).length); } static serverVariablesToSchema( @@ -410,9 +408,10 @@ export class SchemaHelpers { if (schema.allOf()) { return 'allOf'; } - return; + return undefined; } + // eslint-disable-next-line sonarjs/cognitive-complexity private static inferType(schema: SchemaInterface): string[] | string { let types = schema.type(); @@ -451,6 +450,7 @@ export class SchemaHelpers { return SchemaCustomTypes.ANY; } + // eslint-disable-next-line sonarjs/cognitive-complexity private static humanizeNumberRangeConstraint( min: number | undefined, exclusiveMin: number | undefined, @@ -561,6 +561,7 @@ export class SchemaHelpers { // eslint-disable-next-line @typescript-eslint/no-explicit-any private static isJSONSchema(value: any): boolean { + // eslint-disable-next-line sonarjs/prefer-single-boolean-return if ( value && typeof value === 'object' && diff --git a/package-lock.json b/package-lock.json index e8ea23163..29a80798d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,9 @@ "eslint-config-next": "^14.2.2", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jest": "^28.2.0", "eslint-plugin-react": "^7.34.1", + "eslint-plugin-sonarjs": "^0.25.1", "lerna": "^8.1.2", "markdown-toc": "^1.2.0", "markdownlint-cli": "^0.17.0", @@ -11023,6 +11025,155 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-jest": { + "version": "28.2.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jest/-/eslint-plugin-jest-28.2.0.tgz", + "integrity": "sha512-yRDti/a+f+SMSmNTiT9/M/MzXGkitl8CfzUxnpoQcTyfq8gUrXMriVcWU36W1X6BZSUoyUCJrDAWWUA2N4hE5g==", + "dev": true, + "dependencies": { + "@typescript-eslint/utils": "^6.0.0" + }, + "engines": { + "node": "^16.10.0 || ^18.12.0 || >=20.0.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^6.0.0 || ^7.0.0", + "eslint": "^7.0.0 || ^8.0.0 || ^9.0.0", + "jest": "*" + }, + "peerDependenciesMeta": { + "@typescript-eslint/eslint-plugin": { + "optional": true + }, + "jest": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/scope-manager": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-6.21.0.tgz", + "integrity": "sha512-OwLUIWZJry80O99zvqXVEioyniJMa+d2GrqpUTqi5/v5D5rOrppJVBPa0yKCblcigC0/aYAzxxqQ1B+DS2RYsg==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-6.21.0.tgz", + "integrity": "sha512-1kFmZ1rOm5epu9NZEZm1kckCDGj5UJEf7P1kliH4LKu/RkwpsfqqGmY2OOcUs18lSlQBKLDYBOGxRVtrMN5lpg==", + "dev": true, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/typescript-estree": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-6.21.0.tgz", + "integrity": "sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/visitor-keys": "6.21.0", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "minimatch": "9.0.3", + "semver": "^7.5.4", + "ts-api-utils": "^1.0.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/utils": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-6.21.0.tgz", + "integrity": "sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.4.0", + "@types/json-schema": "^7.0.12", + "@types/semver": "^7.5.0", + "@typescript-eslint/scope-manager": "6.21.0", + "@typescript-eslint/types": "6.21.0", + "@typescript-eslint/typescript-estree": "6.21.0", + "semver": "^7.5.4" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } + }, + "node_modules/eslint-plugin-jest/node_modules/@typescript-eslint/visitor-keys": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-6.21.0.tgz", + "integrity": "sha512-JJtkDduxLi9bivAB+cYOVMtbkqdPOhZ+ZI5LC47MIRrDV4Yn2o+ZnW10Nkmr28xRpSpdJ6Sm42Hjf2+REYXm0A==", + "dev": true, + "dependencies": { + "@typescript-eslint/types": "6.21.0", + "eslint-visitor-keys": "^3.4.1" + }, + "engines": { + "node": "^16.0.0 || >=18.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + } + }, + "node_modules/eslint-plugin-jest/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dev": true, + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/eslint-plugin-jest/node_modules/minimatch": { + "version": "9.0.3", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.3.tgz", + "integrity": "sha512-RHiac9mvaRw0x3AYRgDC1CxAP7HTcNrrECeA8YYJeWnpo+2Q5CegtZjaotWTWxDG3UeGA1coE05iH1mPjT/2mg==", + "dev": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=16 || 14 >=14.17" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, "node_modules/eslint-plugin-jsx-a11y": { "version": "6.8.0", "resolved": "https://registry.npmjs.org/eslint-plugin-jsx-a11y/-/eslint-plugin-jsx-a11y-6.8.0.tgz", @@ -11144,6 +11295,18 @@ "semver": "bin/semver.js" } }, + "node_modules/eslint-plugin-sonarjs": { + "version": "0.25.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-sonarjs/-/eslint-plugin-sonarjs-0.25.1.tgz", + "integrity": "sha512-5IOKvj/GMBNqjxBdItfotfRHo7w48496GOu1hxdeXuD0mB1JBlDCViiLHETDTfA8pDAVSBimBEQoetRXYceQEw==", + "dev": true, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "eslint": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0" + } + }, "node_modules/eslint-scope": { "version": "7.2.2", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.2.tgz", @@ -12462,7 +12625,8 @@ "resolved": "https://registry.npmjs.org/growly/-/growly-1.3.0.tgz", "integrity": "sha512-+xGQY0YyAWCnqy7Cd++hc2JqMYzlm0dG30Jd0beaA64sROr8C4nt8Yc9V5Ro3avlSUDTN0ulqP/VBKi1/lLygw==", "dev": true, - "optional": true + "optional": true, + "peer": true }, "node_modules/gulp-header": { "version": "1.8.12", @@ -17648,6 +17812,7 @@ "integrity": "sha512-oJP/9NAdd9+x2Q+rfphB2RJCHjod70RcRLjosiPMMu5gjIfwVnOUGq2nbTjTUbmy0DJ/tFIVT30+Qe3nzl4TJg==", "dev": true, "optional": true, + "peer": true, "dependencies": { "growly": "^1.3.0", "is-wsl": "^2.2.0", @@ -23067,7 +23232,8 @@ "resolved": "https://registry.npmjs.org/shellwords/-/shellwords-0.1.1.tgz", "integrity": "sha512-vFwSUfQvqybiICwZY5+DAWIPLKsWO31Q91JSKl3UYv+K5c2QRPzn0qzec6QPu1Qc9eHYItiP3NdJqNVqetYAww==", "dev": true, - "optional": true + "optional": true, + "peer": true }, "node_modules/side-channel": { "version": "1.0.6", diff --git a/package.json b/package.json index 2b7c2c39b..c90cc6930 100644 --- a/package.json +++ b/package.json @@ -52,7 +52,9 @@ "eslint-config-next": "^14.2.2", "eslint-config-prettier": "^9.1.0", "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jest": "^28.2.0", "eslint-plugin-react": "^7.34.1", + "eslint-plugin-sonarjs": "^0.25.1", "lerna": "^8.1.2", "markdown-toc": "^1.2.0", "markdownlint-cli": "^0.17.0", From 149cee13f2ed2bd57db0ce73381391397f9359ce Mon Sep 17 00:00:00 2001 From: Kenneth Aasan Date: Tue, 23 Apr 2024 15:20:21 +0200 Subject: [PATCH 10/12] chore: migrate from tslint to eslint --- library/src/__tests__/index.test.tsx | 3 ++- library/src/components/__tests__/Bindings.test.tsx | 3 ++- playground/next.config.mjs | 3 +++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/library/src/__tests__/index.test.tsx b/library/src/__tests__/index.test.tsx index de04eaaaa..3bb01e8b3 100644 --- a/library/src/__tests__/index.test.tsx +++ b/library/src/__tests__/index.test.tsx @@ -1,8 +1,9 @@ -/* eslint-disable sonarjs/no-duplicate-string */ /** * @jest-environment jsdom */ +/* eslint-disable sonarjs/no-duplicate-string */ + import React from 'react'; import { render, waitFor } from '@testing-library/react'; import AsyncApiComponent from '..'; diff --git a/library/src/components/__tests__/Bindings.test.tsx b/library/src/components/__tests__/Bindings.test.tsx index a92046367..b7321dee3 100644 --- a/library/src/components/__tests__/Bindings.test.tsx +++ b/library/src/components/__tests__/Bindings.test.tsx @@ -1,8 +1,9 @@ -/* eslint-disable sonarjs/no-duplicate-string */ /** * @jest-environment jsdom */ +/* eslint-disable sonarjs/no-duplicate-string */ + import React from 'react'; import { render, screen } from '@testing-library/react'; import { diff --git a/playground/next.config.mjs b/playground/next.config.mjs index c3b1720c5..274ead23c 100644 --- a/playground/next.config.mjs +++ b/playground/next.config.mjs @@ -25,6 +25,9 @@ const nextConfig = { }, assetPrefix, basePath, + eslint: { + ignoreDuringBuilds: true, + }, }; export default nextConfig; From b939d546aa7d61f1fcf738c3ea6b2b72cba77552 Mon Sep 17 00:00:00 2001 From: Kenneth Aasan Date: Tue, 23 Apr 2024 15:29:34 +0200 Subject: [PATCH 11/12] chore: migrate from tslint to eslint --- library/src/containers/Sidebar/Sidebar.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/library/src/containers/Sidebar/Sidebar.tsx b/library/src/containers/Sidebar/Sidebar.tsx index 4d42f6a1b..9a60c3ae0 100644 --- a/library/src/containers/Sidebar/Sidebar.tsx +++ b/library/src/containers/Sidebar/Sidebar.tsx @@ -262,9 +262,9 @@ const OperationsList: React.FunctionComponent = () => { if (version === 0) { // old version uses different labels for the operations const operationChannels = operationChannel.all(); - const channelAddress = operationChannels[0]?.address(); + const channelAddress = operationChannels[0]?.address() ?? ''; const operationSummary = operation.summary(); - label = operationSummary ? operationSummary : channelAddress ?? ''; + label = operationSummary ? operationSummary : channelAddress; } else { label = operation.id() ?? ''; } From baff31ef53796ff5750a60f2668db1e4443a3892 Mon Sep 17 00:00:00 2001 From: Kenneth Aasan Date: Tue, 23 Apr 2024 15:33:25 +0200 Subject: [PATCH 12/12] chore: migrate from tslint to eslint --- library/src/containers/Sidebar/Sidebar.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/src/containers/Sidebar/Sidebar.tsx b/library/src/containers/Sidebar/Sidebar.tsx index 9a60c3ae0..e65eee678 100644 --- a/library/src/containers/Sidebar/Sidebar.tsx +++ b/library/src/containers/Sidebar/Sidebar.tsx @@ -264,7 +264,7 @@ const OperationsList: React.FunctionComponent = () => { const operationChannels = operationChannel.all(); const channelAddress = operationChannels[0]?.address() ?? ''; const operationSummary = operation.summary(); - label = operationSummary ? operationSummary : channelAddress; + label = operationSummary ?? channelAddress; } else { label = operation.id() ?? ''; }