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

@polyv/eslint-config

v1.0.0

Published

ESLint 10 flat config for Polyv Mini Program import checks.

Readme

@polyv/eslint-config

这是面向 ESLint 10.x 的 flat config 配置包,包含通用插件配置、JavaScript 配置、TypeScript 配置、Vue2 补充配置和微信小程序专项配置。

安装

npm install @polyv/eslint-config eslint@^10 --save-dev

配置导航

  • 通用配置:必须显式组合的基础配置,包含通用忽略项、运行 ESLint 时消费项目目录内的 .gitignorepolyv plugin 注册,以及 promisesonarjsimport-x 推荐规则。
  • Import-X 配置:提供 eslint-plugin-import-x 推荐规则和 node resolver 设置,已被通用配置继承。
  • SonarJS 配置:提供 eslint-plugin-sonarjs 推荐规则和项目内覆盖规则,已被通用配置继承。
  • JavaScript 配置:纯 JavaScript 项目使用,需和 polyv.configs.common 一起组合。
  • TypeScript 配置:TypeScript 或 TypeScript + JavaScript 混合项目使用,已集成 JavaScript 配置,需和 polyv.configs.common 一起组合。
  • Vue2 配置:Vue2 项目使用,提供 Vue2 SFC 解析、Vue2 essential 规则、ESLint 8 for-vue2-js.js 迁移规则和 Vue2 TypeScript 返回类型推导 settings。
  • 小程序配置:微信小程序项目使用,开启 polyv/no-relative-directory-index-imports 并处理小程序专项忽略。
  • Prettier 配置:接入 eslint-plugin-prettier/recommended 和共享 Prettier 选项,需要放在配置数组最后。

规则导航

快速选择

纯 JavaScript 项目:

// eslint.config.mjs
import polyv from '@polyv/eslint-config';

export default [
  ...polyv.configs.common,
  ...polyv.configs.js
];

TypeScript 或 TypeScript + JavaScript 混合项目:

// eslint.config.mjs
import polyv from '@polyv/eslint-config';

export default [
  ...polyv.configs.common,
  ...polyv.configs.ts
];

Vue2 JavaScript 项目:

// eslint.config.mjs
import polyv from '@polyv/eslint-config';

export default [
  ...polyv.configs.common,
  ...polyv.configs.js,
  ...polyv.configs.vue2
];

Vue2 TypeScript 项目:

// eslint.config.mjs
import polyv from '@polyv/eslint-config';

export default [
  ...polyv.configs.common,
  ...polyv.configs.ts,
  ...polyv.configs.vue2
];

微信小程序项目:

// eslint.config.mjs
import polyv from '@polyv/eslint-config';

export default [
  ...polyv.configs.common,
  ...polyv.configs.miniprogram
];

需要接入 Prettier 时,把 polyv.configs.prettier 放在最后:

// eslint.config.mjs
import polyv from '@polyv/eslint-config';

export default [
  ...polyv.configs.common,
  ...polyv.configs.js,
  ...polyv.configs.prettier
];

插件和规则

  • polyv.configs.common 会默认注册 polyv plugin。如果已经引用了 polyv.configs.common,则无需额外注册该插件。
  • 只需要单独使用自定义规则时,可以引入 plugin@polyv/eslint-config/plugin 后手动注册。
  • 当前自定义规则:

Prettier 配置

消费项目如果需要单独给 Prettier 使用共享配置,可以引入:

// prettier.config.mjs
import prettierConfig from '@polyv/eslint-config/prettier-config';

export default prettierConfig;