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-config-hxy

v1.0.1

Published

A comprehensive ESLint configuration with best practices for React and Vue projects.

Readme

ESLint 最佳实践配置

一个全面的 ESLint 配置,包含 React 和 Vue 项目的最佳实践。

特性

  • TypeScript 支持
  • React 最佳实践
  • Vue 2 和 Vue 3 支持
  • Prettier 集成
  • 编辑器设置推荐
  • EditorConfig 支持

安装

npm install --save-dev eslint-config-best-practices

使用方式

React 项目

在项目根目录创建 .eslintrc.js

module.exports = {
  extends: ['eslint-config-best-practices/react']
};

Vue 2 项目

module.exports = {
  extends: ['eslint-config-best-practices/vue2']
};

Vue 3 项目

module.exports = {
  extends: ['eslint-config-best-practices/vue3']
};

编辑器设置

本包包含了 EditorConfig 和推荐的编辑器设置,以确保代码格式的一致性。

EditorConfig

包中包含了一个 .editorconfig 文件,大多数现代编辑器会自动使用这些设置。这确保了在不同编辑器和 IDE 中保持一致的编码风格。

主要设置说明:

  • Tab 大小:2 个空格(确保代码缩进统一)
  • 使用空格代替 Tab(避免不同编辑器显示不一致)
  • UTF-8 编码(确保中文等特殊字符正确显示)
  • 删除行尾空格(保持代码整洁)
  • Unix 风格的行尾(确保跨平台一致性)

VS Code 设置

在 VS Code 的 settings.json 中添加以下设置:

{
  "editor.formatOnSave": true,  // 保存时自动格式化
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true  // 保存时自动修复 ESLint 错误
  }
}

IntelliJ/WebStorm 设置

  1. 安装 EditorConfig 插件
  2. 重启 IDE
  3. 设置将自动生效

Prettier 配置

本包包含了一个默认的 Prettier 配置,具体设置如下:

{
  "semi": true,  // 语句末尾使用分号
  "singleQuote": true,  // 使用单引号
  "tabWidth": 2,  // 缩进宽度为 2 个空格
  "trailingComma": "es5",  // 在对象和数组中使用尾随逗号
  "printWidth": 100,  // 每行最大字符数
  "bracketSpacing": true,  // 对象字面量中的括号间添加空格
  "arrowParens": "avoid",  // 箭头函数参数尽可能省略括号
  "endOfLine": "auto"  // 自动检测行尾风格
}

你可以:

  1. 直接使用默认配置,无需额外设置
  2. 在项目根目录创建 .prettierrc 文件来覆盖特定规则
  3. 建议保持 tabWidth: 2 的一致性

许可证

MIT