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

@startdt/eslint-config

v2.7.3

Published

ESLint 可共享配置

Readme

@startdt/eslint-config dependencies

open source npm version node version npm peer dependency version npm download npm license

如何使用

npm i eslint @startdt/eslint-config --save-dev

提示:无需在项目中安装 eslint-plugin-vueeslint-config-* 以及其他第三方依赖。

使用配置文件:

// .eslintrc.js
module.exports = {
    extends: '@startdt/eslint-config',
    rules: {
        // 自定义规则
    },
};

或者项目属性:

// package.json
"eslintConfig": {
    "extends": "@startdt/eslint-config",
    "rules": {}
}

@typescript-eslint/eslint-plugin

如需在项目中支持 TypeScript 语法检测,请使用以下配置:

// .eslintrc.js
module.exports = {
    extends: [
        '@startdt/eslint-config',
        '@startdt/eslint-config/typescript',
    ],
    rules: {
        // 自定义规则
    },
};

注意:请确保 eslint --ext .js,.ts 包含目标文件,因为 ESLint 默认仅检测 .js 文件。

eslint-plugin-jest

默认文件匹配规则:

  • 任何 tests/unit 中以 .spec.(js|jsx|ts|tsx) 结尾的文件
  • 任何 __tests__ 目录中的 js(x)/ts(x) 文件
// .eslintrc.js
module.exports = {
    extends: [
        '@startdt/eslint-config',
        '@startdt/eslint-config/plugins/jest',
    ],
    rules: {
        // 自定义规则
    },
};

eslint-plugin-mocha

默认文件匹配规则:

  • 任何任何 tests/unit 中以 .spec.(js|ts) 结尾的文件
// .eslintrc.js
module.exports = {
    extends: [
        '@startdt/eslint-config',
        '@startdt/eslint-config/plugins/mocha',
    ],
    rules: {
        // 自定义规则
    },
};

eslint-plugin-cypress

默认文件匹配规则:

  • 任何 tests/e2e 中以 .spec.(js|ts) 结尾的文件
// .eslintrc.js
module.exports = {
    extends: [
        '@startdt/eslint-config',
        '@startdt/eslint-config/plugins/cypress',
    ],
    rules: {
        // 自定义规则
    },
};

eslint-plugin-import

eslint-import-resolver-lerna

导入解析配置:

// .eslintrc.js
module.exports = {
    extends: [
        '@startdt/eslint-config',
        '@startdt/eslint-config/resolver/lerna',
    ],
    rules: {
        // 自定义规则
    },
};

或者手动配置:

// .eslintrc.js
const path = require('path');

module.exports = {
    extends: '@startdt/eslint-config',
    settings: {
        'import/resolver': {
            lerna: {
                // 必须是 packages 目录的绝对路径,支持 string 或 array
                packages: path.resolve(__dirname, 'src/packages'),
            },
        },
    },
    rules: {
        // 自定义规则
    },
};

eslint-import-resolver-webpack

导入解析配置:

// .eslintrc.js
module.exports = {
    extends: [
        '@startdt/eslint-config',
        '@startdt/eslint-config/resolver/webpack',
    ],
    rules: {
        // 自定义规则
    },
};

或者手动配置:

// .eslintrc.js
module.exports = {
    extends: '@startdt/eslint-config',
    settings: {
        'import/resolver': {
            webpack: {
                // 指向 webpack.config.js 配置文件,支持相对路径或绝对路径
                config: 'node_modules/@vue/cli-service/webpack.config.js',
            },
        },
    },
    rules: {
        // 自定义规则
    },
};

错误级别

  1. 默认情况下,所有启用的规则都是 "error" 级别的严重程度;
  2. 已启用规则,且支持 --fix 选项自动修复的规则都是 "warn" 级别的严重程度;
  3. 未启用规则,默认将值设置为 "off" 进行显式配置,不产生任何错误信息;
  4. 继承的规则,包括插件的规则都遵循以上错误级别;