【发布时间】:2021-04-13 22:56:05
【问题描述】:
我想问一下如何在我们的 Azure Pipeline 上实现 ESLint?我对 Azure Pipelines 和 SonarQube 没有足够的了解,而且我对 ESLint 也不太确定。到目前为止,这是我的脚本。虽然这几乎来自可用的任务。我想在 SonarQube 上实现 ESLint,如下链接:https://docs.sonarqube.org/pages/viewpage.action?pageId=11639183
steps:
- task: NodeTool@0
inputs:
versionSpec: '10.x'
checkLatest: true
displayName: 'Install Node.js'
- task: Npm@1
inputs:
command: 'install'
displayName: 'NPM Install'
- script: |
npm bin -g
displayName: 'Check path'
- task: Npm@1
inputs:
command: 'custom'
customCommand: 'test' #from the package.json
这里的这个来自 npm bin -g:
##[debug] /home/vsts/work/_temp/5b2e34ae-e8f8-4e24-a539-9d41f7435789.sh
/bin/bash --noprofile --norc /home/vsts/work/_temp/5b2e34ae-e8f8-4e24-a539-9d41f7435789.sh
/opt/hostedtoolcache/node/10.23.1/x64/bin
##[debug]Exit code 0 received from tool '/bin/bash'
##[debug]STDIO streams have closed for tool '/bin/bash'
##[debug]task result: Succeeded
##[debug]Processed: ##vso[task.complete result=Succeeded;done=true;]
这是上一个任务的错误。
##[debug]Agent.BuildDirectory=/home/vsts/work/1
##[debug]rm -rf /home/vsts/work/1/npm
##[debug]removing directory
##[debug]task result: Failed
##[error]Error: Npm failed with return code: 1
##[debug]Processed: ##vso[task.issue type=error;]Error: Npm failed with return code: 1
##[debug]Processed: ##vso[task.complete result=Failed;]Error: Npm failed with return code: 1
这是我的 package.json 的一些副本:
"scripts": {
"lint": "npm run lint:lwc && npm run lint:aura",
"linter": "./node_modules/.bin/eslint ./",
"lint:aura": "eslint **/aura/**",
"lint:lwc": "eslint **/lwc/**",
"test": "npm run test:unit",
【问题讨论】:
标签: azure-devops sonarqube yaml eslint