From a75e6a9e1a76bc8ff9db4ae3f0dc9ca149224e04 Mon Sep 17 00:00:00 2001 From: jimmy-guzman Date: Wed, 10 Apr 2024 18:59:06 -0500 Subject: [PATCH] =?UTF-8?q?feat:=20=E2=9C=A8=20add=20auto=20detection=20to?= =?UTF-8?q?=20enable=20configurations?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 + eslint.config.mjs | 15 +- package.json | 12 +- pnpm-lock.yaml | 387 ++++++++++++++++++++++++++-------------- src/configs/commonjs.ts | 15 ++ src/configs/react.ts | 11 +- src/configs/testing.ts | 26 ++- src/constants.ts | 2 + src/factory.spec.ts | 128 +++++++++++++ src/factory.ts | 30 ++-- src/has-dep.ts | 33 ++++ src/types.ts | 5 + tsconfig.json | 3 +- 13 files changed, 496 insertions(+), 179 deletions(-) create mode 100644 src/configs/commonjs.ts create mode 100644 src/has-dep.ts diff --git a/README.md b/README.md index 7896ede..d2e14ad 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,14 @@ export default jimmyDotCodes({ }); ``` +Or you can enable auto detection to enable rules based on a project's dependencies + +```js +import jimmyDotCodes from "@jimmy.codes/eslint-config"; + +export default jimmyDotCodes({ autoDetect: true }); +``` + #### TypeScript You can also change the project location which can be helpful for monorepos: diff --git a/eslint.config.mjs b/eslint.config.mjs index 9196c75..731749f 100644 --- a/eslint.config.mjs +++ b/eslint.config.mjs @@ -9,17 +9,4 @@ const jiti = JITI(import.meta.url); // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access const jimmyDotCodes = jiti("./src").default; -export default jimmyDotCodes({ - typescript: true, - react: { - utilities: ["@tanstack/query"], - }, - testing: { - utilities: ["testing-library"], - }, - overrides: [ - { - ignores: ["fixtures"], - }, - ], -}); +export default jimmyDotCodes({ autoDetect: true }); diff --git a/package.json b/package.json index 28cd022..27ce2b2 100644 --- a/package.json +++ b/package.json @@ -63,6 +63,7 @@ "eslint-plugin-simple-import-sort": "^12.0.0", "eslint-plugin-testing-library": "^6.2.0", "globals": "^15.0.0", + "local-pkg": "0.5.0", "typescript-eslint": "^7.6.0" }, "devDependencies": { @@ -74,21 +75,26 @@ "@semantic-release/git": "10.0.1", "@semantic-release/npm": "12.0.0", "@semantic-release/release-notes-generator": "13.0.0", + "@tanstack/react-query": "5.29.0", + "@testing-library/react": "15.0.0", "@types/eslint": "8.56.7", "@types/eslint__js": "8.42.3", "@types/node": "20.12.7", + "@types/react": "18.2.75", "@vitest/coverage-v8": "1.4.0", "clean-pkg-json": "1.2.0", "commitlint": "19.2.1", "eslint": "8.57.0", - "gitzy": "5.2.0", + "gitzy": "5.3.0", "is-ci": "3.0.1", "jiti": "1.21.0", - "lefthook": "1.6.9", + "lefthook": "1.6.10", "pkgroll": "2.0.2", "prettier": "3.2.5", + "react": "18.2.0", + "react-dom": "18.2.0", "semantic-release": "23.0.8", - "typescript": "5.4.4", + "typescript": "5.4.5", "vitest": "1.4.0" }, "peerDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index dc4ada3..d0207a2 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,10 +10,10 @@ dependencies: version: 8.57.0 '@tanstack/eslint-plugin-query': specifier: ^5.28.11 - version: 5.28.11(eslint@8.57.0)(typescript@5.4.4) + version: 5.28.11(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/utils': specifier: ^7.6.0 - version: 7.6.0(eslint@8.57.0)(typescript@5.4.4) + version: 7.6.0(eslint@8.57.0)(typescript@5.4.5) eslint-config-prettier: specifier: ^9.1.0 version: 9.1.0(eslint@8.57.0) @@ -22,10 +22,10 @@ dependencies: version: 3.6.1(eslint@8.57.0) eslint-plugin-import-x: specifier: 0.5.0 - version: 0.5.0(eslint@8.57.0)(typescript@5.4.4) + version: 0.5.0(eslint@8.57.0)(typescript@5.4.5) eslint-plugin-jest: specifier: ^28.2.0 - version: 28.2.0(eslint@8.57.0)(typescript@5.4.4) + version: 28.2.0(eslint@8.57.0)(typescript@5.4.5) eslint-plugin-jest-dom: specifier: ^5.2.0 version: 5.2.0(eslint@8.57.0) @@ -49,13 +49,16 @@ dependencies: version: 12.0.0(eslint@8.57.0) eslint-plugin-testing-library: specifier: ^6.2.0 - version: 6.2.0(eslint@8.57.0)(typescript@5.4.4) + version: 6.2.0(eslint@8.57.0)(typescript@5.4.5) globals: specifier: ^15.0.0 version: 15.0.0 + local-pkg: + specifier: 0.5.0 + version: 0.5.0 typescript-eslint: specifier: ^7.6.0 - version: 7.6.0(eslint@8.57.0)(typescript@5.4.4) + version: 7.6.0(eslint@8.57.0)(typescript@5.4.5) devDependencies: '@commitlint/config-conventional': @@ -82,6 +85,12 @@ devDependencies: '@semantic-release/release-notes-generator': specifier: 13.0.0 version: 13.0.0(semantic-release@23.0.8) + '@tanstack/react-query': + specifier: 5.29.0 + version: 5.29.0(react@18.2.0) + '@testing-library/react': + specifier: 15.0.0 + version: 15.0.0(react-dom@18.2.0)(react@18.2.0) '@types/eslint': specifier: 8.56.7 version: 8.56.7 @@ -91,6 +100,9 @@ devDependencies: '@types/node': specifier: 20.12.7 version: 20.12.7 + '@types/react': + specifier: 18.2.75 + version: 18.2.75 '@vitest/coverage-v8': specifier: 1.4.0 version: 1.4.0(vitest@1.4.0) @@ -99,13 +111,13 @@ devDependencies: version: 1.2.0 commitlint: specifier: 19.2.1 - version: 19.2.1(@types/node@20.12.7)(typescript@5.4.4) + version: 19.2.1(@types/node@20.12.7)(typescript@5.4.5) eslint: specifier: 8.57.0 version: 8.57.0 gitzy: - specifier: 5.2.0 - version: 5.2.0 + specifier: 5.3.0 + version: 5.3.0 is-ci: specifier: 3.0.1 version: 3.0.1 @@ -113,20 +125,26 @@ devDependencies: specifier: 1.21.0 version: 1.21.0 lefthook: - specifier: 1.6.9 - version: 1.6.9 + specifier: 1.6.10 + version: 1.6.10 pkgroll: specifier: 2.0.2 - version: 2.0.2(typescript@5.4.4) + version: 2.0.2(typescript@5.4.5) prettier: specifier: 3.2.5 version: 3.2.5 + react: + specifier: 18.2.0 + version: 18.2.0 + react-dom: + specifier: 18.2.0 + version: 18.2.0(react@18.2.0) semantic-release: specifier: 23.0.8 - version: 23.0.8(typescript@5.4.4) + version: 23.0.8(typescript@5.4.5) typescript: - specifier: 5.4.4 - version: 5.4.4 + specifier: 5.4.5 + version: 5.4.5 vitest: specifier: 1.4.0 version: 1.4.0(@types/node@20.12.7) @@ -186,7 +204,6 @@ packages: engines: {node: '>=6.9.0'} dependencies: regenerator-runtime: 0.14.1 - dev: false /@babel/types@7.24.0: resolution: {integrity: sha512-+j7a5c253RfKh8iABBhywc8NSfP5LURe7Uh4qpsh6jc+aLJguvmIUBdjSdEMQv2bENrCR5MfRdjGo7vzS/ob7w==} @@ -208,14 +225,14 @@ packages: dev: true optional: true - /@commitlint/cli@19.2.1(@types/node@20.12.7)(typescript@5.4.4): + /@commitlint/cli@19.2.1(@types/node@20.12.7)(typescript@5.4.5): resolution: {integrity: sha512-cbkYUJsLqRomccNxvoJTyv5yn0bSy05BBizVyIcLACkRbVUqYorC351Diw/XFSWC/GtpwiwT2eOvQgFZa374bg==} engines: {node: '>=v18'} hasBin: true dependencies: '@commitlint/format': 19.0.3 '@commitlint/lint': 19.1.0 - '@commitlint/load': 19.2.0(@types/node@20.12.7)(typescript@5.4.4) + '@commitlint/load': 19.2.0(@types/node@20.12.7)(typescript@5.4.5) '@commitlint/read': 19.2.1 '@commitlint/types': 19.0.3 execa: 8.0.1 @@ -284,7 +301,7 @@ packages: '@commitlint/types': 19.0.3 dev: true - /@commitlint/load@19.2.0(@types/node@20.12.7)(typescript@5.4.4): + /@commitlint/load@19.2.0(@types/node@20.12.7)(typescript@5.4.5): resolution: {integrity: sha512-XvxxLJTKqZojCxaBQ7u92qQLFMMZc4+p9qrIq/9kJDy8DOrEa7P1yx7Tjdc2u2JxIalqT4KOGraVgCE7eCYJyQ==} engines: {node: '>=v18'} dependencies: @@ -293,8 +310,8 @@ packages: '@commitlint/resolve-extends': 19.1.0 '@commitlint/types': 19.0.3 chalk: 5.3.0 - cosmiconfig: 9.0.0(typescript@5.4.4) - cosmiconfig-typescript-loader: 5.0.0(@types/node@20.12.7)(cosmiconfig@9.0.0)(typescript@5.4.4) + cosmiconfig: 9.0.0(typescript@5.4.5) + cosmiconfig-typescript-loader: 5.0.0(@types/node@20.12.7)(cosmiconfig@9.0.0)(typescript@5.4.5) lodash.isplainobject: 4.0.6 lodash.merge: 4.6.2 lodash.uniq: 4.5.0 @@ -1092,7 +1109,7 @@ packages: aggregate-error: 3.1.0 fs-extra: 11.2.0 lodash: 4.17.21 - semantic-release: 23.0.8(typescript@5.4.4) + semantic-release: 23.0.8(typescript@5.4.5) dev: true /@semantic-release/commit-analyzer@12.0.0(semantic-release@23.0.8): @@ -1108,7 +1125,7 @@ packages: import-from-esm: 1.3.3 lodash-es: 4.17.21 micromatch: 4.0.5 - semantic-release: 23.0.8(typescript@5.4.4) + semantic-release: 23.0.8(typescript@5.4.5) transitivePeerDependencies: - supports-color dev: true @@ -1137,7 +1154,7 @@ packages: lodash: 4.17.21 micromatch: 4.0.5 p-reduce: 2.1.0 - semantic-release: 23.0.8(typescript@5.4.4) + semantic-release: 23.0.8(typescript@5.4.5) transitivePeerDependencies: - supports-color dev: true @@ -1163,7 +1180,7 @@ packages: lodash-es: 4.17.21 mime: 4.0.1 p-filter: 4.1.0 - semantic-release: 23.0.8(typescript@5.4.4) + semantic-release: 23.0.8(typescript@5.4.5) url-join: 5.0.0 transitivePeerDependencies: - supports-color @@ -1186,7 +1203,7 @@ packages: rc: 1.2.8 read-pkg: 9.0.1 registry-auth-token: 5.0.2 - semantic-release: 23.0.8(typescript@5.4.4) + semantic-release: 23.0.8(typescript@5.4.5) semver: 7.6.0 tempy: 3.1.0 dev: true @@ -1207,7 +1224,7 @@ packages: into-stream: 7.0.0 lodash-es: 4.17.21 read-pkg-up: 11.0.0 - semantic-release: 23.0.8(typescript@5.4.4) + semantic-release: 23.0.8(typescript@5.4.5) transitivePeerDependencies: - supports-color dev: true @@ -1226,18 +1243,63 @@ packages: engines: {node: '>=18'} dev: true - /@tanstack/eslint-plugin-query@5.28.11(eslint@8.57.0)(typescript@5.4.4): + /@tanstack/eslint-plugin-query@5.28.11(eslint@8.57.0)(typescript@5.4.5): resolution: {integrity: sha512-bODGLeG4WCGmHVKCh3bH1KLfq7xdi1jsRjTESV6ifCw1mZ0m2fBMxAjK42KjbhJwcvNdTlYHI+YY/aZWBk4Niw==} peerDependencies: eslint: ^8.0.0 dependencies: - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.4) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.5) eslint: 8.57.0 transitivePeerDependencies: - supports-color - typescript dev: false + /@tanstack/query-core@5.29.0: + resolution: {integrity: sha512-WgPTRs58hm9CMzEr5jpISe8HXa3qKQ8CxewdYZeVnA54JrPY9B1CZiwsCoLpLkf0dGRZq+LcX5OiJb0bEsOFww==} + dev: true + + /@tanstack/react-query@5.29.0(react@18.2.0): + resolution: {integrity: sha512-yxlhHB73jaBla6h5B6zPaGmQjokkzAhMHN4veotkPNiQ3Ac/mCxgABRZPsJJrgCTvhpcncBZcDBFxaR2B37vug==} + peerDependencies: + react: ^18.0.0 + dependencies: + '@tanstack/query-core': 5.29.0 + react: 18.2.0 + dev: true + + /@testing-library/dom@10.0.0: + resolution: {integrity: sha512-PmJPnogldqoVFf+EwbHvbBJ98MmqASV8kLrBYgsDNxQcFMeIS7JFL48sfyXvuMtgmWO/wMhh25odr+8VhDmn4g==} + engines: {node: '>=18'} + dependencies: + '@babel/code-frame': 7.24.2 + '@babel/runtime': 7.24.4 + '@types/aria-query': 5.0.4 + aria-query: 5.3.0 + chalk: 4.1.2 + dom-accessibility-api: 0.5.16 + lz-string: 1.5.0 + pretty-format: 27.5.1 + dev: true + + /@testing-library/react@15.0.0(react-dom@18.2.0)(react@18.2.0): + resolution: {integrity: sha512-Nb2Sq8MoSvGVdOGGppRqXeafLtvXCOwiOQtcbqCfkpVNZZNUqIjeSOwrfJ59zBfmZbAn8PitnWEzUKD1YwMrCg==} + engines: {node: '>=18'} + peerDependencies: + react: ^18.0.0 + react-dom: ^18.0.0 + dependencies: + '@babel/runtime': 7.24.4 + '@testing-library/dom': 10.0.0 + '@types/react-dom': 18.2.24 + react: 18.2.0 + react-dom: 18.2.0(react@18.2.0) + dev: true + + /@types/aria-query@5.0.4: + resolution: {integrity: sha512-rfT93uj5s0PRL7EzccGMs3brplhcrghnDoV26NqKhCAS1hVo+WdNsPvE/yb6ilfr5hi2MEk6d5EWJTKdxg8jVw==} + dev: true + /@types/conventional-commits-parser@5.0.0: resolution: {integrity: sha512-loB369iXNmAZglwWATL+WRe+CRMmmBPtpolYzIebFaX4YA3x+BEfLqhUAV9WanycKI3TG1IMr5bMJDajDKLlUQ==} dependencies: @@ -1278,6 +1340,23 @@ packages: resolution: {integrity: sha512-37i+OaWTh9qeK4LSHPsyRC7NahnGotNuZvjLSgcPzblpHB3rrCJxAOgI5gCdKm7coonsaX1Of0ILiTcnZjbfxA==} dev: true + /@types/prop-types@15.7.12: + resolution: {integrity: sha512-5zvhXYtRNRluoE/jAp4GVsSduVUzNWKkOZrCDBWYtE7biZywwdC2AcEzg+cSMLFRfVgeAFqpfNabiPjxFddV1Q==} + dev: true + + /@types/react-dom@18.2.24: + resolution: {integrity: sha512-cN6upcKd8zkGy4HU9F1+/s98Hrp6D4MOcippK4PoE8OZRngohHZpbJn1GsaDLz87MqvHNoT13nHvNqM9ocRHZg==} + dependencies: + '@types/react': 18.2.75 + dev: true + + /@types/react@18.2.75: + resolution: {integrity: sha512-+DNnF7yc5y0bHkBTiLKqXFe+L4B3nvOphiMY3tuA5X10esmjqk7smyBZzbGTy2vsiy/Bnzj8yFIBL8xhRacoOg==} + dependencies: + '@types/prop-types': 15.7.12 + csstype: 3.1.3 + dev: true + /@types/resolve@1.20.2: resolution: {integrity: sha512-60BCwRFOZCQhDncwQdxxeOEEkbc5dIMccYLwbxsS4TUNeVECQ/pBJ0j09mrHOl/JJvpRPGwO9SvE4nR2Nb/a4Q==} dev: true @@ -1286,7 +1365,7 @@ packages: resolution: {integrity: sha512-I8EUhyrgfLrcTkzV3TSsGyl1tSuPrEDzr0yd5m90UgNxQkyDXULk3b6MlQqTCpZpNtWe1K0hzclnZkTcLBe2UQ==} dev: false - /@typescript-eslint/eslint-plugin@7.6.0(@typescript-eslint/parser@7.6.0)(eslint@8.57.0)(typescript@5.4.4): + /@typescript-eslint/eslint-plugin@7.6.0(@typescript-eslint/parser@7.6.0)(eslint@8.57.0)(typescript@5.4.5): resolution: {integrity: sha512-gKmTNwZnblUdnTIJu3e9kmeRRzV2j1a/LUO27KNNAnIC5zjy1aSvXSRp4rVNlmAoHlQ7HzX42NbKpcSr4jF80A==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -1298,10 +1377,10 @@ packages: optional: true dependencies: '@eslint-community/regexpp': 4.10.0 - '@typescript-eslint/parser': 7.6.0(eslint@8.57.0)(typescript@5.4.4) + '@typescript-eslint/parser': 7.6.0(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/scope-manager': 7.6.0 - '@typescript-eslint/type-utils': 7.6.0(eslint@8.57.0)(typescript@5.4.4) - '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.4) + '@typescript-eslint/type-utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) '@typescript-eslint/visitor-keys': 7.6.0 debug: 4.3.4 eslint: 8.57.0 @@ -1309,13 +1388,13 @@ packages: ignore: 5.3.1 natural-compare: 1.4.0 semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.4.4) - typescript: 5.4.4 + ts-api-utils: 1.3.0(typescript@5.4.5) + typescript: 5.4.5 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.4): + /@typescript-eslint/parser@7.6.0(eslint@8.57.0)(typescript@5.4.5): resolution: {integrity: sha512-usPMPHcwX3ZoPWnBnhhorc14NJw9J4HpSXQX4urF2TPKG0au0XhJoZyX62fmvdHONUkmyUe74Hzm1//XA+BoYg==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -1327,11 +1406,11 @@ packages: dependencies: '@typescript-eslint/scope-manager': 7.6.0 '@typescript-eslint/types': 7.6.0 - '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.4) + '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) '@typescript-eslint/visitor-keys': 7.6.0 debug: 4.3.4 eslint: 8.57.0 - typescript: 5.4.4 + typescript: 5.4.5 transitivePeerDependencies: - supports-color dev: false @@ -1360,7 +1439,7 @@ packages: '@typescript-eslint/visitor-keys': 7.6.0 dev: false - /@typescript-eslint/type-utils@7.6.0(eslint@8.57.0)(typescript@5.4.4): + /@typescript-eslint/type-utils@7.6.0(eslint@8.57.0)(typescript@5.4.5): resolution: {integrity: sha512-NxAfqAPNLG6LTmy7uZgpK8KcuiS2NZD/HlThPXQRGwz6u7MDBWRVliEEl1Gj6U7++kVJTpehkhZzCJLMK66Scw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -1370,12 +1449,12 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.4) - '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.4) + '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) + '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) debug: 4.3.4 eslint: 8.57.0 - ts-api-utils: 1.3.0(typescript@5.4.4) - typescript: 5.4.4 + ts-api-utils: 1.3.0(typescript@5.4.5) + typescript: 5.4.5 transitivePeerDependencies: - supports-color dev: false @@ -1395,7 +1474,7 @@ packages: engines: {node: ^18.18.0 || >=20.0.0} dev: false - /@typescript-eslint/typescript-estree@5.62.0(typescript@5.4.4): + /@typescript-eslint/typescript-estree@5.62.0(typescript@5.4.5): resolution: {integrity: sha512-CmcQ6uY7b9y694lKdRB8FEel7JbU/40iSAPomu++SjLMntB+2Leay2LO6i8VnJk58MtE9/nQSFIH6jpyRWyYzA==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1410,13 +1489,13 @@ packages: globby: 11.1.0 is-glob: 4.0.3 semver: 7.6.0 - tsutils: 3.21.0(typescript@5.4.4) - typescript: 5.4.4 + tsutils: 3.21.0(typescript@5.4.5) + typescript: 5.4.5 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/typescript-estree@6.21.0(typescript@5.4.4): + /@typescript-eslint/typescript-estree@6.21.0(typescript@5.4.5): resolution: {integrity: sha512-6npJTkZcO+y2/kr+z0hc4HwNfrrP4kNYh57ek7yCNlrBjWQ1Y0OS7jiZTkgumrvkX5HkEKXFZkkdFNkaW2wmUQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1432,13 +1511,13 @@ packages: is-glob: 4.0.3 minimatch: 9.0.3 semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.4.4) - typescript: 5.4.4 + ts-api-utils: 1.3.0(typescript@5.4.5) + typescript: 5.4.5 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/typescript-estree@7.6.0(typescript@5.4.4): + /@typescript-eslint/typescript-estree@7.6.0(typescript@5.4.5): resolution: {integrity: sha512-+7Y/GP9VuYibecrCQWSKgl3GvUM5cILRttpWtnAu8GNL9j11e4tbuGZmZjJ8ejnKYyBRb2ddGQ3rEFCq3QjMJw==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -1454,13 +1533,13 @@ packages: is-glob: 4.0.3 minimatch: 9.0.4 semver: 7.6.0 - ts-api-utils: 1.3.0(typescript@5.4.4) - typescript: 5.4.4 + ts-api-utils: 1.3.0(typescript@5.4.5) + typescript: 5.4.5 transitivePeerDependencies: - supports-color dev: false - /@typescript-eslint/utils@5.62.0(eslint@8.57.0)(typescript@5.4.4): + /@typescript-eslint/utils@5.62.0(eslint@8.57.0)(typescript@5.4.5): resolution: {integrity: sha512-n8oxjeb5aIbPFEtmQxQYOLI0i9n5ySBEY/ZEHHZqKQSFnxio1rv6dthascc9dLuwrL0RC5mPCxB7vnAVGAYWAQ==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: @@ -1471,7 +1550,7 @@ packages: '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 5.62.0 '@typescript-eslint/types': 5.62.0 - '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.4.4) + '@typescript-eslint/typescript-estree': 5.62.0(typescript@5.4.5) eslint: 8.57.0 eslint-scope: 5.1.1 semver: 7.6.0 @@ -1480,7 +1559,7 @@ packages: - typescript dev: false - /@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.4.4): + /@typescript-eslint/utils@6.21.0(eslint@8.57.0)(typescript@5.4.5): resolution: {integrity: sha512-NfWVaC8HP9T8cbKQxHcsJBY5YE1O33+jpMwN45qzWWaPDZgLIbo12toGMWnmhvCpd3sIxkpDw3Wv1B3dYrbDQQ==} engines: {node: ^16.0.0 || >=18.0.0} peerDependencies: @@ -1491,7 +1570,7 @@ packages: '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 6.21.0 '@typescript-eslint/types': 6.21.0 - '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.4) + '@typescript-eslint/typescript-estree': 6.21.0(typescript@5.4.5) eslint: 8.57.0 semver: 7.6.0 transitivePeerDependencies: @@ -1499,7 +1578,7 @@ packages: - typescript dev: false - /@typescript-eslint/utils@7.6.0(eslint@8.57.0)(typescript@5.4.4): + /@typescript-eslint/utils@7.6.0(eslint@8.57.0)(typescript@5.4.5): resolution: {integrity: sha512-x54gaSsRRI+Nwz59TXpCsr6harB98qjXYzsRxGqvA5Ue3kQH+FxS7FYU81g/omn22ML2pZJkisy6Q+ElK8pBCA==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -1510,7 +1589,7 @@ packages: '@types/semver': 7.5.8 '@typescript-eslint/scope-manager': 7.6.0 '@typescript-eslint/types': 7.6.0 - '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.4) + '@typescript-eslint/typescript-estree': 7.6.0(typescript@5.4.5) eslint: 8.57.0 semver: 7.6.0 transitivePeerDependencies: @@ -1730,7 +1809,6 @@ packages: resolution: {integrity: sha512-b0P0sZPKtyu8HkeRAfCq0IfURZK+SuwMjY1UXGBU27wpAiTwQAIlq56IbIO+ytk/JjS1fMR14ee5WBBfKi5J6A==} dependencies: dequal: 2.0.3 - dev: false /array-buffer-byte-length@1.0.1: resolution: {integrity: sha512-ahC5W1xgou+KTXix4sAO8Ki12Q+jf4i0+tmk3sC+zgcynshkHxzpXdImBehiUYKKKDwvfFiJl1tZt6ewscS1Mg==} @@ -2068,12 +2146,12 @@ packages: engines: {node: '>=16'} dev: true - /commitlint@19.2.1(@types/node@20.12.7)(typescript@5.4.4): + /commitlint@19.2.1(@types/node@20.12.7)(typescript@5.4.5): resolution: {integrity: sha512-avW7E38gbdbUK7NIi/7gfkaKwlw8tjXy2HlmEdBS9A9+HeoHV1o/i96Sc9qjX0rKyPzKEsLi6cP3Wt3xM0kjEA==} engines: {node: '>=v18'} hasBin: true dependencies: - '@commitlint/cli': 19.2.1(@types/node@20.12.7)(typescript@5.4.4) + '@commitlint/cli': 19.2.1(@types/node@20.12.7)(typescript@5.4.5) '@commitlint/types': 19.0.3 transitivePeerDependencies: - '@types/node' @@ -2166,7 +2244,7 @@ packages: resolution: {integrity: sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==} dev: true - /cosmiconfig-typescript-loader@5.0.0(@types/node@20.12.7)(cosmiconfig@9.0.0)(typescript@5.4.4): + /cosmiconfig-typescript-loader@5.0.0(@types/node@20.12.7)(cosmiconfig@9.0.0)(typescript@5.4.5): resolution: {integrity: sha512-+8cK7jRAReYkMwMiG+bxhcNKiHJDM6bR9FD/nGBXOWdMLuYawjF5cGrtLilJ+LGd3ZjCXnJjR5DkfWPoIVlqJA==} engines: {node: '>=v16'} peerDependencies: @@ -2175,12 +2253,12 @@ packages: typescript: '>=4' dependencies: '@types/node': 20.12.7 - cosmiconfig: 9.0.0(typescript@5.4.4) + cosmiconfig: 9.0.0(typescript@5.4.5) jiti: 1.21.0 - typescript: 5.4.4 + typescript: 5.4.5 dev: true - /cosmiconfig@9.0.0(typescript@5.4.4): + /cosmiconfig@9.0.0(typescript@5.4.5): resolution: {integrity: sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==} engines: {node: '>=14'} peerDependencies: @@ -2193,7 +2271,7 @@ packages: import-fresh: 3.3.0 js-yaml: 4.1.0 parse-json: 5.2.0 - typescript: 5.4.4 + typescript: 5.4.5 dev: true /cross-spawn@7.0.3: @@ -2220,6 +2298,10 @@ packages: type-fest: 1.4.0 dev: true + /csstype@3.1.3: + resolution: {integrity: sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==} + dev: true + /damerau-levenshtein@1.0.8: resolution: {integrity: sha512-sdQSFB7+llfUcQHUQO3+B8ERRj0Oa4w9POWMI/puGtuf7gFywGmkaLCElnudfTiKZV+NvHqL0ifzdrI8Ro7ESA==} dev: false @@ -2336,7 +2418,6 @@ packages: /dequal@2.0.3: resolution: {integrity: sha512-0je+qPKHEMohvfRTCEo3CrPG6cAzAYgmzKyxRiYSSDkS6eGJdyVJm7WaYA5ECaAD9wLB2T4EEeymA5aFVcYXCA==} engines: {node: '>=6'} - dev: false /destr@2.0.3: resolution: {integrity: sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==} @@ -2366,6 +2447,10 @@ packages: dependencies: esutils: 2.0.3 + /dom-accessibility-api@0.5.16: + resolution: {integrity: sha512-X7BJ2yElsnOJ30pZF4uIIDfBEVgF4XEBxL9Bxhy6dnrm5hkzqmsWHGTiHqRiITNhMyFLyAiWndIJP7Z1NTteDg==} + dev: true + /dot-prop@5.3.0: resolution: {integrity: sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==} engines: {node: '>=8'} @@ -2657,20 +2742,20 @@ packages: - supports-color dev: false - /eslint-plugin-import-x@0.5.0(eslint@8.57.0)(typescript@5.4.4): + /eslint-plugin-import-x@0.5.0(eslint@8.57.0)(typescript@5.4.5): resolution: {integrity: sha512-C7R8Z4IzxmsoOPMtSzwuOBW5FH6iRlxHR6iTks+MzVlrk3r3TUxokkWTx3ypdj9nGOEP+CG/5e6ebZzHbxgbbQ==} engines: {node: '>=16'} peerDependencies: eslint: ^8.56.0 || ^9.0.0-0 dependencies: - '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.4) + '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) debug: 4.3.4 doctrine: 3.0.0 eslint: 8.57.0 eslint-import-resolver-node: 0.3.9 get-tsconfig: 4.7.3 is-glob: 4.0.3 - minimatch: 9.0.3 + minimatch: 9.0.4 semver: 7.6.0 transitivePeerDependencies: - supports-color @@ -2692,7 +2777,7 @@ packages: requireindex: 1.2.0 dev: false - /eslint-plugin-jest@28.2.0(eslint@8.57.0)(typescript@5.4.4): + /eslint-plugin-jest@28.2.0(eslint@8.57.0)(typescript@5.4.5): resolution: {integrity: sha512-yRDti/a+f+SMSmNTiT9/M/MzXGkitl8CfzUxnpoQcTyfq8gUrXMriVcWU36W1X6BZSUoyUCJrDAWWUA2N4hE5g==} engines: {node: ^16.10.0 || ^18.12.0 || >=20.0.0} peerDependencies: @@ -2705,7 +2790,7 @@ packages: jest: optional: true dependencies: - '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.4) + '@typescript-eslint/utils': 6.21.0(eslint@8.57.0)(typescript@5.4.5) eslint: 8.57.0 transitivePeerDependencies: - supports-color @@ -2798,13 +2883,13 @@ packages: eslint: 8.57.0 dev: false - /eslint-plugin-testing-library@6.2.0(eslint@8.57.0)(typescript@5.4.4): + /eslint-plugin-testing-library@6.2.0(eslint@8.57.0)(typescript@5.4.5): resolution: {integrity: sha512-+LCYJU81WF2yQ+Xu4A135CgK8IszcFcyMF4sWkbiu6Oj+Nel0TrkZq/HvDw0/1WuO3dhDQsZA/OpEMGd0NfcUw==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0, npm: '>=6'} peerDependencies: eslint: ^7.5.0 || ^8.0.0 dependencies: - '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.4.4) + '@typescript-eslint/utils': 5.62.0(eslint@8.57.0)(typescript@5.4.5) eslint: 8.57.0 transitivePeerDependencies: - supports-color @@ -3171,14 +3256,14 @@ packages: split2: 4.2.0 dev: true - /gitzy@5.2.0: - resolution: {integrity: sha512-Wd9ktB/Uh+Uc+gMHmrL2seKA9e2CnetD2eg/B/meYkeZbpn1qElzbRn/oEcTlxaD5/aK4pVe0OvQ3926M8t2xQ==} + /gitzy@5.3.0: + resolution: {integrity: sha512-8jaurTHGGiiUaScuL7bNZm83sJf97qb6tgq6L8UO3cBOqwozaxbR0DU1hWlEAYvMSqfknXnaYGurwRvEMy7mNA==} engines: {node: '>= 18'} hasBin: true dependencies: commander: 11.1.0 enquirer: 2.4.1 - lilconfig: 2.1.0 + lilconfig: 3.1.1 yaml: 2.4.1 dev: true @@ -3826,7 +3911,6 @@ packages: /jsonc-parser@3.2.1: resolution: {integrity: sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==} - dev: true /jsonfile@6.1.0: resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} @@ -3867,83 +3951,83 @@ packages: language-subtag-registry: 0.3.22 dev: false - /lefthook-darwin-arm64@1.6.9: - resolution: {integrity: sha512-7ooCgGgPANCYmiiRSoSzwS09TYQ62P506FVx2GCiN20pWK9Q5r0oQv9v35MH6BJKbB/gVHY+tUcF9FSGxZAk+w==} + /lefthook-darwin-arm64@1.6.10: + resolution: {integrity: sha512-Hh11OkoKG7FEOByS1dcgNV7ETq45VmwBbw0VPTiBznyfOG4k+pi0fIdc1qbmbxvYqNE0r420QR/Q3bimaa4Kxg==} cpu: [arm64] os: [darwin] requiresBuild: true dev: true optional: true - /lefthook-darwin-x64@1.6.9: - resolution: {integrity: sha512-id3B3+TjwZ1/vKKFeqaXHi5jWPPx/8sNzHe5HRijzDrn0+WrMWwQdS9Ws7Dy66ZFKtbwEPiBwMjXMBIE75WvxQ==} + /lefthook-darwin-x64@1.6.10: + resolution: {integrity: sha512-FiOB0t5OBcQ8OnG/LSdfUYj736SJdlLjWuOZ4wTlJ7EUrHditieap6VNAxwMmFVyQN0X2ZwKWytwY35y+Hflhw==} cpu: [x64] os: [darwin] requiresBuild: true dev: true optional: true - /lefthook-freebsd-arm64@1.6.9: - resolution: {integrity: sha512-W/Kix6qun5vUKPop0AetiMP5gsm2TJ5TKvVO633n1k0b9n5NtVMUM2XSrttxk3hjEe6AFc+vvWR2nQkM6cLV1g==} + /lefthook-freebsd-arm64@1.6.10: + resolution: {integrity: sha512-IxGgS3RrNwk3Kr83o5SQhGxqppQi7fu2t//nsp6ocgnJeStrTtXZJOrel2VohzrFxpzQdJVXBGgUGLXtY8t8qw==} cpu: [arm64] os: [freebsd] requiresBuild: true dev: true optional: true - /lefthook-freebsd-x64@1.6.9: - resolution: {integrity: sha512-uobjPgtSi3KqWUhLCqZSsaYnsDQg7rGiOzQnPHAyw1BIvBwaxcENHhYO7Mjbc17JnPOynUhJmT7uUJuU2fNWng==} + /lefthook-freebsd-x64@1.6.10: + resolution: {integrity: sha512-sFSe+dGLa4iBblWAhAGTP9moarcbFtFAH6aaCeyqSX51O6p9VPdGjqNtcE8aGbGAk4lO6v1ScRjk5ogMSinJwQ==} cpu: [x64] os: [freebsd] requiresBuild: true dev: true optional: true - /lefthook-linux-arm64@1.6.9: - resolution: {integrity: sha512-KXmJwchr2v4pcFXL3iP0D7XEEBjGKbgKRWywN9K2+R4bEsMHNNxgAEq9ZgbzkViTspqm9+1U9fpsNgwwSabgFg==} + /lefthook-linux-arm64@1.6.10: + resolution: {integrity: sha512-fXnKiNdRIW+FRvc1keVrvWX5EqIhVFfPjcy+PbsKdxiWRXgjtidi6LPmQ8eosH0DC9PxZ0mpdCMf40FHEZLbQA==} cpu: [arm64] os: [linux] requiresBuild: true dev: true optional: true - /lefthook-linux-x64@1.6.9: - resolution: {integrity: sha512-ZxvCzXEEmIrrxyyZasOLoiEcxil7ArS6NA1+aTOm6q7UK0btVbwxzOcvF5WkJ57kD963JGpNm45uuSuErNN3RA==} + /lefthook-linux-x64@1.6.10: + resolution: {integrity: sha512-bm6l2GOFnmYreZxmHb47QeOiFAItttOOxvCEX1okIRD7JbUC+lGC9evW5GJv/ltjZBoTDYEtQAUa+BpHTGuY2A==} cpu: [x64] os: [linux] requiresBuild: true dev: true optional: true - /lefthook-windows-arm64@1.6.9: - resolution: {integrity: sha512-69sCcalUSA+rJC4YHvrDYYmB++Gx+P5kZixXENGDDSLGeFhBNr1cVGPTWLoBbxxdVT7jZCsfN5QVoVC0dvmJjQ==} + /lefthook-windows-arm64@1.6.10: + resolution: {integrity: sha512-pFxT8KbOMzGxj6cz4glHYwQSNC7XCuy9RDqIO0AxPlpATsCpapkF4ngDxBT1iFv2VhdeweMa7RXUDsMAGQA4Qw==} cpu: [arm64] os: [win32] requiresBuild: true dev: true optional: true - /lefthook-windows-x64@1.6.9: - resolution: {integrity: sha512-y5WWsN3NEZ2EjItKs6AOw10roGX6BY+/UoD3ADMvycYRv7+wDKtTjuws+UMGJ96aagUOClzDszf+fDRyypMzlA==} + /lefthook-windows-x64@1.6.10: + resolution: {integrity: sha512-fcDnUSTv95AdLvm0NIrn3jBWXuRq8SlbDDjkkB5OHLiSmjz4eOr6wyD7xceDp33zZgZmWFzHebJngxxcIaUuHw==} cpu: [x64] os: [win32] requiresBuild: true dev: true optional: true - /lefthook@1.6.9: - resolution: {integrity: sha512-bpr1jWW/IwP43iv9TAz6WuZV2KMmRA2HN6UFRIzsTvHB8LDwSCu5HrkSTfP9cx70XQdYbzFbJbR16KLmnxNw4g==} + /lefthook@1.6.10: + resolution: {integrity: sha512-HeVjsDCrHLe9htQHbLuQJu2YdLK6Tl5bh36fOpmXqckEXTI0BDR0Y5JYc7G5Inj4YXQsc51a9dUDZMeniSnSag==} hasBin: true requiresBuild: true optionalDependencies: - lefthook-darwin-arm64: 1.6.9 - lefthook-darwin-x64: 1.6.9 - lefthook-freebsd-arm64: 1.6.9 - lefthook-freebsd-x64: 1.6.9 - lefthook-linux-arm64: 1.6.9 - lefthook-linux-x64: 1.6.9 - lefthook-windows-arm64: 1.6.9 - lefthook-windows-x64: 1.6.9 + lefthook-darwin-arm64: 1.6.10 + lefthook-darwin-x64: 1.6.10 + lefthook-freebsd-arm64: 1.6.10 + lefthook-freebsd-x64: 1.6.10 + lefthook-linux-arm64: 1.6.10 + lefthook-linux-x64: 1.6.10 + lefthook-windows-arm64: 1.6.10 + lefthook-windows-x64: 1.6.10 dev: true /levn@0.4.1: @@ -3953,9 +4037,9 @@ packages: prelude-ls: 1.2.1 type-check: 0.4.0 - /lilconfig@2.1.0: - resolution: {integrity: sha512-utWOt/GHzuUxnLKxB6dk81RoOeoNeHgbrXiuGk4yyF5qlRz+iIVWu56E2fqGHFrXz0QNUhLB/8nKqvRH66JKGQ==} - engines: {node: '>=10'} + /lilconfig@3.1.1: + resolution: {integrity: sha512-O18pf7nyvHTckunPWCV1XUNXU1piu01y2b7ATJ0ppkUkk8ocqVWBrYjJBCwHDjD/ZWcfyrA0P4gKhzWGi5EINQ==} + engines: {node: '>=14'} dev: true /lines-and-columns@1.2.4: @@ -3983,7 +4067,6 @@ packages: dependencies: mlly: 1.6.1 pkg-types: 1.0.3 - dev: true /locate-path@2.0.0: resolution: {integrity: sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==} @@ -4070,7 +4153,6 @@ packages: hasBin: true dependencies: js-tokens: 4.0.0 - dev: false /loupe@2.3.7: resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} @@ -4089,6 +4171,11 @@ packages: dependencies: yallist: 4.0.0 + /lz-string@1.5.0: + resolution: {integrity: sha512-h5bgJWpxJNswbU7qCrV0tIKQCaS3blPDrqKWx+QxzuzL1zGUzij9XCWLrSLsJPu5t+eWA/ycetzYAO5IOMcWAQ==} + hasBin: true + dev: true + /magic-string@0.30.8: resolution: {integrity: sha512-ISQTe55T2ao7XtlAStud6qwYPZjE4GK1S/BeVPus4jrq6JuOnQ00YKQC581RWhR122W7msZV263KzVeLoqidyQ==} engines: {node: '>=12'} @@ -4210,7 +4297,6 @@ packages: pathe: 1.1.2 pkg-types: 1.0.3 ufo: 1.5.3 - dev: true /mrmime@2.0.0: resolution: {integrity: sha512-eu38+hdgojoyq63s+yTpN4XMBdt5l8HhMhc4VKLO9KM5caLIBvUm4thi7fFaxyTmCKeNnXZ5pAlBwCUnhA09uw==} @@ -4585,7 +4671,7 @@ packages: dependencies: '@babel/code-frame': 7.24.2 index-to-position: 0.1.2 - type-fest: 4.14.0 + type-fest: 4.15.0 dev: true /parse5-htmlparser2-tree-adapter@6.0.1: @@ -4643,7 +4729,6 @@ packages: /pathe@1.1.2: resolution: {integrity: sha512-whLdWMYL2TwI08hn8/ZqAbrVemu0LNaNNJZX73O6qaIdCTfXutsLhMkjdENX0qhsQ9uIimo4/aQOmXkoon2nDQ==} - dev: true /pathval@1.1.1: resolution: {integrity: sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==} @@ -4676,9 +4761,8 @@ packages: jsonc-parser: 3.2.1 mlly: 1.6.1 pathe: 1.1.2 - dev: true - /pkgroll@2.0.2(typescript@5.4.4): + /pkgroll@2.0.2(typescript@5.4.5): resolution: {integrity: sha512-gRQ293zs67H2nN/CKwdLnlxCKpE5qi5rJwVvDUqep8qOLs57PlTl3MAXmLlFztwI2Iv6mP9k5BSlhBjzFJmerg==} engines: {node: '>=18'} hasBin: true @@ -4698,7 +4782,7 @@ packages: esbuild: 0.20.2 magic-string: 0.30.8 rollup: 4.13.2 - typescript: 5.4.4 + typescript: 5.4.5 dev: true /possible-typed-array-names@1.0.0: @@ -4779,6 +4863,15 @@ packages: hasBin: true dev: true + /pretty-format@27.5.1: + resolution: {integrity: sha512-Qb1gy5OrP5+zDf2Bvnzdl3jsTf1qXVMazbvCoKhtKqVs4/YK4ozX4gKQJJVyNe+cajNPn0KoC0MC3FUmaHWEmQ==} + engines: {node: ^10.13.0 || ^12.13.0 || ^14.15.0 || >=15.0.0} + dependencies: + ansi-regex: 5.0.1 + ansi-styles: 5.2.0 + react-is: 17.0.2 + dev: true + /pretty-format@29.7.0: resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} @@ -4825,14 +4918,35 @@ packages: strip-json-comments: 2.0.1 dev: true + /react-dom@18.2.0(react@18.2.0): + resolution: {integrity: sha512-6IMTriUmvsjHUjNtEDudZfuDQUoWXVxKHhlEGSk81n4YFS+r/Kl99wXiwlVXtPBtJenozv2P+hxDsw9eA7Xo6g==} + peerDependencies: + react: ^18.2.0 + dependencies: + loose-envify: 1.4.0 + react: 18.2.0 + scheduler: 0.23.0 + dev: true + /react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} dev: false + /react-is@17.0.2: + resolution: {integrity: sha512-w2GsyukL62IJnlaff/nRegPQR94C/XXamvMWmSHRJ4y7Ts/4ocGRmTHvOs8PSE6pB3dWOrD/nueuU5sduBsQ4w==} + dev: true + /react-is@18.2.0: resolution: {integrity: sha512-xWGDIW6x921xtzPkhiULtthJHoJvBbF3q26fzloPCK0hsvxtPVelvftw3zjbHWSkR2km9Z+4uxbDDK/6Zw9B8w==} dev: true + /react@18.2.0: + resolution: {integrity: sha512-/3IjMdb2L9QbBdWiW5e3P2/npwMBaU9mHCSCUzNln0ZCYbcfTsGbTJrU/kGemdH2IWmB2ioZ+zkxtmq6g09fGQ==} + engines: {node: '>=0.10.0'} + dependencies: + loose-envify: 1.4.0 + dev: true + /read-package-up@11.0.0: resolution: {integrity: sha512-MbgfoNPANMdb4oRBNg5eqLbB2t2r+o5Ua1pNt8BqGp4I0FJZhuVSOj3PaBPni4azWuSzEdNn2evevzVmEk1ohQ==} engines: {node: '>=18'} @@ -4849,7 +4963,7 @@ packages: dependencies: find-up-simple: 1.0.0 read-pkg: 9.0.1 - type-fest: 4.14.0 + type-fest: 4.15.0 dev: true /read-pkg@9.0.1: @@ -4859,7 +4973,7 @@ packages: '@types/normalize-package-data': 2.4.4 normalize-package-data: 6.0.0 parse-json: 8.1.0 - type-fest: 4.14.0 + type-fest: 4.15.0 unicorn-magic: 0.1.0 dev: true @@ -4897,7 +5011,6 @@ packages: /regenerator-runtime@0.14.1: resolution: {integrity: sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==} - dev: false /regexp.prototype.flags@1.5.2: resolution: {integrity: sha512-NcDiDkTLuPR+++OCKB0nWafEmhg/Da8aUPLPMQbK+bxKKCm1/S5he+AqYa4PlMCVBalb4/yxIRub6qkEx5yJbw==} @@ -5026,7 +5139,13 @@ packages: es-errors: 1.3.0 is-regex: 1.1.4 - /semantic-release@23.0.8(typescript@5.4.4): + /scheduler@0.23.0: + resolution: {integrity: sha512-CtuThmgHNg7zIZWAXi3AsyIzA3n4xx7aNyjwC2VJldO2LMVDhFK+63xGqq6CsJH4rTAt6/M+N4GhZiDYPx9eUw==} + dependencies: + loose-envify: 1.4.0 + dev: true + + /semantic-release@23.0.8(typescript@5.4.5): resolution: {integrity: sha512-yZkuWcTTfh5h/DrR4Q4QvJSARJdb6wjwn/sN0qKMYEkvwaVFek8YWfrgtL8oWaRdl0fLte0Y1wWMzLbwoaII1g==} engines: {node: '>=20.8.1'} hasBin: true @@ -5037,7 +5156,7 @@ packages: '@semantic-release/npm': 12.0.0(semantic-release@23.0.8) '@semantic-release/release-notes-generator': 13.0.0(semantic-release@23.0.8) aggregate-error: 5.0.0 - cosmiconfig: 9.0.0(typescript@5.4.4) + cosmiconfig: 9.0.0(typescript@5.4.5) debug: 4.3.4 env-ci: 11.0.0 execa: 8.0.1 @@ -5462,27 +5581,27 @@ packages: which-typed-array: 1.1.15 dev: true - /ts-api-utils@1.3.0(typescript@5.4.4): + /ts-api-utils@1.3.0(typescript@5.4.5): resolution: {integrity: sha512-UQMIo7pb8WRomKR1/+MFVLTroIvDVtMX3K6OUir8ynLyzB8Jeriont2bTAtmNPa1ekAgN7YPDyf6V+ygrdU+eQ==} engines: {node: '>=16'} peerDependencies: typescript: '>=4.2.0' dependencies: - typescript: 5.4.4 + typescript: 5.4.5 dev: false /tslib@1.14.1: resolution: {integrity: sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==} dev: false - /tsutils@3.21.0(typescript@5.4.4): + /tsutils@3.21.0(typescript@5.4.5): resolution: {integrity: sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==} 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' dependencies: tslib: 1.14.1 - typescript: 5.4.4 + typescript: 5.4.5 dev: false /type-check@0.4.0: @@ -5510,11 +5629,6 @@ packages: engines: {node: '>=12.20'} dev: true - /type-fest@4.14.0: - resolution: {integrity: sha512-on5/Cw89wwqGZQu+yWO0gGMGu8VNxsaW9SB2HE8yJjllEk7IDTwnSN1dUVldYILhYPN5HzD7WAaw2cc/jBfn0Q==} - engines: {node: '>=16'} - dev: true - /type-fest@4.15.0: resolution: {integrity: sha512-tB9lu0pQpX5KJq54g+oHOLumOx+pMep4RaM6liXh2PKmVRFF+/vAtUP0ZaJ0kOySfVNjF6doBWPHhBhISKdlIA==} engines: {node: '>=16'} @@ -5572,7 +5686,7 @@ packages: typed-array-byte-offset: 1.0.2 dev: true - /typescript-eslint@7.6.0(eslint@8.57.0)(typescript@5.4.4): + /typescript-eslint@7.6.0(eslint@8.57.0)(typescript@5.4.5): resolution: {integrity: sha512-LY6vH6F1l5jpGqRtU+uK4+mOecIb4Cd4kaz1hAiJrgnNiHUA8wiw8BkJyYS+MRLM69F1QuSKwtGlQqnGl1Rc6w==} engines: {node: ^18.18.0 || >=20.0.0} peerDependencies: @@ -5582,23 +5696,22 @@ packages: typescript: optional: true dependencies: - '@typescript-eslint/eslint-plugin': 7.6.0(@typescript-eslint/parser@7.6.0)(eslint@8.57.0)(typescript@5.4.4) - '@typescript-eslint/parser': 7.6.0(eslint@8.57.0)(typescript@5.4.4) - '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.4) + '@typescript-eslint/eslint-plugin': 7.6.0(@typescript-eslint/parser@7.6.0)(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/parser': 7.6.0(eslint@8.57.0)(typescript@5.4.5) + '@typescript-eslint/utils': 7.6.0(eslint@8.57.0)(typescript@5.4.5) eslint: 8.57.0 - typescript: 5.4.4 + typescript: 5.4.5 transitivePeerDependencies: - supports-color dev: false - /typescript@5.4.4: - resolution: {integrity: sha512-dGE2Vv8cpVvw28v8HCPqyb08EzbBURxDpuhJvTrusShUfGnhHBafDsLdS1EhhxyL6BJQE+2cT3dDPAv+MQ6oLw==} + /typescript@5.4.5: + resolution: {integrity: sha512-vcI4UpRgg81oIRUFwR0WSIHKt11nJ7SAVlYNIu+QpqeyXP+gpQJy/Z4+F0aGxSE4MqwjyXvW/TzgkLAx2AGHwQ==} engines: {node: '>=14.17'} hasBin: true /ufo@1.5.3: resolution: {integrity: sha512-Y7HYmWaFwPUmkoQCUIAYpKqkOf+SbVj/2fJJZ4RJMCfZp0rTGwRbzQD+HghfnhKOjL9E01okqz+ncJskGYfBNw==} - dev: true /uglify-js@3.17.4: resolution: {integrity: sha512-T9q82TJI9e/C1TAxYvfb16xO120tMVFZrGA3f9/P4424DNu6ypK103y0GPFVa17yotwSyZW5iYXgjYHkGrJW/g==} diff --git a/src/configs/commonjs.ts b/src/configs/commonjs.ts new file mode 100644 index 0000000..1fdc16a --- /dev/null +++ b/src/configs/commonjs.ts @@ -0,0 +1,15 @@ +import globals from "globals"; + +import { GLOB_CJS } from "../constants"; + +export const commonjsConfig = () => { + return [ + { + name: "jimmy.codes/commonjs", + files: [GLOB_CJS], + languageOptions: { + globals: globals.commonjs, + }, + }, + ]; +}; diff --git a/src/configs/react.ts b/src/configs/react.ts index 426d793..789652f 100644 --- a/src/configs/react.ts +++ b/src/configs/react.ts @@ -6,10 +6,17 @@ import * as reactRefresh from "eslint-plugin-react-refresh"; import globals from "globals"; import { GLOB_JSX, GLOB_TSX } from "../constants"; +import { hasReactQuery } from "../has-dep"; import { reactRules } from "../rules/react"; import { type ReactOptions } from "../types"; -const reactConfig = ({ utilities = [] }: ReactOptions = {}) => { +const reactConfig = ( + { utilities = [] }: ReactOptions = {}, + autoDetect = false, +) => { + const includeReactQuery = + utilities.includes("@tanstack/query") || (autoDetect && hasReactQuery()); + return [ { name: "jimmy.codes/react", @@ -40,7 +47,7 @@ const reactConfig = ({ utilities = [] }: ReactOptions = {}) => { }, rules: reactRules, }, - ...(utilities.includes("@tanstack/query") + ...(includeReactQuery ? [ { name: "jimmy.codes/react/query", diff --git a/src/configs/testing.ts b/src/configs/testing.ts index 5c645a7..a17be38 100644 --- a/src/configs/testing.ts +++ b/src/configs/testing.ts @@ -1,21 +1,28 @@ import jest from "eslint-plugin-jest"; import { ALLOWED_VITEST_FUNCS, GLOB_E2E, GLOB_TESTS } from "../constants"; +import { hasJest, hasTestingLibrary, hasVitest } from "../has-dep"; import { jestRules } from "../rules/jest"; import { type TestingOptions } from "../types"; import testingLibraryConfig from "./testing-library"; -const testingConfig = ({ - framework = "vitest", - utilities, -}: TestingOptions = {}) => { +const testingConfig = ( + { framework = "vitest", utilities }: TestingOptions = {}, + autoDetect = false, +) => { + const isVitest = autoDetect ? hasVitest() : framework === "vitest"; + const isJest = framework === "jest" || (autoDetect && hasJest()); + const includeTestingLibrary = + !!utilities?.includes("testing-library") || + (autoDetect && hasTestingLibrary()); + return [ { name: "jimmy.codes/testing", files: GLOB_TESTS, ...jest.configs["flat/recommended"], }, - ...(framework === "vitest" + ...(isVitest ? [ { name: "jimmy.codes/testing/vitest", @@ -33,14 +40,17 @@ const testingConfig = ({ }, }, ] - : [ + : []), + ...(isJest + ? [ { name: "jimmy.codes/testing/jest", files: GLOB_TESTS, ...jest.configs["flat/recommended"], rules: jestRules, }, - ]), + ] + : []), { name: "jimmy.codes/testing/disabled", files: GLOB_E2E, @@ -50,7 +60,7 @@ const testingConfig = ({ "jest/require-hook": "off", }, }, - ...(utilities?.includes("testing-library") ? testingLibraryConfig() : []), + ...(includeTestingLibrary ? testingLibraryConfig() : []), ]; }; diff --git a/src/constants.ts b/src/constants.ts index 4b49071..3d5d797 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -61,3 +61,5 @@ export const GLOB_E2E = [ export const GLOB_CJS = "**/*.cjs"; export const ALLOWED_VITEST_FUNCS = ["vi.mock"]; + +export const TESTING_LIBRARY_FAMILY = ["@testing-library/react"]; diff --git a/src/factory.spec.ts b/src/factory.spec.ts index e2f7ad6..77eff56 100644 --- a/src/factory.spec.ts +++ b/src/factory.spec.ts @@ -1,5 +1,9 @@ +import { isPackageExists } from "local-pkg"; + import { jimmyDotCodes } from "./factory"; +vi.mock("local-pkg"); + describe("jimmyDotCodes", () => { it("should create default configuration", () => { expect(jimmyDotCodes()).toMatchSnapshot(); @@ -98,4 +102,128 @@ describe("jimmyDotCodes", () => { ]), ); }); + + describe("autoDetect", () => { + it("should include typescript when auto detection is enabled", () => { + vi.mocked(isPackageExists).mockImplementation((name) => { + return name === "typescript"; + }); + + expect(jimmyDotCodes({ autoDetect: true })).toStrictEqual( + expect.arrayContaining([ + expect.objectContaining({ name: "jimmy.codes/typescript" }), + expect.not.objectContaining({ name: "jimmy.codes/testing" }), + expect.not.objectContaining({ name: "jimmy.codes/testing/vitest" }), + expect.not.objectContaining({ name: "jimmy.codes/testing/jest" }), + expect.not.objectContaining({ name: "jimmy.codes/react" }), + expect.not.objectContaining({ name: "jimmy.codes/react/query" }), + expect.not.objectContaining({ + name: "jimmy.codes/testing/testing-library", + }), + ]), + ); + }); + + it("should include react when auto detection is enabled", () => { + vi.mocked(isPackageExists).mockImplementation((name) => { + return name === "react"; + }); + + expect(jimmyDotCodes({ autoDetect: true })).toStrictEqual( + expect.arrayContaining([ + expect.not.objectContaining({ name: "jimmy.codes/typescript" }), + expect.not.objectContaining({ name: "jimmy.codes/testing" }), + expect.not.objectContaining({ name: "jimmy.codes/testing/vitest" }), + expect.not.objectContaining({ name: "jimmy.codes/testing/jest" }), + expect.objectContaining({ name: "jimmy.codes/react" }), + expect.not.objectContaining({ name: "jimmy.codes/react/query" }), + expect.not.objectContaining({ + name: "jimmy.codes/testing/testing-library", + }), + ]), + ); + }); + + it("should include react-query when auto detection is enabled", () => { + vi.mocked(isPackageExists).mockImplementation((name) => { + // eslint-disable-next-line jest/no-conditional-in-test + return name === "react" || name === "@tanstack/react-query"; + }); + + expect(jimmyDotCodes({ autoDetect: true })).toStrictEqual( + expect.arrayContaining([ + expect.not.objectContaining({ name: "jimmy.codes/typescript" }), + expect.not.objectContaining({ name: "jimmy.codes/testing" }), + expect.not.objectContaining({ name: "jimmy.codes/testing/vitest" }), + expect.not.objectContaining({ name: "jimmy.codes/testing/jest" }), + expect.objectContaining({ name: "jimmy.codes/react" }), + expect.objectContaining({ name: "jimmy.codes/react/query" }), + expect.not.objectContaining({ + name: "jimmy.codes/testing/testing-library", + }), + ]), + ); + }); + + it("should include vitest when auto detection is enabled", () => { + vi.mocked(isPackageExists).mockImplementation((name) => { + return name === "vitest"; + }); + + expect(jimmyDotCodes({ autoDetect: true })).toStrictEqual( + expect.arrayContaining([ + expect.not.objectContaining({ name: "jimmy.codes/typescript" }), + expect.objectContaining({ name: "jimmy.codes/testing" }), + expect.objectContaining({ name: "jimmy.codes/testing/vitest" }), + expect.not.objectContaining({ name: "jimmy.codes/testing/jest" }), + expect.not.objectContaining({ name: "jimmy.codes/react" }), + expect.not.objectContaining({ name: "jimmy.codes/react/query" }), + expect.not.objectContaining({ + name: "jimmy.codes/testing/testing-library", + }), + ]), + ); + }); + + it("should include jest when auto detection is enabled", () => { + vi.mocked(isPackageExists).mockImplementation((name) => { + return name === "jest"; + }); + + expect(jimmyDotCodes({ autoDetect: true })).toStrictEqual( + expect.arrayContaining([ + expect.not.objectContaining({ name: "jimmy.codes/typescript" }), + expect.objectContaining({ name: "jimmy.codes/testing" }), + expect.not.objectContaining({ name: "jimmy.codes/testing/vitest" }), + expect.objectContaining({ name: "jimmy.codes/testing/jest" }), + expect.not.objectContaining({ name: "jimmy.codes/react" }), + expect.not.objectContaining({ name: "jimmy.codes/react/query" }), + expect.not.objectContaining({ + name: "jimmy.codes/testing/testing-library", + }), + ]), + ); + }); + + it("should include test-library when auto detection is enabled", () => { + vi.mocked(isPackageExists).mockImplementation((name) => { + // eslint-disable-next-line jest/no-conditional-in-test + return name === "@testing-library/react" || name === "vitest"; + }); + + expect(jimmyDotCodes({ autoDetect: true })).toStrictEqual( + expect.arrayContaining([ + expect.not.objectContaining({ name: "jimmy.codes/typescript" }), + expect.objectContaining({ name: "jimmy.codes/testing" }), + expect.objectContaining({ name: "jimmy.codes/testing/vitest" }), + expect.not.objectContaining({ name: "jimmy.codes/testing/jest" }), + expect.not.objectContaining({ name: "jimmy.codes/react" }), + expect.not.objectContaining({ name: "jimmy.codes/react/query" }), + expect.objectContaining({ + name: "jimmy.codes/testing/testing-library", + }), + ]), + ); + }); + }); }); diff --git a/src/factory.ts b/src/factory.ts index 22edaf9..5a75de4 100644 --- a/src/factory.ts +++ b/src/factory.ts @@ -1,11 +1,12 @@ import eslintConfigPrettier from "eslint-config-prettier"; -import globals from "globals"; +import { commonjsConfig } from "./configs/commonjs"; import importsConfig from "./configs/imports"; import reactConfig from "./configs/react"; import testingConfig from "./configs/testing"; import typescriptConfig from "./configs/typescript"; -import { GLOB_CJS, GLOB_IGNORES } from "./constants"; +import { GLOB_IGNORES } from "./constants"; +import { hasReact, hasTesting, hasTypescript } from "./has-dep"; import { baseRules } from "./rules/base"; import { type Options } from "./types"; import { @@ -19,21 +20,24 @@ export const jimmyDotCodes = ({ react = false, testing = false, overrides = [], + autoDetect = false, }: Options = {}) => { + const isTypescriptEnabled = typescript || (autoDetect && hasTypescript()); + const isReactEnabled = react || (autoDetect && hasReact()); + const isTestingEnabled = testing || (autoDetect && hasTesting()); + return [ { name: "jimmy.codes/base", rules: baseRules }, - ...importsConfig({ typescript }), - ...(typescript ? typescriptConfig(getTypescriptOptions(typescript)) : []), - ...(react ? reactConfig(getReactOptions(react)) : []), - ...(testing ? testingConfig(getTestingOptions(testing)) : []), + ...importsConfig({ typescript: isTypescriptEnabled }), + ...(isTypescriptEnabled + ? typescriptConfig(getTypescriptOptions(typescript)) + : []), + ...(isReactEnabled ? reactConfig(getReactOptions(react), autoDetect) : []), + ...(isTestingEnabled + ? testingConfig(getTestingOptions(testing), autoDetect) + : []), { name: "jimmy.codes/disabled", ...eslintConfigPrettier }, - { - name: "jimmy.codes/commonjs", - files: [GLOB_CJS], - languageOptions: { - globals: globals.commonjs, - }, - }, + ...commonjsConfig(), { ignores: GLOB_IGNORES, }, diff --git a/src/has-dep.ts b/src/has-dep.ts new file mode 100644 index 0000000..df4658b --- /dev/null +++ b/src/has-dep.ts @@ -0,0 +1,33 @@ +import { isPackageExists } from "local-pkg"; + +import { TESTING_LIBRARY_FAMILY } from "./constants"; + +export const hasTypescript = () => { + return isPackageExists("typescript"); +}; + +export const hasReact = () => { + return isPackageExists("react"); +}; + +export const hasVitest = () => { + return isPackageExists("vitest"); +}; + +export const hasJest = () => { + return isPackageExists("jest"); +}; + +export const hasTesting = () => { + return hasVitest() || hasJest(); +}; + +export const hasTestingLibrary = () => { + return TESTING_LIBRARY_FAMILY.some((pkg) => { + return isPackageExists(pkg); + }); +}; + +export const hasReactQuery = () => { + return isPackageExists("@tanstack/react-query"); +}; diff --git a/src/types.ts b/src/types.ts index 3ae09d4..5ce254c 100644 --- a/src/types.ts +++ b/src/types.ts @@ -64,4 +64,9 @@ export interface Options { * @default [] */ overrides?: FlatConfigItem[]; + /** + * Is auto detection enabled? + * @default false + */ + autoDetect?: boolean; } diff --git a/tsconfig.json b/tsconfig.json index f3eaedc..ddd0dce 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,6 +18,5 @@ "jsx": "react-jsx", "types": ["vitest/globals"] - }, - "exclude": ["./fixtures/**/*.*"] + } }