From 5ebca01e3588f8fe1a9ea876e102da3d837e2692 Mon Sep 17 00:00:00 2001 From: Davyd NRB <4661784+retyui@users.noreply.github.com> Date: Sun, 31 Mar 2024 14:31:16 +0200 Subject: [PATCH] Apply `eslint-plugin-testing-library` for test files only --- website/docs/GettingStarted.md | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/website/docs/GettingStarted.md b/website/docs/GettingStarted.md index 518947392..a12208f7c 100644 --- a/website/docs/GettingStarted.md +++ b/website/docs/GettingStarted.md @@ -70,7 +70,13 @@ Then, add relevant entry to your ESLint config (e.g., `.eslintrc.js`). We recomm ```js module.exports = { - extends: ['plugin:testing-library/react'], + overrides: [ + { + // Test files only + files: ['**/__tests__/**/*.[jt]s?(x)', '**/?(*.)+(spec|test).[jt]s?(x)'], + extends: ['plugin:testing-library/react'] + } + ] }; ```