import-js/eslint-plugin-import

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

開放

#2,096 建立於 2021年5月24日

 (27 則留言) (0 個反應) (0 位負責人)JavaScript (1,549 個分叉)batch import
enhancementhelp wanted

倉庫指標

星標
 (5,940 顆星)
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

貢獻者指南