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

@ebullience/web-project-config

v0.2.3

Published

前端项目代码配置文件

Readme

@ebullience/web-project-config

前端项目代码配置文件

npm i -D @ebullience/web-project-config

请使用node16及其以上版本

所有配置只支持原生或react项目

配置eslint

项目根目录下新建配置文件.eslintrc.js:

const config = require('@ebullience/web-project-config').eslint;

module.exports = {
  ...config,
  rules: {
    ...config.rules,
    // 自己的规则
  }
}

重启ide或编辑器可完成识别

规则限制了any和require的使用,如果项目中用到了大量any和require,可以设置以下规则忽略:

const rules = {
  // 关闭any检测
  '@typescript-eslint/no-explicit-any': 'off',
  // 关闭require检测
  '@typescript-eslint/no-var-requires': 'off'
}

配置stylelint

项目根目录下新建配置文件.stylelintrc.js:

const config = require('@ebullience/web-project-config').stylelint;

module.exports = {
  ...config,
  rules: {
    ...config.rules,
    // 自己的规则
  }
}

重启ide或编辑器可完成识别

配置prettier

项目根目录下新建配置文件.prettierrc.js:

const config = require('@ebullience/web-project-config').prettier;

module.exports = {
  ...config,
  // 自己的规则
}

重启ide或编辑器可完成识别

规则强制使用单引号和句尾分号,如果项目中有大量双引号或者不带句尾分号,可以设置以下规则忽略:

const rules = {
  // 使用双引号
  singleQuote: false,
  // jsx中使用双引号
  jsxSingleQuote: false,
  // 不使用句尾分号
  semi: false
}

配置typescript

目前一共有两个ts配置文件:

1. typescript-web/tsconfig.json

用于编写直接在浏览器中执行的代码,编译后只会去掉类型说明,保留最新es特性。该配置不兼容node特性比如node_modules。

项目根目录下新建配置文件tsconfig.json:

{
  "extends": "@ebullience/web-project-config/typescript-web/tsconfig.json"
}
2. typescript-node/tsconfig.json

用于编写前端库,编译后会去掉类型说明,并去除最新es特性。编译后的代码会在node中交给前端打包器进一步处理。

项目根目录下新建配置文件tsconfig.json:

{
  "extends": "@ebullience/web-project-config/typescript-node/tsconfig.json"
}

如果项目没有浏览器兼容性要求web环境可以使用最新es特性,可以配置target选项在ts编译时不转化es特性只去掉类型说明

{
  "extends": "@ebullience/web-project-config/typescript-node/tsconfig.json",
  "compilerOptions": {
    "target": "esnext"
  }
}

如果项目库中包含js,需要编译js文件,可以配置允许编译js文件选项

{
  "extends": "@ebullience/web-project-config/typescript-node/tsconfig.json",
  "compilerOptions": {
    "allowJs": true
  }
}

重启ide或编辑器可完成识别