From 054f5817ddf3c32b38cbd1d18636a753916b8f79 Mon Sep 17 00:00:00 2001 From: jimmy-guzman Date: Sat, 23 Nov 2024 08:59:20 -0600 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20use=20flat=20config=20fro?= =?UTF-8?q?m=20`eslint-plugin-testing-library`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- package.json | 2 +- pnpm-lock.yaml | 12 ++++++------ src/rules/testing-library.ts | 2 +- src/stubs.d.ts | 10 ---------- 4 files changed, 8 insertions(+), 18 deletions(-) diff --git a/package.json b/package.json index 0370c2d..9080f98 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "eslint-plugin-react-hooks": "^5.0.0", "eslint-plugin-react-refresh": "0.4.14", "eslint-plugin-regexp": "^2.7.0", - "eslint-plugin-testing-library": "7.0.0-beta.6", + "eslint-plugin-testing-library": "^7.0.0", "eslint-plugin-unicorn": "^56.0.1", "globals": "^15.12.0", "local-pkg": "0.5.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 4d40053..8419cd9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -69,8 +69,8 @@ importers: specifier: ^2.7.0 version: 2.7.0(eslint@9.15.0(jiti@2.4.0)) eslint-plugin-testing-library: - specifier: 7.0.0-beta.6 - version: 7.0.0-beta.6(eslint@9.15.0(jiti@2.4.0))(typescript@5.6.3) + specifier: ^7.0.0 + version: 7.0.0(eslint@9.15.0(jiti@2.4.0))(typescript@5.6.3) eslint-plugin-unicorn: specifier: ^56.0.1 version: 56.0.1(eslint@9.15.0(jiti@2.4.0)) @@ -2508,9 +2508,9 @@ packages: peerDependencies: eslint: '>=8.44.0' - eslint-plugin-testing-library@7.0.0-beta.6: - resolution: {integrity: sha512-TK39+CTbMdkSH0wmnltdjur8tUYz+lnID8o0VZFG45fSeFknLnbn76we3uzDbUltH68bdmoPXk/7w1x3XFQ7+w==} - engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0, npm: '>=6'} + eslint-plugin-testing-library@7.0.0: + resolution: {integrity: sha512-Bwrn5Qi08Lf5Huv4ZGDNYxwkFLAyGQIPB9lC0ALlojymP32aKsSxWnccP1NvIcI5vMhkENg4Y5Td/Q9/tLYmGQ==} + engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0, npm: '>=9.8.1'} peerDependencies: eslint: ^8.57.0 || ^9.0.0 @@ -7648,7 +7648,7 @@ snapshots: regexp-ast-analysis: 0.7.1 scslre: 0.3.0 - eslint-plugin-testing-library@7.0.0-beta.6(eslint@9.15.0(jiti@2.4.0))(typescript@5.6.3): + eslint-plugin-testing-library@7.0.0(eslint@9.15.0(jiti@2.4.0))(typescript@5.6.3): dependencies: '@typescript-eslint/scope-manager': 8.15.0 '@typescript-eslint/utils': 8.15.0(eslint@9.15.0(jiti@2.4.0))(typescript@5.6.3) diff --git a/src/rules/testing-library.ts b/src/rules/testing-library.ts index 9147937..273b472 100644 --- a/src/rules/testing-library.ts +++ b/src/rules/testing-library.ts @@ -9,7 +9,7 @@ export const testingLibraryRules = async () => { ]); return { - ...testingLibrary.configs.react.rules, + ...testingLibrary.configs["flat/react"].rules, ...jestDom.configs["flat/recommended"].rules, } satisfies Rules; }; diff --git a/src/stubs.d.ts b/src/stubs.d.ts index 7832c7c..46ebfd7 100644 --- a/src/stubs.d.ts +++ b/src/stubs.d.ts @@ -37,16 +37,6 @@ declare module "eslint-plugin-jsx-a11y" { export default plugin; } -declare module "eslint-plugin-testing-library" { - import type { ESLint, Linter } from "eslint"; - - const react: Linter.Config; - const plugin: ESLint.Plugin; - - export = { configs: { react } }; - export default plugin; -} - declare module "eslint-plugin-react-refresh" { import type { ESLint } from "eslint";