This is rule of eslint plugin for vue templates which checks element with model has `data-test-id`
The npm package eslint-plugin-test-id is used to check if the data-test-id prop is present on certain tags, which is useful for end-to-end testing. It helps enforce consistency in adding test identifiers to elements in the codebase.
data-test-id prop is included on specified tags..eslintrc file to suit specific project needs.To install the eslint-plugin-test-id, first, ensure ESLint is installed. Then run the following commands:
npm install eslint --save-dev
npm install eslint-plugin-test-id --save-dev
Add test-id to the plugins section in your .eslintrc file and configure rules under the rules section. To enable all recommended rules at once, simply include them in the configuration.
The eslint-plugin-test-id npm package provides a straightforward way to enforce the presence of data-test-id props on certain tags, aiding in the creation of more testable code for end-to-end testing. By integrating with ESLint, it becomes a seamless part of the development workflow, ensuring code quality and consistency.