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"}]
  }
}

/eslint-plugin-ng-test-identifier/

    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