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

v0.1.5

Published

KQInfo ESLint 规则集

Readme

eslint-plugin-kqinfo

KQInfo 通用 ESLint 规则集。

已内置规则

  • kqinfo/no-env-hardcoded-redirect文档
    • 禁止通过 process.env.REMAX_APP_PLATFORM 分支,并在分支内直接硬编码 window.location.href/assign/replace 跳转 URL;建议统一从 @/config/env.ts 读取跳转地址。
  • kqinfo/no-direct-remax-app-env-check文档
    • 禁止在业务代码中直接使用 process.env.REMAX_APP_ENV 判断环境,应通过 envService 导出的函数判断。

安装

yarn add -D eslint-plugin-kqinfo

使用

方式一:推荐配置

// .eslintrc.js
module.exports = {
  extends: ['plugin:kqinfo/recommended'],
};

方式二:按规则单独启用

// .eslintrc.js
module.exports = {
  plugins: ['kqinfo'],
  rules: {
    'kqinfo/no-env-hardcoded-redirect': 'error',
    'kqinfo/no-direct-remax-app-env-check': 'error',
  },
};

第二条规则示例

错误示例

if (process.env.REMAX_APP_ENV === 'production') {
  doSomething();
}

正确示例

import { isProd } from '@/utils/envService';

if (isProd()) {
  doSomething();
}

规则示例

错误示例

if (process.env.REMAX_APP_PLATFORM === 'production') {
  window.location.href = 'https://wx.cqrenji.cn/hu-patients/p40005/#/pages/onlineQuery/index';
} else {
  window.location.href = 'https://wx.cqrenji.cn/hu-patients-dev/p40005/dev/#/pages/onlineQuery/index';
}

正确示例

import { onlineQueryUrl } from '@/config/env';

window.location.href = onlineQueryUrl;

本地测试

npm test

发布

# 1) 为本次变更新增 changeset 说明(会生成 .changeset/*.md)
npm run changeset

# 2) 生成版本号与 CHANGELOG.md
npm run changeset:version

# 3) 提交版本文件后发布到 npm
npm run changeset:publish

GitLab CI 自动发布(自部署)

仓库已提供 .gitlab-ci.yml,包含 testreleasepublish 三个阶段:

  • test:普通分支提交时执行 npm test
  • release:默认分支 push 时,若存在 changeset,则自动执行 changeset version、提交版本变更并打 vX.Y.Z 标签。
  • publish:当推送 v* 标签时自动执行 npm publish

在 GitLab 项目变量中至少配置:

  • RELEASE_GITLAB_TOKEN:用于 push release commit 与 tag,建议使用具备 write_repository 权限的 Project Access Token。
  • NPM_TOKEN:npm 发布令牌。
  • NPM_TOKEN 轮换要求:npm 发布相关令牌最长有效期为 90 天,需在到期前更新 GitLab CI 变量中的 NPM_TOKEN,否则会在发布阶段出现 401 Unauthorized
  • GITLAB_RELEASE_USER_NAME(可选):发布提交用户名,默认 release-bot
  • GITLAB_RELEASE_USER_EMAIL(可选):发布提交邮箱,默认 release-bot@local

建议将上述变量设置为 Masked + Protected,并仅允许受保护分支/标签触发发布。