在同一项目中使用 TS 别名路径时出现错误:Projects should use relative imports to import from other files within the same project
我不想要这种行为。知道如何禁用吗?
我尝试玩@nrwl/nx/enforce-module-boundaries
选项,但几乎没有关于其选项的文档
// NX doesn't like this line which uses a path to a file within the
// same NX project. It wants me to use relative pathing, which I
// don't want to use
import { fooHandler } from '@handlers/foo';
不得不查看 npm 包,但通过搜索错误文本找到了它。您可以从 .eslintrc.json 设置内部像这样禁用它:
{
"overrides": [
{
"files": ["*.ts", "*.tsx", "*.js", "*.jsx"],
"rules": {
"@nrwl/nx/enforce-module-boundaries": [
"error",
// This is the part you need to add
{ "allowCircularSelfDependency": true }
]
}
}
]
}
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)