我有一个自述文件,其中包含文件夹的文档、包含的库以及如何使用它们。
自述文件不是任何库的一部分,因此 nx-lint 会引发此错误:
NX ERROR The following file(s) do not belong to any projects:
- libs/global/README.md
Run Code Online (Sandbox Code Playgroud)
我们怎样才能抑制这个错误?
笔记:
我尝试在顶级中使用 exclude ,tslint.json如下所示:
{
"exclude": [
"libs/global/*.md"
],
Run Code Online (Sandbox Code Playgroud)
.nxignore您可以使用项目根目录中的文件来解决此问题:
$ yarn lint\nyarn run v1.22.4\n$ nx workspace-lint && nx lint\n\n> NX ERROR The following file(s) do not belong to any projects:\n\n - libs/global/README.md\n\nerror Command failed with exit code 1.\ninfo Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.\n\n$ echo libs/global/README.md >> .nxignore\n\n$ yarn lint\nyarn run v1.22.4\n$ nx workspace-lint && nx lint\n\nLinting "server"...\n\nAll files pass linting.\n\n\xe2\x9c\xa8 Done in 2.45s.\nRun Code Online (Sandbox Code Playgroud)\n