我正在使用带有 SonarJS 5.2.1.7778 (javascript) 插件的 SonarQube Scanner 3.3.0.1492。我做了一个 yarn install 来安装 typescript v3.5.3。当我运行声纳扫描仪时,我收到了几个不同的解析错误,这些错误通常在我们的构建过程中正确解析。这里有几个例子
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> {
^
其中大多数似乎是打字稿的新功能。所以我想知道我的设置的哪一部分已经过时了?我不明白声纳扫描仪如何获取打字稿的配置。
对于额外的上下文,这里是我的 sonar-project.properties
sonar.exclusions=node_modules/**
sonar.projectKey=membexxxxxxxxxx
sonar.sources=.
sonar.host.url=https://stl-wxxxxxxx
这是我的 tsconfig.json
"compilerOptions": {
"target": "es5",
"lib": [
"dom",
"dom.iterable",
"esnext"
],
"allowJs": true,
"baseUrl": "src",
"paths": {
"@test-utils": [
"../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": [
"./src/**/*"
]
}