Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Only enable testing rules in test files
  • Loading branch information
nickserv committed Apr 23, 2020
commit bef07e09e8188e5782cd895aa3dc83f09ee1e2e4
17 changes: 11 additions & 6 deletions packages/eslint-config-react-app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,6 @@ module.exports = {

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

extends: [
'plugin:jest/recommended',
'plugin:jest-dom/recommended',
'plugin:testing-library/react',
],

env: {
browser: true,
commonjs: true,
Expand Down Expand Up @@ -118,6 +112,17 @@ module.exports = {
'@typescript-eslint/no-useless-constructor': 'warn',
},
},
{
files: [
'**/__tests__/**/*.{js,jsx,ts,tsx}',
'**/*.{spec,test}.{js,jsx,ts,tsx}',
],
extends: [
'plugin:jest/recommended',
'plugin:jest-dom/recommended',
'plugin:testing-library/react',
],
},
],

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