Fill empty data-test-id attributes with nanoid.
You'll first need to install ESLint:
npm i eslint --save-dev
Next, install eslint-plugin-generate-test-id
:
npm install eslint-plugin-generate-test-id --save-dev
{
"extends": ["plugin:generate-test-id/recommended"]
}
eslint.config.js
(requires eslint>=v8.23.0)
const generateTestIdJsx = require("eslint-plugin-eslint-plugin/configs/recommended");
module.exports = [generateTestIdJsx];
✅ Set in the recommended
configuration.
🔧 Automatically fixable by the --fix
CLI option.
Name | Description | 🔧 | |
---|---|---|---|
jsx | Fill empty data-test-id attributes with nanoid | ✅ | 🔧 |
{
"extends": ["plugin:generate-test-id/recommended"]
}