Skip to content

Commit

Permalink
chore: add linter rule about testing-library import
Browse files Browse the repository at this point in the history
  • Loading branch information
amje committed Feb 6, 2024
1 parent 4f9d2ec commit 5135d48
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@
{
"selector": "TSTypeReference>TSQualifiedName[left.name='React'][right.name='FC']",
"message": "Don't use React.FC"
},
{
"selector": "ImportDeclaration[source.value='@testing-library/react']",
"message": "Please use wrapper from 'test-utils/utils.tsx'."
}
],
"jsx-a11y/no-autofocus": "off",
Expand Down
2 changes: 2 additions & 0 deletions test-utils/utils.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import React from 'react';

// eslint-disable-next-line no-restricted-syntax
import {render} from '@testing-library/react';
// eslint-disable-next-line no-restricted-syntax
import type {RenderOptions} from '@testing-library/react';

import type {ThemeContextProps} from '../src';
Expand Down

0 comments on commit 5135d48

Please sign in to comment.