Skip to content

Commit 5f04e1d

Browse files
committed
Set up eslint-plugin-testing-library
1 parent 7bbe4a5 commit 5f04e1d

File tree

3 files changed

+117
-0
lines changed

3 files changed

+117
-0
lines changed

.eslintrc.js

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,21 @@ module.exports = {
276276
'react/no-unused-prop-types': 'off',
277277
},
278278
},
279+
{
280+
files: [
281+
// matching the pattern of the test runner
282+
'*.test.mjs',
283+
'*.test.js',
284+
'*.test.ts',
285+
'*.test.tsx',
286+
],
287+
excludedFiles: ['packages/markdown/**/*', 'test/e2e/**/*', 'test/regressions/**/*'],
288+
extends: ['plugin:testing-library/react'],
289+
rules: {
290+
'testing-library/no-container': 'off',
291+
'testing-library/prefer-screen-queries': 'off',
292+
},
293+
},
279294
{
280295
files: ['docs/src/modules/components/**/*.js'],
281296
rules: {

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,7 @@
154154
"eslint-plugin-react": "^7.34.4",
155155
"eslint-plugin-react-compiler": "0.0.0-experimental-0998c1e-20240625",
156156
"eslint-plugin-react-hooks": "^4.6.2",
157+
"eslint-plugin-testing-library": "^6.2.2",
157158
"fast-glob": "^3.3.2",
158159
"fs-extra": "^11.2.0",
159160
"globby": "^14.0.2",

pnpm-lock.yaml

Lines changed: 101 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)