Skip to content

An ESLint plugin to enforce consistent usage of 'data-testid' attributes in Vue.js components for better testability

License

Notifications You must be signed in to change notification settings

xyos/eslint-plugin-vue-data-testid

Repository files navigation

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

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.

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.

License

MIT

About

An ESLint plugin to enforce consistent usage of 'data-testid' attributes in Vue.js components for better testability

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published