![](/img/trans.png)
[英]Eslint or prettier is adding 2 semi colons to the end of a line in vscode
[英]How to use NOSONAR at the end of the line having ESLINT and Prettier configured?
在 VS 代码中使用editor.formatOnSave = true
,当试图忽略一些规则并在行尾使用 //NOSONAR 抑制错误时。 行评论正在下降。 如何以及在何处配置这些规则?
export const overviewReducer = (state = initialState, action) => { //NOSONAR
来到下一行,例如:
export const overviewReducer = (state = initialState, action) => {
//NOSONAR
我刚刚遇到了同样的问题。
使用prettier-ignore
对我有用:
// prettier-ignore
export const overviewReducer = (state = initialState, action) => { //NOSONAR
不是最好的解决方案,但至少它解决了问题。
根据这个问题,我在谷歌上搜索了“Prettier Nosonar” ,目前没有解决方法——如果 Prettier 决定应该移动一条评论,它会很好地移动它。
没有评论的白名单应该保留在他们最初写的行上。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.