我有一个自述文件,其中包含该文件夹的文档,所包含的库以及如何使用它们。
自述文件不属于任何库,因此nx-lint会引发此错误:
NX ERROR The following file(s) do not belong to any projects:
- libs/global/README.md
我们如何抑制此错误?
注意:
我试图在顶级tslint.json
中使用exc这样:
{
"exclude": [
"libs/global/*.md"
],
您可以使用项目根目录中的文件.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/globals/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/globals/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.