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

my-code-style

v1.0.0

Published

Lint/Format/Git 配置工程化 npm 包(ESLint + Prettier + Stylelint + Commitlint + Husky + standard-version)

Readme

my-code-style

Lint/Format/Git 配置工程化 npm 包。适用于 Vue 3 + TypeScript + uni-app 项目。

支持 ESLint v8 (.eslintrc.cjs) 和 ESLint v9 (Flat Config) 双格式,支持 SCSS 和 Less 样式检查。

快速开始

pnpm add -D my-code-style
npx my-code-style-init

init 脚本会自动检测项目的 ESLint 版本和 CSS 预处理器,生成对应的配置文件。

生成的文件

| 文件 | 说明 | |------|------| | .eslintrc.cjs | ESLint 配置(v8 项目,TypeScript + Vue 3 + uni-app) | | eslint.config.ts | ESLint Flat Config(v9 项目,TypeScript + Vue 3 + uni-app) | | .prettierrc.cjs | Prettier 格式化配置 | | .prettierignore | Prettier 忽略文件(跳过二进制文件) | | .stylelintrc.cjs | Stylelint CSS/SCSS/Less 配置 | | .commitlintrc.cjs | Git commit 信息规范 | | .versionrc.js | 自动版本号 + CHANGELOG 生成 | | .editorconfig | 编辑器基础配置 | | .gitattributes | Git 文件类型处理(统一 EOL=LF,标记二进制文件) | | .husky/commit-msg | Git hook: commitlint | | .husky/pre-commit | Git hook: lint-staged |

手动使用(不通过 init)

ESLint v8 (.eslintrc.cjs)

// .eslintrc.cjs
module.exports = require("my-code-style/eslint/uniapp")

// 或按需引入中间层
const base = require("my-code-style/eslint")        // 基础 TypeScript
const vue3 = require("my-code-style/eslint/vue3")   // + Vue 3 规则

ESLint v9 (Flat Config / eslint.config.ts)

// eslint.config.ts
import uniappConfig from "my-code-style/eslint/flat/uniapp"

// 或按需引入中间层
import baseConfig from "my-code-style/eslint/flat/base"
import vue3Config from "my-code-style/eslint/flat/vue3"

其他配置

// .prettierrc.cjs
module.exports = require("my-code-style/prettier")

// .stylelintrc.cjs
module.exports = require("my-code-style/stylelint")

// .commitlintrc.cjs
const base = require("my-code-style/commitlint")
const { generateScopes, guessCurrentScope } = require("my-code-style/commitlint/scopes")
module.exports = { ...base, prompt: { ...base.prompt, scopes: generateScopes("src") } }

// .versionrc.js
module.exports = require("my-code-style/versionrc")

配置覆盖

// .eslintrc.cjs
const base = require("my-code-style/eslint/uniapp")
module.exports = {
    ...base,
    rules: {
        ...base.rules,
        "no-console": "warn",
    },
}

导出入口

| 入口 | 说明 | |------|------| | my-code-style | 默认:ESLint v8 uni-app 配置 | | my-code-style/eslint | 基础 ESLint v8(TypeScript) | | my-code-style/eslint/vue3 | + Vue 3 规则 | | my-code-style/eslint/uniapp | + uni-app globals | | my-code-style/eslint/flat | ESLint v9 Flat Config 基础 | | my-code-style/eslint/flat/vue3 | + Vue 3 规则 | | my-code-style/eslint/flat/uniapp | + uni-app globals | | my-code-style/prettier | Prettier 配置 | | my-code-style/stylelint | Stylelint 配置(SCSS + Less) | | my-code-style/stylelint/less-override | Less 专用覆写配置 | | my-code-style/commitlint | Commitlint 基础配置 | | my-code-style/commitlint/scopes | 动态 scope 工具函数 | | my-code-style/versionrc | standard-version 配置 |

特性

  • 双引号quotes: ["error", "double", { avoidEscape: false, allowTemplateLiterals: true }]
  • 4 空格缩进tabWidth: 4
  • 无分号semi: false.nvue 文件除外)
  • 行宽 100printWidth: 100
  • 小程序适配:允许 rpx 单位、page 标签、::v-deep 伪类
  • uni-app globalsuniUniAppwxgetCurrentPages
  • Less 支持postcss-less 解析、@ 变量放行、::v-deep 伪元素
  • 双 ESLint 格式:v8 (.eslintrc.cjs) 和 v9 (Flat Config) 自动检测

License

MIT