Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ignore rule on block

Tags:

sonarjs

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.

like image 446
asicfr Avatar asked Oct 27 '25 05:10

asicfr


1 Answers

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.

like image 153
Elena Vilchik Avatar answered Oct 29 '25 09:10

Elena Vilchik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!