Socket
Book a DemoInstallSign in
Socket

eslint-plugin-vueunused

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-vueunused

a eslint plugin for detecting unused code in vue single file component

latest
npmnpm
Version
0.5.2
Version published
Maintainers
1
Created
Source

ENGLISH | 中文

eslint-plugin-vueunused

a eslint plugin for detecting unused code in vue single file component

Installation

You'll first need to install ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-vueunused

$ npm install eslint-plugin-vueunused --save-dev

Note: If you installed ESLint globally (using the -g flag) then you must also install eslint-plugin-vueunused globally.

Usage

Add vueunused to the plugins section of your .eslintrc configuration file. You can omit the eslint-plugin- prefix:

{
    "plugins": [
        "vueunused"
    ]
}

Just extends the plugin's recommended configuration

{
    "extends": ["plugin:vueunused/recommend"],
}

Supported Rules

only one rule

  • vueunused/unused

Warning

This plugin is not compatible with eslint-plugin-html,cause that plugin could destroy your scf(.vue) component template information, But if you need to use eslint-plugin-html to lint your .html file, you could add setting as below to lint your html file only.

module.exports = {
  ...
  settings: {
    'html/html-extensions': ['.html'] // consider .html and .we files as HTML
 }
}

.I recommend you use eslint-plugin-vue, this plugin is also used to make up for the feature that did not complete, like no-unused-methods,no-unused-variables and so on, actually most of property you defined in the component scope which is not used it can detect it.

Tips

If you use the VSCode editor, I strongly recommend that you install the ESlint VSCode plugin, which can point out dead code in a single file in a more intuitive way.

Keywords

eslint

FAQs

Package last updated on 19 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts