eslint-import-resolver-node

中文文档
0.4.0发布于 2026/05/16MITCommonJS近 30 天下载 2.6亿

Node default behavior import resolution plugin for eslint-plugin-import.

原始使用文档

eslint-import-resolver-node

npm

Default Node-style module resolution plugin for eslint-plugin-import.

Published separately to allow pegging to a specific version in case of breaking changes.

Config is passed directly through to resolve as options:

settings:
  import/resolver:
    node:
      extensions:
        # if unset, default is just '.js', but it must be re-added explicitly if set
        - .js
        - .jsx
        - .es6
        - .coffee

      paths:
        # an array of absolute paths which will also be searched
        # think NODE_PATH
        - /usr/local/share/global_modules

      # this is technically for identifying `node_modules` alternate names
      moduleDirectory:

        - node_modules # defaults to 'node_modules', but...
        - bower_components

        - project/src  # can add a path segment here that will act like
                       # a source root, for in-project aliasing (i.e.
                       # `import MyStore from 'stores/my-store'`)

or to use the default options:

settings:
  import/resolver: node

版本与发布记录

eslint-import-resolver-node 共发布 18 个版本,首次发布于 2015/11/28;过去 12 个月发布了 2 个版本。

版本发布日期距今
0.4.0latest2026/05/165 个月前
0.3.102026/04/027 个月前
0.3.92023/08/083 年前
0.3.82023/08/053 年前
0.3.72023/01/123 年前
0.3.62021/08/165 年前

其他发布通道:next → 0.2.0。

关于 eslint-import-resolver-node 的常见问题

eslint-import-resolver-node 是什么?

Node default behavior import resolution plugin for eslint-plugin-import.

如何安装 eslint-import-resolver-node?

在项目目录运行 npm install eslint-import-resolver-node,或使用 pnpm add / yarn add / bun add。

eslint-import-resolver-node 支持 TypeScript 吗?

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

eslint-import-resolver-node 支持 ESM 还是 CommonJS?

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

eslint-import-resolver-node 可以商用吗?

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

eslint-import-resolver-node 的下载量有多少?

根据 npm 官方下载统计,eslint-import-resolver-node 在 2026/10/05 – 2026/11/03 这 30 天内被下载 256,173,051 次,日均约 8,539,102 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

eslint-import-resolver-node 还在维护吗?

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