Sonar raises a "javascript:Semicolon" issue against line 3 of the code included below. This is Angular code using es2015 class declarations. We're using v2.5 of the Sonar Javascript plugin. I believe this code to be correct and a semicolon is not desirable immediately after "class MyBlahClass {".
(() => { 'use strict';
class MyBlahClass { // <-- This line is improperly flagged with issue "Each statement should end with a semicolon" aka "javascript:Semicolon". This wouldn't make sense: class MyBlahClass {;
constructor() {
// Code removed for brevity
}
}
static directiveFactory(){
MyBlahClass.instance = new MyBlahClass();
return MyBlahClass.instance;
}
// More classes were removed for brevity
angular.module('blah.common.directives.my-blah-lookup')
.controller('myCtrl', MyCtrl)
.directive('myBlahClass', MyBlahClass.directiveFactory);
})();Please consider improving this rule so that it doesn't flag es2015 class declarations.