Mit*_*tsa 5 javascript eslint sonarqube visual-studio-code prettier
在 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
Run Code Online (Sandbox Code Playgroud)
不是最好的解决方案,但至少解决了问题。
根据这个问题,我发现谷歌搜索“Prettier Nosonar”,目前没有解决方法 \xe2\x80\x93 如果 Prettier 决定评论应该移动,它会很好地移动它。
\n\n没有任何注释白名单应该保留在最初编写的行上。
\n| 归档时间: |
|
| 查看次数: |
6149 次 |
| 最近记录: |