eslint-plugin-vue
's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.Name | Version | Size | License | Type | Vulnerabilities |
---|---|---|---|---|---|
@eslint-community/eslint-utils | 4.4.0 | 62.2 kB | MIT | prod | |
eslint | 8.57.0 | 2.9 MB | MIT | prod peer | |
natural-compare | 1.4.0 | 2.45 kB | MIT | prod | |
nth-check | 2.1.1 | 8.38 kB | BSD-2-Clause | prod | |
postcss-selector-parser | 6.0.16 | 181.61 kB | MIT | prod | |
semver | 7.6.0 | 26.57 kB | ISC | prod | |
vue-eslint-parser | 9.4.2 | 192.57 kB | MIT | prod | |
xml-name-validator | 4.0.0 | 4.58 kB | Apache-2.0 | prod |
ESLint-plugin-vue is an official plugin for Vue.js that enables ESLint to lint Vue.js specific syntax. This JavaScript utility assists developers in adhering to specific coding guidelines and syntax styles to make the code more readable and maintainable. The plugin is particularly helpful when dealing with Vue.js single file components which are not plain JavaScript files but come in a custom format. With ESLint-plugin-vue, developers can ensure that their Vue.js code is consistent and conforms to best practices.
To use the ESLint-plugin-vue, you'll first need to install the plugin. You can easily do so via npm:
npm install eslint eslint-plugin-vue --save-dev
After the plugin has been installed, you'll need to configure it in your ESLint configuration file (this can be a .eslintrc
file or a key in your package.json
file). After creating the file, you can specify the rules you want to apply for the Vue.js code. Here's a simple example:
{
"extends": ["eslint:recommended", "plugin:vue/essential"],
"rules": {
// override/add rules' settings here
"vue/no-unused-vars": "error"
}
}
In the above configuration, the ESLint-plugin-vue is extended with the "essential" configuration setting, and the "vue/no-unused-vars" rule is set to "error" level which will highlight any unused variables in your Vue.js code.
The complete documentation for ESLint-plugin-vue can be found on the official website at https://eslint.vuejs.org. This online guide contains everything you need to understand and use the ESLint-plugin-vue effectively including its installation, configuration, usage, rules, and more. If you're a developer working with Vue.js, this comprehensive guide is your go-to source for enforcing best practices in your Vue.js code.