当使用 prettier / prettier-now 进行保存时格式化时,当一个函数包装另一个函数时,它会中断到一个新行,我想知道是否有办法阻止这种行为?
例如:
期望的输出:
app.get('/campgrounds/:id', catchAsync(async (req, res) => {
const campground = await Campground.findById(req.params.id);
res.render('campgrounds/show', { campground });
}));
Run Code Online (Sandbox Code Playgroud)
更漂亮/现在更漂亮输出:
app.get(
'/campgrounds/:id',
catchAsync(async (req, res) => {
const campground = await Campground.findById(req.params.id);
res.render('campgrounds/show', { campground });
})
);
Run Code Online (Sandbox Code Playgroud)