Sonar scanner with SonarJS fails to parse some typescript

I am using SonarQube Scanner, with the SonarJS (javascript) plugin. I did a yarn install to install typescript v3.5.3. When I run sonar scanner, I receive a couple of different parse errors for things that normally parse properly during our builds. Here are a couple of examples

const genericGatewayRequest = <T extends {} | void>(request: AxiosRequestConfig): AxiosPromise<T> => {
const mockedAxios = Axios as jest.Mocked<typeof Axios>;
declare module 'react-number-format' {
export interface NumberFormatProps extends Partial<FormOutlinedTextFieldProps> {

Most of these appear to be newer features of typescript. So I’m wondering which part of my setup is out of date? I don’t understand how sonar-scanner gets its configuration for typescript.

For extra context here is my


And my tsconfig.json:

"compilerOptions": {
    "target": "es5",
    "lib": [
    "allowJs": true,
    "baseUrl": "src",
    "paths": {
      "@test-utils": [
    "skipLibCheck": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "strict": true,
    "forceConsistentCasingInFileNames": true,
    "module": "esnext",
    "moduleResolution": "node",
    "resolveJsonModule": true,
    "isolatedModules": true,
    "noEmit": true,
    "jsx": "react",
    "sourceMap": true
  "include": [

And my .eslintrc.js (if this is even used):

module.exports = {
  parser: '@typescript-eslint/parser', // Specifies the ESLint parser
  extends: [
    'plugin:@typescript-eslint/recommended', // Uses the recommended rules from the @typescript-eslint/eslint-plugin
    'prettier/@typescript-eslint', // Uses eslint-config-prettier to disable ESLint rules from @typescript-eslint/eslint-plugin that would conflict with prettier
  parserOptions: {
    ecmaVersion: 2018, // Allows for the parsing of modern ECMAScript features
    sourceType: 'module' // Allows for the use of imports
  rules: {},
  plugins: ['react', 'jsx-a11y', 'sonarjs'],
  parserOptions: {
    ecmaFeatures: {
      jsx: true
  settings: {
    react: {
      version: 'detect'

Hi There,

Thanks for reaching out to the community!

It looks like the SonarJS version you’re using is a little older compared to the newer Typescript version.

I would recommend upgrading to at least SonarQube 7.9 if you aren’t already on that version. This will let you upgrade SonarJS to 6.1, which analyses both Javascript and Typescript. I would also recommend upgrading SonarTS to the latest version for good measure.

Upgrading SonarQube

Let me know if you have any questions, or if I missed something.