Skip to content

Commit fb17144

Browse files
committed
Add eslint-plugin-testing-library
1 parent 11d72c2 commit fb17144

File tree

3 files changed

+109
-74
lines changed

3 files changed

+109
-74
lines changed

eslint.config.ts

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import path from 'node:path';
22
import { globalIgnores } from 'eslint/config';
33
import jest from 'eslint-plugin-jest';
44
import prettierRecommended from 'eslint-plugin-prettier/recommended';
5+
import testingLibrary from 'eslint-plugin-testing-library';
56
import globals from 'globals';
67
import tsEslint from 'typescript-eslint';
78
import { includeIgnoreFile } from '@eslint/compat';
@@ -190,7 +191,11 @@ const config = tsEslint.config([
190191
{
191192
files: ['node_package/tests/**', '**/*.test.{js,jsx,ts,tsx}'],
192193

193-
extends: [jest.configs['flat/recommended'], jest.configs['flat/style']],
194+
extends: [
195+
jest.configs['flat/recommended'],
196+
jest.configs['flat/style'],
197+
testingLibrary.configs['flat/dom'],
198+
],
194199

195200
rules: {
196201
// Allows Jest mocks before import

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@
4444
"eslint-plugin-prettier": "^5.2.3",
4545
"eslint-plugin-react": "^7.37.4",
4646
"eslint-plugin-react-hooks": "^5.2.0",
47-
"typescript-eslint": "^8.29.1",
47+
"eslint-plugin-testing-library": "^7.4.0",
48+
"typescript-eslint": "^8.33.1",
4849
"globals": "^16.0.0",
4950
"jest": "^29.7.0",
5051
"jest-environment-jsdom": "^29.7.0",

yarn.lock

Lines changed: 101 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -1061,10 +1061,10 @@
10611061
resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9"
10621062
integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==
10631063

1064-
"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.4.0":
1065-
version "4.5.1"
1066-
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.5.1.tgz#b0fc7e06d0c94f801537fd4237edc2706d3b8e4c"
1067-
integrity sha512-soEIOALTfTK6EjmKMMoLugwaP0rzkad90iIWd1hMO9ARkSAyjfMfkRRhLvD5qH7vvM0Cg72pieUfR6yh6XxC4w==
1064+
"@eslint-community/eslint-utils@^4.2.0", "@eslint-community/eslint-utils@^4.7.0":
1065+
version "4.7.0"
1066+
resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz#607084630c6c033992a082de6e6fbc1a8b52175a"
1067+
integrity sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==
10681068
dependencies:
10691069
eslint-visitor-keys "^3.4.3"
10701070

@@ -1695,85 +1695,101 @@
16951695
dependencies:
16961696
"@types/yargs-parser" "*"
16971697

1698-
"@typescript-eslint/eslint-plugin@8.29.1":
1699-
version "8.29.1"
1700-
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.29.1.tgz#593639d9bb5239b2d877d65757b7e2c9100a2e84"
1701-
integrity sha512-ba0rr4Wfvg23vERs3eB+P3lfj2E+2g3lhWcCVukUuhtcdUx5lSIFZlGFEBHKr+3zizDa/TvZTptdNHVZWAkSBg==
1698+
"@typescript-eslint/eslint-plugin@8.33.1":
1699+
version "8.33.1"
1700+
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.33.1.tgz#532641b416ed2afd5be893cddb2a58e9cd1f7a3e"
1701+
integrity sha512-TDCXj+YxLgtvxvFlAvpoRv9MAncDLBV2oT9Bd7YBGC/b/sEURoOYuIwLI99rjWOfY3QtDzO+mk0n4AmdFExW8A==
17021702
dependencies:
17031703
"@eslint-community/regexpp" "^4.10.0"
1704-
"@typescript-eslint/scope-manager" "8.29.1"
1705-
"@typescript-eslint/type-utils" "8.29.1"
1706-
"@typescript-eslint/utils" "8.29.1"
1707-
"@typescript-eslint/visitor-keys" "8.29.1"
1704+
"@typescript-eslint/scope-manager" "8.33.1"
1705+
"@typescript-eslint/type-utils" "8.33.1"
1706+
"@typescript-eslint/utils" "8.33.1"
1707+
"@typescript-eslint/visitor-keys" "8.33.1"
17081708
graphemer "^1.4.0"
1709-
ignore "^5.3.1"
1709+
ignore "^7.0.0"
17101710
natural-compare "^1.4.0"
1711-
ts-api-utils "^2.0.1"
1711+
ts-api-utils "^2.1.0"
17121712

1713-
"@typescript-eslint/parser@8.29.1":
1714-
version "8.29.1"
1715-
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.29.1.tgz#10bf37411be0a199c27b6515726e22fe8d3df8d0"
1716-
integrity sha512-zczrHVEqEaTwh12gWBIJWj8nx+ayDcCJs06yoNMY0kwjMWDM6+kppljY+BxWI06d2Ja+h4+WdufDcwMnnMEWmg==
1713+
"@typescript-eslint/parser@8.33.1":
1714+
version "8.33.1"
1715+
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-8.33.1.tgz#ef9a5ee6aa37a6b4f46cc36d08a14f828238afe2"
1716+
integrity sha512-qwxv6dq682yVvgKKp2qWwLgRbscDAYktPptK4JPojCwwi3R9cwrvIxS4lvBpzmcqzR4bdn54Z0IG1uHFskW4dA==
17171717
dependencies:
1718-
"@typescript-eslint/scope-manager" "8.29.1"
1719-
"@typescript-eslint/types" "8.29.1"
1720-
"@typescript-eslint/typescript-estree" "8.29.1"
1721-
"@typescript-eslint/visitor-keys" "8.29.1"
1718+
"@typescript-eslint/scope-manager" "8.33.1"
1719+
"@typescript-eslint/types" "8.33.1"
1720+
"@typescript-eslint/typescript-estree" "8.33.1"
1721+
"@typescript-eslint/visitor-keys" "8.33.1"
17221722
debug "^4.3.4"
17231723

1724-
"@typescript-eslint/scope-manager@8.29.1":
1725-
version "8.29.1"
1726-
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.29.1.tgz#cfdfd4144f20c38b9d3e430efd6480e297ef52f6"
1727-
integrity sha512-2nggXGX5F3YrsGN08pw4XpMLO1Rgtnn4AzTegC2MDesv6q3QaTU5yU7IbS1tf1IwCR0Hv/1EFygLn9ms6LIpDA==
1724+
"@typescript-eslint/project-service@8.33.1":
1725+
version "8.33.1"
1726+
resolved "https://registry.yarnpkg.com/@typescript-eslint/project-service/-/project-service-8.33.1.tgz#c85e7d9a44d6a11fe64e73ac1ed47de55dc2bf9f"
1727+
integrity sha512-DZR0efeNklDIHHGRpMpR5gJITQpu6tLr9lDJnKdONTC7vvzOlLAG/wcfxcdxEWrbiZApcoBCzXqU/Z458Za5Iw==
17281728
dependencies:
1729-
"@typescript-eslint/types" "8.29.1"
1730-
"@typescript-eslint/visitor-keys" "8.29.1"
1729+
"@typescript-eslint/tsconfig-utils" "^8.33.1"
1730+
"@typescript-eslint/types" "^8.33.1"
1731+
debug "^4.3.4"
17311732

1732-
"@typescript-eslint/type-utils@8.29.1":
1733-
version "8.29.1"
1734-
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.29.1.tgz#653dfff5c1711bc920a6a46a5a2c274899f00179"
1735-
integrity sha512-DkDUSDwZVCYN71xA4wzySqqcZsHKic53A4BLqmrWFFpOpNSoxX233lwGu/2135ymTCR04PoKiEEEvN1gFYg4Tw==
1733+
"@typescript-eslint/scope-manager@8.33.1", "@typescript-eslint/scope-manager@^8.15.0":
1734+
version "8.33.1"
1735+
resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-8.33.1.tgz#d1e0efb296da5097d054bc9972e69878a2afea73"
1736+
integrity sha512-dM4UBtgmzHR9bS0Rv09JST0RcHYearoEoo3pG5B6GoTR9XcyeqX87FEhPo+5kTvVfKCvfHaHrcgeJQc6mrDKrA==
17361737
dependencies:
1737-
"@typescript-eslint/typescript-estree" "8.29.1"
1738-
"@typescript-eslint/utils" "8.29.1"
1739-
debug "^4.3.4"
1740-
ts-api-utils "^2.0.1"
1738+
"@typescript-eslint/types" "8.33.1"
1739+
"@typescript-eslint/visitor-keys" "8.33.1"
17411740

1742-
"@typescript-eslint/types@8.29.1":
1743-
version "8.29.1"
1744-
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.29.1.tgz#984ed1283fedbfb41d3993a9abdcb7b299971500"
1745-
integrity sha512-VT7T1PuJF1hpYC3AGm2rCgJBjHL3nc+A/bhOp9sGMKfi5v0WufsX/sHCFBfNTx2F+zA6qBc/PD0/kLRLjdt8mQ==
1741+
"@typescript-eslint/tsconfig-utils@8.33.1", "@typescript-eslint/tsconfig-utils@^8.33.1":
1742+
version "8.33.1"
1743+
resolved "https://registry.yarnpkg.com/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.33.1.tgz#7836afcc097a4657a5ed56670851a450d8b70ab8"
1744+
integrity sha512-STAQsGYbHCF0/e+ShUQ4EatXQ7ceh3fBCXkNU7/MZVKulrlq1usH7t2FhxvCpuCi5O5oi1vmVaAjrGeL71OK1g==
17461745

1747-
"@typescript-eslint/typescript-estree@8.29.1":
1748-
version "8.29.1"
1749-
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.29.1.tgz#4ac085665ed5390d11c0e3426427978570e3b747"
1750-
integrity sha512-l1enRoSaUkQxOQnbi0KPUtqeZkSiFlqrx9/3ns2rEDhGKfTa+88RmXqedC1zmVTOWrLc2e6DEJrTA51C9iLH5g==
1746+
"@typescript-eslint/type-utils@8.33.1":
1747+
version "8.33.1"
1748+
resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-8.33.1.tgz#d73ee1a29d8a0abe60d4abbff4f1d040f0de15fa"
1749+
integrity sha512-1cG37d9xOkhlykom55WVwG2QRNC7YXlxMaMzqw2uPeJixBFfKWZgaP/hjAObqMN/u3fr5BrTwTnc31/L9jQ2ww==
17511750
dependencies:
1752-
"@typescript-eslint/types" "8.29.1"
1753-
"@typescript-eslint/visitor-keys" "8.29.1"
1751+
"@typescript-eslint/typescript-estree" "8.33.1"
1752+
"@typescript-eslint/utils" "8.33.1"
1753+
debug "^4.3.4"
1754+
ts-api-utils "^2.1.0"
1755+
1756+
"@typescript-eslint/[email protected]", "@typescript-eslint/types@^8.33.1":
1757+
version "8.33.1"
1758+
resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-8.33.1.tgz#b693111bc2180f8098b68e9958cf63761657a55f"
1759+
integrity sha512-xid1WfizGhy/TKMTwhtVOgalHwPtV8T32MS9MaH50Cwvz6x6YqRIPdD2WvW0XaqOzTV9p5xdLY0h/ZusU5Lokg==
1760+
1761+
"@typescript-eslint/[email protected]":
1762+
version "8.33.1"
1763+
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-8.33.1.tgz#d271beed470bc915b8764e22365d4925c2ea265d"
1764+
integrity sha512-+s9LYcT8LWjdYWu7IWs7FvUxpQ/DGkdjZeE/GGulHvv8rvYwQvVaUZ6DE+j5x/prADUgSbbCWZ2nPI3usuVeOA==
1765+
dependencies:
1766+
"@typescript-eslint/project-service" "8.33.1"
1767+
"@typescript-eslint/tsconfig-utils" "8.33.1"
1768+
"@typescript-eslint/types" "8.33.1"
1769+
"@typescript-eslint/visitor-keys" "8.33.1"
17541770
debug "^4.3.4"
17551771
fast-glob "^3.3.2"
17561772
is-glob "^4.0.3"
17571773
minimatch "^9.0.4"
17581774
semver "^7.6.0"
1759-
ts-api-utils "^2.0.1"
1775+
ts-api-utils "^2.1.0"
17601776

1761-
"@typescript-eslint/utils@8.29.1", "@typescript-eslint/utils@^6.0.0 || ^7.0.0 || ^8.0.0":
1762-
version "8.29.1"
1763-
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.29.1.tgz#3d206c8c8def3527a8eb0588e94e3e60f7e167c9"
1764-
integrity sha512-QAkFEbytSaB8wnmB+DflhUPz6CLbFWE2SnSCrRMEa+KnXIzDYbpsn++1HGvnfAsUY44doDXmvRkO5shlM/3UfA==
1777+
"@typescript-eslint/utils@8.33.1", "@typescript-eslint/utils@^6.0.0 || ^7.0.0 || ^8.0.0", "@typescript-eslint/utils@^8.15.0":
1778+
version "8.33.1"
1779+
resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-8.33.1.tgz#ea22f40d3553da090f928cf17907e963643d4b96"
1780+
integrity sha512-52HaBiEQUaRYqAXpfzWSR2U3gxk92Kw006+xZpElaPMg3C4PgM+A5LqwoQI1f9E5aZ/qlxAZxzm42WX+vn92SQ==
17651781
dependencies:
1766-
"@eslint-community/eslint-utils" "^4.4.0"
1767-
"@typescript-eslint/scope-manager" "8.29.1"
1768-
"@typescript-eslint/types" "8.29.1"
1769-
"@typescript-eslint/typescript-estree" "8.29.1"
1782+
"@eslint-community/eslint-utils" "^4.7.0"
1783+
"@typescript-eslint/scope-manager" "8.33.1"
1784+
"@typescript-eslint/types" "8.33.1"
1785+
"@typescript-eslint/typescript-estree" "8.33.1"
17701786

1771-
"@typescript-eslint/visitor-keys@8.29.1":
1772-
version "8.29.1"
1773-
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.29.1.tgz#9b74e5098c71138d42bbf2178fbe4dfad45d6b9a"
1774-
integrity sha512-RGLh5CRaUEf02viP5c1Vh1cMGffQscyHe7HPAzGpfmfflFg1wUz2rYxd+OZqwpeypYvZ8UxSxuIpF++fmOzEcg==
1787+
"@typescript-eslint/visitor-keys@8.33.1":
1788+
version "8.33.1"
1789+
resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-8.33.1.tgz#6c6e002c24d13211df3df851767f24dfdb4f42bc"
1790+
integrity sha512-3i8NrFcZeeDHJ+7ZUuDkGT+UHq+XoFGsymNK2jZCOHcfEzRQ0BdpRtdpSx/Iyf3MHLWIcLS0COuOPibKQboIiQ==
17751791
dependencies:
1776-
"@typescript-eslint/types" "8.29.1"
1792+
"@typescript-eslint/types" "8.33.1"
17771793
eslint-visitor-keys "^4.2.0"
17781794

17791795
abab@^2.0.6:
@@ -3032,6 +3048,14 @@ eslint-plugin-react@^7.28.0, eslint-plugin-react@^7.37.4:
30323048
string.prototype.matchall "^4.0.12"
30333049
string.prototype.repeat "^1.0.0"
30343050

3051+
eslint-plugin-testing-library@^7.4.0:
3052+
version "7.4.0"
3053+
resolved "https://registry.yarnpkg.com/eslint-plugin-testing-library/-/eslint-plugin-testing-library-7.4.0.tgz#ae2b19c71f793d5745e90ea20251cf53c71d9dd7"
3054+
integrity sha512-rmryGUowFYlljNrN/sPjSfp4uZr6gIsiTHUeFg45xNwhWzgr+izRzOanrvd28XVlVmXlBpZdJGu+aHFUBBQatA==
3055+
dependencies:
3056+
"@typescript-eslint/scope-manager" "^8.15.0"
3057+
"@typescript-eslint/utils" "^8.15.0"
3058+
30353059
30363060
version "5.1.1"
30373061
resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c"
@@ -3564,11 +3588,16 @@ [email protected]:
35643588
dependencies:
35653589
safer-buffer ">= 2.1.2 < 3.0.0"
35663590

3567-
ignore@^5.1.8, ignore@^5.2.0, ignore@^5.3.1:
3591+
ignore@^5.1.8, ignore@^5.2.0:
35683592
version "5.3.2"
35693593
resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.3.2.tgz#3cd40e729f3643fd87cb04e50bf0eb722bc596f5"
35703594
integrity sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==
35713595

3596+
ignore@^7.0.0:
3597+
version "7.0.5"
3598+
resolved "https://registry.yarnpkg.com/ignore/-/ignore-7.0.5.tgz#4cb5f6cd7d4c7ab0365738c7aea888baa6d7efd9"
3599+
integrity sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==
3600+
35723601
import-fresh@^3.2.1:
35733602
version "3.3.0"
35743603
resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b"
@@ -5903,10 +5932,10 @@ tr46@~0.0.3:
59035932
resolved "https://registry.yarnpkg.com/tr46/-/tr46-0.0.3.tgz#8184fd347dac9cdc185992f3a6622e14b9d9ab6a"
59045933
integrity sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==
59055934

5906-
ts-api-utils@^2.0.1:
5907-
version "2.0.1"
5908-
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-2.0.1.tgz#660729385b625b939aaa58054f45c058f33f10cd"
5909-
integrity sha512-dnlgjFSVetynI8nzgJ+qF62efpglpWRk8isUEWZGWlJYySCTD6aKvbUDu+zbPeDakk3bg5H4XpitHukgfL1m9w==
5935+
ts-api-utils@^2.1.0:
5936+
version "2.1.0"
5937+
resolved "https://registry.yarnpkg.com/ts-api-utils/-/ts-api-utils-2.1.0.tgz#595f7094e46eed364c13fd23e75f9513d29baf91"
5938+
integrity sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==
59105939

59115940
ts-jest@^29.2.5:
59125941
version "29.2.5"
@@ -6007,14 +6036,14 @@ typed-array-length@^1.0.7:
60076036
possible-typed-array-names "^1.0.0"
60086037
reflect.getprototypeof "^1.0.6"
60096038

6010-
typescript-eslint@^8.29.1:
6011-
version "8.29.1"
6012-
resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-8.29.1.tgz#c0b205e542ade22f9027caaaa9c4ec31a202010f"
6013-
integrity sha512-f8cDkvndhbQMPcysk6CUSGBWV+g1utqdn71P5YKwMumVMOG/5k7cHq0KyG4O52nB0oKS4aN2Tp5+wB4APJGC+w==
6039+
typescript-eslint@^8.33.1:
6040+
version "8.33.1"
6041+
resolved "https://registry.yarnpkg.com/typescript-eslint/-/typescript-eslint-8.33.1.tgz#d2d59c9b24afe1f903a855b02145802e4ae930ff"
6042+
integrity sha512-AgRnV4sKkWOiZ0Kjbnf5ytTJXMUZQ0qhSVdQtDNYLPLnjsATEYhaO94GlRQwi4t4gO8FfjM6NnikHeKjUm8D7A==
60146043
dependencies:
6015-
"@typescript-eslint/eslint-plugin" "8.29.1"
6016-
"@typescript-eslint/parser" "8.29.1"
6017-
"@typescript-eslint/utils" "8.29.1"
6044+
"@typescript-eslint/eslint-plugin" "8.33.1"
6045+
"@typescript-eslint/parser" "8.33.1"
6046+
"@typescript-eslint/utils" "8.33.1"
60186047

60196048
60206049
version "5.6.1-rc"

0 commit comments

Comments
 (0)