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 🙏

© 2026 – Pkg Stats / Ryan Hefner

eslint-plugin-fancy-mini

v1.0.0

Published

eslint plugin for fancy-mini

Readme

eslint-plugin-fancy-mini

eslint plugin for fancy-mini lib.

Installation

npm install --save-dev eslint-plugin-fancy-mini

Usage

开启eslint(wepy项目)

  1. 根目录/wepy.config.js 中设置:eslint: true
  2. 根目录/.eslintrc.js 中
module.exports = {
  root: true,
  parser: 'babel-eslint',
  parserOptions: {
    sourceType: 'module'
  },
  env: {
    browser: true
  },
  // https://github.com/feross/standard/blob/master/RULES.md#javascript-standard-style
  // extends: 'standard', //注掉使用标准规则集,此时,所有内置lint规则均默认关闭
  // required to lint *.wpy files
  plugins: [
    'html', //保留html插件,否则eslint会在<template>部分报错
    'fancy-mini' //引入自定义lint插件
  ],
  settings: {
    'html/html-extensions': ['.html', '.wpy'] //将.wpy加入html后缀,避免其中的DOM部分和css部分被当成js解析
  },
  // add your custom rules here
  'rules': {
    'fancy-mini/navigate-wxapi': 'error', //配置自定义规则的警告级别:'error', 'warn',  'off'
    'fancy-mini/navigate-onunload': 'error',
  }
}

禁用规则

  • 全局禁用
    可在.eslintrc.js中配置自定义规则的级别:'error'-报错, 'warn'-警告, 'off'-关闭,参见上文。
  • 局部禁用
    // eslint-disable-next-line fancy-mini/navigate-wxapi
    wx.navigateTo({ //对此行代码不进行规则"fancy-mini/navigate-wxapi"的检查
      url: url
    })
    如上例所示,可以使用注释对下一行代码禁用指定规则。更多配置方式参见:eslint 文档

添加规则

  • 在lib/rules新建js文件,文件名即为规则名
  • 编写规则,格式参见现有规则文件 或 eslint api
  • 修改package.json中version字段,增大版本号并发布
  • 项目中更新插件版本
  • 新规则开始生效

Supported Rules

  • fancy-mini/navigate-wxapi 无限层级路由策略——所有页面跳转统一使用自定义模块提供的api,而不直接调用wx/wepy提供的路由接口
  • fancy-mini/navigate-onunload
    无限层级路由策略——所有页面若有自定义onUnload函数,需在函数中执行父类相应钩子: super.onUnload && super.onUnload()