3

Like with sonar-java and the annotation @SuppressWarnings("squid:S2078"),
is there any way with sonar-js to ignore one rule on a block of code ??
The git repo doesn't have any exemple of that.

I develop a react-redux ES6 app and i have reducer with default value :

export default function myReducer(prev = initialState, action)  

and Sonar complain with "Function parameters with default values should be last".
But i can't change the order of the parameters of a reducer and i need a default value.

Kara
  • 6,115
  • 16
  • 50
  • 57
asicfr
  • 1,061
  • 1
  • 13
  • 30

1 Answers1

4

The options you have:

  • in your project administration in SQ you can set up ignoring some files for some rule (see docs)

  • you mark issues in SQ as "won't fix"

  • you put "// NOSONAR" comment in the line with issue

You can also report false-positive issue in SonarJS github issues.

Elena Vilchik
  • 1,085
  • 6
  • 11