![](/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.