diff --git a/.eslintrc b/.eslintrc index 6021a7bfdd..2f52429610 100644 --- a/.eslintrc +++ b/.eslintrc @@ -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", diff --git a/test-utils/utils.tsx b/test-utils/utils.tsx index 06b7ea103c..b673908ce1 100644 --- a/test-utils/utils.tsx +++ b/test-utils/utils.tsx @@ -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';