sách gpt4 ai đã đi

lint - 如何定义 nx-lint 的异常?

In lại 作者:行者123 更新时间:2023-12-04 11:30:48 35 4
mua khóa gpt4 Nike

我有一个自述文件,其中包含文件夹的文档、包含的库以及如何使用它们。

自述文件不是任何库的一部分,因此 nx-lint 会引发此错误:

 NX ERROR The following file(s) do not belong to any projects:   
- libs/global/README.md

我们怎样才能抑制这个错误?

笔记:
  • 我不想将文件移动到库中 - 该文件就在它现在的位置。
  • 我不想在可见的自述文件中添加内容
  • 理想情况下,我们只抑制此文件的特定错误

  • 我试图在顶级 tslint.json 中使用 exclude像这样:
    {
    "exclude": [
    "libs/global/*.md"
    ],

    1 Câu trả lời

    您可以使用文件 .nxignore在项目根目录中解决此问题:

    $ yarn lint
    yarn run v1.22.4
    $ nx workspace-lint && nx lint

    > NX ERROR The following file(s) do not belong to any projects:

    - libs/global/README.md

    error Command failed with exit code 1.
    info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

    $ echo libs/global/README.md >> .nxignore

    $ yarn lint
    yarn run v1.22.4
    $ nx workspace-lint && nx lint

    Linting "server"...

    All files pass linting.

    ✨ Done in 2.45s.

    关于lint - 如何定义 nx-lint 的异常?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/61526225/

    35 4 0
    行者123
    Hồ sơ cá nhân

    Tôi là một lập trình viên xuất sắc, rất giỏi!

    Nhận phiếu giảm giá Didi Taxi miễn phí
    Mã giảm giá Didi Taxi
    Giấy chứng nhận ICP Bắc Kinh số 000000
    Hợp tác quảng cáo: 1813099741@qq.com 6ren.com