Skip to content

Latest commit

 

History

History
24 lines (17 loc) · 740 Bytes

File metadata and controls

24 lines (17 loc) · 740 Bytes

Fill empty data-test-id attributes with nanoid (generate-test-id/jsx)

⚠️ This rule warns in the ✅ recommended config.

🔧 This rule is automatically fixable by the --fix CLI option.

Options

{
  "generate-test-id/jsx": ["error", { "attributes": "data-test-id" }]
}
{
  "generate-test-id/jsx": ["error", { "attributes": ["data-test-id", "data-qa-id"], "length": 16 }]
}
  • attributes - An array of attribute names or an attribute name, filled with generated id. Default is ['data-test-id', 'data-testid'].
  • length - The length of the generated id value. Defaults to 8.