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-weapp2

v1.2.0

Published

a weapp eslint

Readme

eslint-plugin-weapp2

a weapp eslint

Installation

Install ESLint, this plugin, and the language plugins used by the mini program asset rules:

npm install eslint eslint-plugin-weapp2 @eslint/json @eslint/css --save-dev
# pnpm install eslint eslint-plugin-weapp2 @eslint/json @eslint/css --save-dev

Usage

For ESLint 10, use the bundled mini program flat config:

const { defineConfig } = require("eslint/config");
const weapp2 = require("eslint-plugin-weapp2");

module.exports = defineConfig([
  ...weapp2.configs["flat/weapp"],
]);

If your config loader cannot synchronously require() @eslint/json or @eslint/css, pass the language plugins explicitly:

const { defineConfig } = require("eslint/config");
const weapp2 = require("eslint-plugin-weapp2");

module.exports = (async () => {
  const json = (await import("@eslint/json")).default;
  const css = (await import("@eslint/css")).default;

  return defineConfig([
    ...weapp2.createFlatWeappConfig({ json, css }),
  ]);
})();

flat/weapp enables:

  • JS/WXS rules: weapp2/component, weapp2/import, weapp2/wx-navigate
  • JSON rules through @eslint/json: weapp2/component-import
  • WXSS rules through @eslint/css: weapp2/wxss-import
  • WXML rules through the built-in weapp2/wxml language: weapp2/wxml-import

If you only want the JS/WXS rules, use weapp2.configs["flat/recommended"].

If you're still on ESLint 8, you can keep using .eslintrc:

{
  "extends": ["eslint:recommended", "plugin:weapp2/recommended"]
}

Rules

💼 Configurations enabled in.
🧊 Set in the flat/recommended configuration.
🌐 Set in the flat/weapp configuration.
✅ Set in the recommended configuration.
🔧 Automatically fixable by the --fix CLI option.

| Name             | Description | 💼 | 🔧 | | :------------------------------------------------- | :---------------------------------------------------------------------------------- | :------ | :- | | component | 检查组件的 properties 属性是否规范 | 🧊 🌐 ✅ | 🔧 | | component-import | 基于 app.json 校验小程序组件配置文件中的路径(usingComponents / pages / tabBar 等) | 🌐 | | | import | 基于 app.json 检查小程序的 import/require 与动态跳转是否合法 | 🧊 🌐 ✅ | | | wx-navigate | 基于 app.json 校验 wx.navigateTo / redirectTo / switchTab / reLaunch 等跳转 API 的 url 是否合法 | 🧊 🌐 ✅ | | | wxml-import | 基于 app.json 校验 WXML 中 // 的 src 路径与分包边界 | 🌐 | | | wxss-import | 基于 app.json 校验 WXSS 的 @import 引用路径与分包边界 | 🌐 | |