最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - nodeno-extraneous-require "resolvePaths" option doesn't seem to work with relative paths

programmeradmin3浏览0评论

I'm currently running eslint ^8.13.0 and eslint-plugin-node ^11.1.0. My repository has a package.json file in the root directory as well as an additional package.json file in a child directory.

I'm currently seeing a node/no-extraneous-require error on several packages. These packages are listed dependencies in the root package.json however the file that's importing them is in the directory that contains the second package.json file.

This issue seems like it would be easily fixed by adding the following to .eslintrc.json (which is also located in the root directory).

    "rules": {
        "node/no-extraneous-require": ["error", {
            "resolvePaths": ["./node_modules"],
        }]
    }

The above, however, does not resolve the issue. I'm using VSCode and wondering if anyone has experienced a similar issue using relative paths in an eslintrc.json file and/or if the path itself seems to be incorrect in some way.

Paths I've tried: "." "./" "./node_modules" "./node_modules/"

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论