From 8b06686ee5a3c71268e9903900a9adb0e737f4c9 Mon Sep 17 00:00:00 2001 From: Mikkel Laursen Date: Fri, 3 Nov 2023 12:25:59 -0400 Subject: [PATCH] feat(test)!: add eslint-plugin-testing-library --- index.js | 2 +- package.json | 1 + pnpm-lock.yaml | 16 ++++++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 6726665..b0b6e9e 100644 --- a/index.js +++ b/index.js @@ -159,7 +159,7 @@ module.exports = { }, { files: ["**/__tests__/**", "**/*.test.*"], - extends: ["plugin:jest/recommended"], + extends: ["plugin:jest/recommended", "plugin:testing-library/react"], rules: { // it's valid to do @jest-environment or other things in tests "tsdoc/syntax": 0, diff --git a/package.json b/package.json index 3782acc..eec8a07 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "eslint-plugin-jsx-a11y": "^6.7.1", "eslint-plugin-react": "^7.33.2", "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-testing-library": "^6.1.0", "eslint-plugin-tsdoc": "^0.2.17" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index ab1ea13..24dff59 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -32,6 +32,9 @@ dependencies: eslint-plugin-react-hooks: specifier: ^4.6.0 version: 4.6.0(eslint@8.49.0) + eslint-plugin-testing-library: + specifier: ^6.1.0 + version: 6.1.0(eslint@8.49.0)(typescript@5.2.2) eslint-plugin-tsdoc: specifier: ^0.2.17 version: 0.2.17 @@ -1734,6 +1737,19 @@ packages: string.prototype.matchall: 4.0.9 dev: false + /eslint-plugin-testing-library@6.1.0(eslint@8.49.0)(typescript@5.2.2): + resolution: {integrity: sha512-r7kE+az3tbp8vyRwfyAGZ6V/xw+XvdWFPicIo6jbOPZoossOFDeHizARqPGV6gEkyF8hyCFhhH3mlQOGS3N5Sg==} + 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.49.0)(typescript@5.2.2) + eslint: 8.49.0 + transitivePeerDependencies: + - supports-color + - typescript + dev: false + /eslint-plugin-tsdoc@0.2.17: resolution: {integrity: sha512-xRmVi7Zx44lOBuYqG8vzTXuL6IdGOeF9nHX17bjJ8+VE6fsxpdGem0/SBTmAwgYMKYB1WBkqRJVQ+n8GK041pA==} dependencies: