eslint-plugin-vue-data-testid
v1.1.2
Published
An ESLint plugin to enforce consistent usage of 'data-testid' attributes in Vue.js components for better testability
Downloads
3,576
Readme
eslint-plugin-vue-data-testid
An ESLint plugin to enforce consistent usage of custom 'data-testid' attributes in Vue.js components for better testability.
Install
You should have eslint
and eslint-plugin-vue
set up first.
yarn add eslint-plugin-vue-data-testid -D
# OR
npm install eslint-plugin-vue-data-testid --save-dev
// .eslintrc.js
module.exports = {
extends: ["plugin:vue-data-testid/base"],
};
or if you want to configure rules manually:
module.exports = {
plugins: ["vue-data-testid"],
rules: {
// add your rules here
},
};
Rules
tag-element
Enforces the inclusion of a custom 'data-testid' attribute in specified Vue.js components.
event-attribute:
Enforces the inclusion of a custom 'data-testid' attribute in specified Vue.js components with testable events.
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update tests as appropriate.