eslint-plugin-ng-test-identifier
TypeScript icon, indicating that this package has built-in type declarations

1.4.0 • Public • Published

ng-test-identifier

ESLint rule to make sure that all elements have an unique test identifier. (data-test attribute by default)

When running eslint with --fix option, this rule adds data-test attribute with random value for all elements (except ng-container/ng-content/ng-template).

Random value is generated using nanoid, and the length and alphabet are configurable.

Example configuration:

{
  "rules": {
    "ng-test-identifier": ["error", {"randomTextOptions": {"length": 8, "alphabet": "useandom-26T198340PX75pxJACKVERYMINDBUSHWOLF_GQZbfghjklqvwyzrict"}, "tagName": "data-test"}]
  }
}

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.4.0
    34
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.4.0
    34
  • 1.3.0
    0
  • 1.2.0
    0
  • 1.1.0
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i eslint-plugin-ng-test-identifier

Weekly Downloads

34

Version

1.4.0

License

MIT

Unpacked Size

62.3 kB

Total Files

15

Last publish

Collaborators

  • 0x450x6c