Parse error on JSX

Must-share information (formatted with Markdown):

  • which versions are you using (SonarQube, Scanner, Plugin, and any relevant extension)
    SonarQube Scanner 3.3.0.1492
    Run Code Analysis 4.6.0 on Azure Pipeline

  • what are you trying to achieve
    I try to remove errors raised by SonarJS sensor when running code analysis:
    ##[error]ERROR: Unable to parse file …
    ##[error]ERROR: Parse error at line 10 column 8:
    10:
    ^
    Such errors are raised each time for a custom HTML5 tag.

  • what have you tried so far to achieve this
    I searched Google for ways to configure Sonar avoiding such failures.
    I went through every configuration options in the doc.

Hello,

Can you share the file on which the Scanner is failing (as a private message if required)?

Which version of SonarQube are you using and which version of the SonarJS plugin is installed on this instance?

Thanks

Hi Alexandre, here is one of he files making the scanner fail.
On this one on line 6, on the character - of <se-icon>.
Versions:

  • Sonarqube 7.6.0.21501
  • SonarJS 5.0 (build 6962)
    import React from 'react'
    import './UserButton.css'

    const UserButton = (props) => (
      <div className="user-menu-button">
        <se-icon color="primary">user_standard</se-icon>
        <span className="se-font user-name">{props.name}</span>
      </div>
    )

    export default UserButton

Hi,

This parsing error was fixed in SonarJS 5.2. Please upgrade, it should remove this problem.