eslint-plugin-mui-data-testid
v1.2.1
Published
This ESLint plugin helps ensure that React MUI components have the required testId attribute.
Downloads
434
Maintainers
Readme
eslint-plugin-mui-data-testid
ESLint plugin to check data-testid attribute for given list of MUI components.
Installation
npm i eslint-plugin-mui-data-testid -DConfiguration
After installation, do not forget to configure ESLint to use this rule. Here's an example configuration:
{
plugins: ['mui-data-testid'],
'rules': {
'react-require-testid/testid-missing': ['error', {
'includeComponents': [], // You can add custom components to the default list. e.g.: 'OurCompanyComponent'.
'excludeComponents': [], // You can remove components from the default list if needed.
'dataTestId': 'data-testid', // You can also override the data test attribute.
}]
}
}