Hello there.
We are using SonarQube Enterprise EditionVersion 10.4.1 (build 88267) on server.
We are using AzureDevops.
Our scan fails with Failed to Parse file error:
##[error]ERROR: Failed to parse file [src/app/guard/clientGurad.ts] at line 16: A parameter property is only allowed in a constructor implementation.
ERROR: Failed to parse file [src/app/guard/clientGurad.ts] at line 16: A parameter property is only allowed in a constructor implementation.
This is a fragment of the clientGurad.ts file:
export class clientGuard implements CanActivate{
constructor(private router: Router,
private validateToken: ValidatetokenService
){}
//@ts-ignore
canActivate(private route: ActivatedRouteSnapshot){
let tokenURL = route.paramMap.get('token');
this.validateToken.queryValidateToken(tokenURL).subscribe((data: genericTokenR) =>{
if(data.successfull){
return true;
}else{
this.router.navigate(['/notfound']);
return false;
}
})
}
}
Please help us to solve this.
Thanks!