npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

eslint-plugin-vueunused

v0.5.2

Published

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

Downloads

7

Readme

ENGLISH | 中文

eslint-plugin-vueunused

一个用于检测vue单个文件组件中死代码的eslint插件。

安装

首先你需要安装 ESLint:

$ npm i eslint --save-dev

然后, 安装 eslint-plugin-vueunused

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

注意: 如果您全局安装了ESLint(使用-g标志),则还必须全局安装eslint-plugin-vueunused

使用方法

vueunused 添加至你的 .eslintrc 配置文件中的plugins部分. 你可以省略 eslint-plugin- 前缀:

{
    "plugins": [
        "vueunused"
    ]
}

然后继承插件推荐配置即可

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

支持的规则

只有一条规则

  1. vueunused/unused

警告

该插件与eslint-plugin-html不兼容,因为该插件可能会破坏您的scf(.vue)组件模板信息,如果你一定要共用eslint-plugin-html 可以考虑再.eslintrc.js中添加

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

使用该配置指定需要使用eslint-plugin-html的 文件,不要lint.vue即可。 我建议您使用eslint-plugin-vue,本插件用于弥补eslint-plugin-vue某些未完成的功能,例如no-unused-methods,no-unused-variables,等等挂载在this上的属性实际上,您在组件范围内定义的大多数未使用的属性都可以被检测到。

建议

如果您使用VSCode编辑器,我强烈建议您安装ESlint VSCode插件,它可以用更加直观的方式指出单文件中的死代码。