javascript - Visual Studio Code 在多行上对齐函数参数

标签 javascript visual-studio-code indentation code-formatting auto-indent

如果 Javascript(或 Typescript)函数签名有多行参数(在 Typescript 中很容易发生,具有更长的类型名称),Visual Studio Code 在我点击 return 后缩进:

enter image description here

我更喜欢它排列参数,像这样:

enter image description here enter image description here

是否有设置可以自动执行此操作,这样我就不必手动缩进代码?

(我也想为函数调用做这个。)

最佳答案

如果它们可以为您完成,可能会检查一些 linters。在 Extensions 中搜索 eslint 或 tslint 等插件。

关于javascript - Visual Studio Code 在多行上对齐函数参数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55889085/

相关文章:

javascript - 通过jquery访问动态元素

visual-studio-code - 如何在使用空数组时阻止 Prettier 强制换行

Python open() 需要完整路径

Python:使用 4 个空格进行缩进。为什么?

javascript - 文本文件如何逐行发送到浏览器

javascript - 尝试从另一个模块注入(inject)服务时出现未知提供者错误

javascript - 多级可折叠 Bootstrap 侧边导航菜单的问题

node.js - 如何在 vscode 中获取 express.js 的智能感知

html - float 元素旁边的自编号列表的文本缩进错误

python - HOW TO : Use reindent. py for dummies