首页 > 解决方案 > 防止 vs 代码将 Express JS 代码格式化为换行符

问题描述

Vs code 在格式上做了这个

app.get(
"/user/:id",
function(req, res, next) {
   if (req.params.id === "0") next("route");
   else next();
},
function(req, res, next) {
   res.send("regular");
}
);

我需要这个

app.get("/user/:id",function(req, res, next) {
   if (req.params.id === "0") next("route");
   else next();
},
function(req, res, next) {
   res.send("regular");
}
);

我已经尝试过这个可能的答案,但没有帮助

"eslint.format.enable": false "javascript.suggest.includeAutomaticOptionalChainCompletions": false,"

标签: javascriptformatvscode-settings

解决方案


推荐阅读