有人能给我解释一下这两行代码的区别吗.在我的atom编辑器中,更漂亮的将第一个更改为第二个.
(await fetchSearchResults(state.requestConfig, context))?.facilities ?? [] )
和
await fetchSearchResults(state.requestConfig, context)?.facilities ?? [] )
有人能给我解释一下这两行代码的区别吗.在我的atom编辑器中,更漂亮的将第一个更改为第二个.
(await fetchSearchResults(state.requestConfig, context))?.facilities ?? [] )
和
await fetchSearchResults(state.requestConfig, context)?.facilities ?? [] )
Prettier changes the whole thing to follow the rules given in a Prettier config file.
In your specific case, the (await fetchSearchResults(state.requestConfig, context))
is useless, hence why Prettier strips it.
同时,它在classic 异步上下文中可能非常重要,如comment below中所述.也许可选的链接在这里更漂亮,不确定.
The default Vue2 ESlint configuration comes with plugin:vue/essential
and eslint:recommended
as defaults.
Here is a link where you could get more details as of why.
如果是Prettier only,请判断文档的options part或项目(或更高版本)中的.prettierrc
配置文件.