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

v3.1.1

Published

一套我自己用着觉得舒服的 eslint 规则

Readme

eslint-config-sufu

一套我自己用着觉得舒服的 eslint 规则。

这套规则参考了许多 eslint-config-alloy 里的配置,如果你不喜我这个配置,建议你去看看 eslint-config-alloy 的。

不同于 eslint-config-alloy,该配置并没有使用 Prettier 来格式化代码,因为我觉得 Prettier 的可配置性不够,格式化出来的代码很多时候达不到要求。

使用方法

1. 安装

npm install --save-dev eslint-config-sufu

2. 创建 eslint.config.js

const sufu = require('eslint-config-sufu');

module.exports = [
    /**
     * 如果你的项目只有 javascript 那就选 js
     * 如果你的项目只有 typescript 那就选 ts
     * 如果你的项目既有 javascript 又有 typescript 那就选 js-ts
     */
    ...sufu['js-ts'],
    {
        rules: {
            /**
             * 添加自定义规则
             */
        }
    }
];

3. 在 package.json 中添加以下 script

这里只对 srctest 文件夹进行了检查,实际使用时可以修改

{
    "lint-js": "eslint --max-warnings 0 \"{src,test}/**/*.{js,mjs,cjs,jsx}\"",
    "lint-ts": "eslint --max-warnings 0 \"{src,test}/**/*.{ts,mts,cts,tsx}\"",
    "lint-js-ts": "eslint --max-warnings 0 \"{src,test}/**/*.{js,mjs,cjs,jsx,ts,mts,cts,tsx}\"",
}

常见问题

如果遇到类似于以下的报错

Parsing error: "parserOptions.project" has been provided for @typescript-eslint/parser.
The file was not found in any of the provided project(s): test\index.test.ts

那大概率是因为你正在 Lint 的文件并没有包含在 tsconfig.jsoninclude 当中。

第一种解决办法就是把你要 Lint 的文件添加到 include 当中。

第二种解决办法就是创建一个 tsconfig.eslint.json 文件

{
    "extends": "./tsconfig.json",
    "include": ["**/*"]
}

接着在 eslint.config.js 中添加下面这条规则

{
    files: ['**/*.{ts,mts,cts,tsx}'],
    languageOptions: {
        parserOptions: {
            project: './tsconfig.eslint.json',
            projectService: false
        }
    }
}