An ESLint plugin to enforce consistent usage of custom 'data-testid' attributes in Vue.js components for better testability.
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
},
};
Enforces the inclusion of a custom 'data-testid' attribute in specified Vue.js components.
Enforces the inclusion of a custom 'data-testid' attribute in specified Vue.js components with testable events.
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.