@vue-require-id/eslint-plugin

@vue-require-id/eslint-plugin is a custom ESLint plugin that enforces the use of 'id' attribute on specified HTML elements in Vue.js templates.
5,890 1
Install
npm install @vue-require-id/eslint-plugin
Latest Version:1.0.4
License:MIT
Last Updated:May 19, 2023
Links: GitHub  ·  npm
Maintainer: alexandrelou

@vue-require-id/eslint-plugin

A custom ESLint plugin that enforces adding an id attribute to all specified elements in Vue.js templates using the vue-eslint-parser. This plugin can be used to catch missing id attributes during development and ensure accessibility best practices are being followed.

Usage To use this plugin, add it to your ESLint configuration file and enable the @vue-require-id/require-id rule with an options object that lists the elements to check for the presence of the id attribute.

For example:

{
    "plugins": [
        "vue-require-id"
    ],
    "rules": {
        "@vue-require-id/require-id": [
            "error",
            {
                "elements": [
                    "input",
                    "button"
                ]
            }
        ]
    }
}

If the id attribute is missing from any input or button element in your templates, ESLint will report an error.

test

install test packages:

"mocha": "^10.2.0", "eslint-plugin-vue": "^9.13.0"

run test:

npm run test

License This project is licensed under the MIT License.

Related Packages

@forsakringskassan/eslint-config-vue

Försäkringskassans eslint shareable vue config

286,740 0
@scayle/eslint-config-storefront

SCAYLE Commerce Engine specific eslint configuration

218,314
eslint-config-vue

eslint config for vue.js projects

313,105 320
@cloudflight/eslint-plugin-vue

Cloudflight eslint-plugin & eslint-config for vue

38,060

Version History

Version Released License
1.0.4 MIT
1.0.3 MIT
1.0.2 MIT
1.0.1 MIT
1.0.0 MIT