When running a create-react-app (React 17) through SonarCloud, I get the following error:
ERROR: Argument for '--jsx' option must be: 'preserve', 'react-native', 'react'.
In my tsconfig.json, jsx
is set to react-jsx
. This is the default option for React 17 apps.
This results in Sonar skipping all files because it’s skipping files with no tsconfig.json.
Raw logs (CI running on Azure DevOps):
INFO: Found 1 tsconfig.json file(s): [/home/vsts/work/1/s/tsconfig.json]
ERROR: Argument for ‘–jsx’ option must be: ‘preserve’, ‘react-native’, ‘react’.
INFO: 6 source files to be analyzed
INFO: Skipping 6 files with no tsconfig.json
INFO: 6/6 source files have been analyzed