Skip to content

Commit bef07e0

Browse files
committed
Only enable testing rules in test files
1 parent 3679e2f commit bef07e0

File tree

1 file changed

+11
-6
lines changed
  • packages/eslint-config-react-app

1 file changed

+11
-6
lines changed

packages/eslint-config-react-app/index.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,6 @@ module.exports = {
3030

3131
plugins: ['import', 'flowtype', 'jsx-a11y', 'react', 'react-hooks'],
3232

33-
extends: [
34-
'plugin:jest/recommended',
35-
'plugin:jest-dom/recommended',
36-
'plugin:testing-library/react',
37-
],
38-
3933
env: {
4034
browser: true,
4135
commonjs: true,
@@ -118,6 +112,17 @@ module.exports = {
118112
'@typescript-eslint/no-useless-constructor': 'warn',
119113
},
120114
},
115+
{
116+
files: [
117+
'**/__tests__/**/*.{js,jsx,ts,tsx}',
118+
'**/*.{spec,test}.{js,jsx,ts,tsx}',
119+
],
120+
extends: [
121+
'plugin:jest/recommended',
122+
'plugin:jest-dom/recommended',
123+
'plugin:testing-library/react',
124+
],
125+
},
121126
],
122127

123128
// NOTE: When adding rules here, you need to make sure they are compatible with

0 commit comments

Comments
 (0)