@devacademy/eslint-config

中文文档
1.10.2发布于 2026/01/28ISCCommonJS构建来源已验证近 30 天下载 2628

Linting configuration for EDA challenges and projects

原始使用文档
文档目录5 节
  1. Installation
  2. Peer dependencies
  3. Usage
  4. Easy fixing in VS Code
  5. Finding all errors in your project

eslint-config-eda

Linting configuration for Enspiral Dev Academy (EDA) challenges and projects.

Installation

npm i -D eslint prettier eslint-config-eda

Peer dependencies

If your npm version is between earlier than 7, it will not install peer-dependencies automatically, instead it will print a warning when you install eslint-config-eda

You can see your npm version with the -v or --version flag. This is what it looks like with npm v8.4.1

$ npm -v
8.4.1

if your version is between 5.2-6.x, you can run the following to install the peer dependencies of eslint-config-eda

$ npx install-peerdeps --dev eslint-config-eda
install-peerdeps v3.0.3
Installing peerdeps for eslint-config-eda@latest.
npm install [email protected] eslint@^8.8.0 eslint-plugin-import@^2.25.4 eslint-plugin-jest@^26.0.0 eslint-plugin-node@^11.1.0 eslint-plugin-prettier@^4.0.0 eslint-plugin-promise@^6.0.0 eslint-plugin-react@^7.28.0 --save-dev

Usage

Add eda to the extends section of your configuration file (you can omit the eslint-config- prefix). This is a minimal .eslintrc.json file (it goes in the root of your project):

{
  "extends": "eda"
}

if your project includes react and JSX syntax, extend the react ruleset instead:

{
  "extends": "eda/react"
}

Easy fixing in VS Code

If you're using VS Code and want to fix linting and formatting errors painlessly install:

and add these lines to your settings.json

"editor.codeActionsOnSave": {
  "source.fixAll.eslint": true
},

"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
   "editor.defaultFormatter": "esbenp.prettier-vscode"
}

Now everytime you explicitly save the file (autosaving doesn't count), ESLint will fix as many errors as it can.

Tip: if you have syntax errors in the file, you'll need to fix them before your linting errors can be fixed for you.

Finding all errors in your project

These instructions assume that your source files are in folders in your project root called "server" and "client". Adjust accordingly

  1. Add "lint": "eslint client server" to the scripts section of your package.json file
  2. Add "format": "prettier -w client server" to the scripts section of your package.json file
  3. Add a .eslintignore file to the root of your project with these contents: bundle.js (and any other files/folders you want ESLint to ignore)

Now you simply run npm run lint to see all of the linting errors in your project.

Pro tip: Run npm run lint -- --fix to instruct ESLint to fix as many of the errors as it can, you can also run npm run format to correct the formatting of your source files.

版本与发布记录

@devacademy/eslint-config 共发布 12 个版本,首次发布于 2022/08/23;过去 12 个月发布了 1 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
1.10.2latest2026/01/289 个月前
1.10.12024/05/012 年前
1.10.02024/05/012 年前
1.9.12023/04/263 年前
1.9.02023/04/263 年前
1.8.02023/01/303 年前

关于 @devacademy/eslint-config 的常见问题

@devacademy/eslint-config 是什么?

Linting configuration for EDA challenges and projects

如何安装 @devacademy/eslint-config?

在项目目录运行 npm install @devacademy/eslint-config,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:@typescript-eslint/eslint-plugin(^7.8.0)、eslint(^8.57.1)、eslint-plugin-import(^2.32.0)、eslint-plugin-jsx-a11y(^6.10.2)、eslint-plugin-node(^11.1.0)、eslint-plugin-promise(^7.2.1)、eslint-plugin-react(^7.37.5)、eslint-plugin-react-hooks(^7.0.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@devacademy/eslint-config 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/devacademy__eslint-config 是否存在。

@devacademy/eslint-config 支持 ESM 还是 CommonJS?

以 CommonJS 形式发布,可以直接 require();在 ES Module 项目中也可以用 import 引入(Node.js 会把 module.exports 作为默认导出)。

@devacademy/eslint-config 需要什么版本的 Node.js?

package.json 的 engines 字段要求 Node.js >=10.0.x。版本不符时 npm 默认只给出警告,开启 engine-strict 后会拒绝安装。

@devacademy/eslint-config 可以商用吗?

@devacademy/eslint-config 使用 ISC 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@devacademy/eslint-config 的下载量有多少?

根据 npm 官方下载统计,@devacademy/eslint-config 在 2026/10/12 – 2026/11/10 这 30 天内被下载 2,628 次,日均约 88 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@devacademy/eslint-config 还在维护吗?

最新版本 1.10.2 发布于 2026/01/28(9 个月前);至今共发布 12 个版本,其中过去 12 个月发布了 1 个;首次发布于 2022/08/23。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。