我补充了一条规则:
"newline-per-chained-call": [
"error",
{
"ignoreChainWithDepth": 2
}
]
到我的.eslintrc.json
文件。
我还扩展了"plugin:prettier/recommended"
。
现在,当我编写这样的代码时:
test.random2().random2()
.random3();
我在VSCode中得到了错误VSCode,这是我不想要的。如何修正配置以允许这种代码结构?
我的.prettierrc.json
看起来是这样的:
{
"singleQuote": true,
"useTabs": true,
"semi": true,
"bracketSameLine": true,
"endOfLine": "lf"
}
发布于 2022-05-11 18:11:09
不能用更漂亮的换行符,因为更漂亮的人不允许这种行为.唯一能做的就是删除新行-每链-调用或删除更漂亮的,或添加注释"//漂亮-忽略“前的链接行。
https://stackoverflow.com/questions/71884826
复制相似问题