import-js/eslint-plugin-import

`eslint-plugin-import` breaks `eslint` if no `package.json`-file is present

Open

#2,096 创建于 2021年5月24日

在 GitHub 查看
 (27 评论) (0 反应) (0 负责人)JavaScript (1,540 fork)batch import
enhancementhelp wanted

仓库指标

Star
 (4,946 star)
PR 合并指标
 (平均合并 138天 22小时) (30 天内合并 3 个 PR)

描述

If there is no package.json-file in the file to check (or any parent directory), the eslint-run fails due to this piece of code: https://github.com/benmosher/eslint-plugin-import/blob/802ce7d49d912289d590f735bf9bd2d931064863/src/core/packagePath.js#L11-L12

Following error is reported:

TypeError [ERR_INVALID_ARG_TYPE]: The "path" argument must be of type string. Received null
Occurred while linting {filename}.js

贡献者指南