我试图将pinterest-linters添加到我的项目中,但我在arc lint时遇到了一些错误。
ARGV '/Users/lushali/somewhere/arcanist/bin/../scripts/arcanist.php' 'lint' '--trace'
LOAD Loaded "phutil" from "/Users/lushali/somewhere/libphutil/src".
LOAD Loaded "arcanist" from "/Users/lushali/somewhere/arcanist/src".
Config: Reading user configuration file "/Users/lushali/.arcrc"...
Config: Did not find system configuration at "/etc/arcconfig".
Working Copy: Reading .arcconfig from "/Users/lushali/code/nexus_admin/.arcconfig".
Working Copy: Path "/Users/lushali/code/nexus_admin" is part of `git` working copy "/Users/lushali/code/nexus_admin".
Working Copy: Project root is at "/Users/lushali/code/nexus_admin".
Config: Did not find local configuration at "/Users/lushali/code/nexus_admin/.git/arc/config".
Loading phutil library from 'pinterest-linters'...
>>> [0] (+0) <exec> $ git rev-parse --verify HEAD^
<<< [0] (+10) <exec> 10,455 us
>>> [1] (+10) <exec> $ git rev-parse --abbrev-ref --symbolic-full-name '@{upstream}'
<<< [1] (+20) <exec> 9,782 us
>>> [2] (+20) <exec> $ git cat-file -t 'origin/master'
<<< [2] (+34) <exec> 13,470 us
>>> [3] (+34) <exec> $ git merge-base 'origin/master' HEAD
<<< [3] (+46) <exec> 11,523 us
>>> [4] (+46) <exec> $ git diff --no-ext-diff --no-textconv --submodule=short --raw '1bba3081e23c945b3f795eedc73b99e3f509b5ed' HEAD --
<<< [4] (+59) <exec> 12,633 us
>>> [5] (+59) <exec> $ git --version
<<< [5] (+71) <exec> 11,867 us
>>> [6] (+71) <exec> $ git status --porcelain=2 -z
<<< [6] (+88) <exec> 16,486 us
>>> [7] (+88) <exec> $ git diff --no-ext-diff --no-textconv --submodule=short --no-color --src-prefix=a/ --dst-prefix=b/ -U32767 -M -C '1bba3081e23c945b3f795eedc73b99e3f509b5ed' --
<<< [7] (+120) <exec> 31,626 us
Examining paths for linter 'spelling'.
Found 6 matching paths for linter 'spelling'.
Examining paths for linter 'generated'.
Found 6 matching paths for linter 'generated'.
Examining paths for linter 'merge-conflict'.
Found 6 matching paths for linter 'merge-conflict'.
Examining paths for linter 'general-text'.
Found 4 matching paths for linter 'general-text'.
Examining paths for linter 'json'.
Found 4 matching paths for linter 'json'.
[2019-06-03 22:05:07] EXCEPTION: (PhutilProxyException) Error in parsing '.arclint' file, in key 'bin' for linter 'prettier-eslint'. {>} (Exception) None of the configured binaries can be located. at [<arcanist>/src/lint/linter/ArcanistExternalLinter.php:543]
arcanist(head=master, ref.master=7329bc7c32b9), phutil(head=master, ref.master=86ee6e90797c), pinterest-linters(head=master, ref.master=3628e14b6f57)
#0 <#2> ArcanistExternalLinter::setLinterConfigurationValue(string, string) called at [<pinterest-linters>/src/PrettierESLintLinter.php:114]
#1 <#2> PrettierESLintLinter::setLinterConfigurationValue(string, string) called at [<arcanist>/src/lint/engine/ArcanistConfigurationDrivenLintEngine.php:103]
#2 ArcanistConfigurationDrivenLintEngine::buildLinters() called at [<arcanist>/src/lint/engine/ArcanistLintEngine.php:166]
#3 ArcanistLintEngine::run() called at [<arcanist>/src/workflow/ArcanistLintWorkflow.php:337]
#4 ArcanistLintWorkflow::run() called at [<arcanist>/scripts/arcanist.php:394]我是按照github (https://github.com/pinterest/arcanist-linters#global-installation)的指示操作的。
这是我的.arcconfig文件:
{
"phabricator.uri" : "https://code.XXXXX.com/",
"load": [
"pinterest-linters"
]
}在我的node_modules文件夹中找不到.bin/prettier-eslint。我想可能是奥秘加载模块的时候出了点问题。我花了很多时间在网上搜索,但没有得到任何有用的东西。有人能帮帮忙吗?非常感谢!
发布于 2019-08-21 06:43:36
根据您的错误消息,我认为您需要在将pinterest-linters添加到.arcconfig文件的基础上创建一个.arclint文件。例如,prettier和eslint的.arclint文件如下所示:
{
"linters": {
"eslint": {
"type": "eslint",
"include": ["(\\.js$)", "(\\.jsx$)"],
"bin": "./node_modules/.bin/eslint",
"eslint.config": ".eslintrc",
"eslint.env": "browser,node"
},
"prettier": {
"type": "prettier",
"include": ["(\\.js$)", "(\\.jsx$)"],
"bin": "./node_modules/.bin/prettier",
"prettier.cwd": "./"
}
}
}但是,您的可能会有所不同,因为您的错误消息指出您使用prettier-eslint。
https://stackoverflow.com/questions/56435160
复制相似问题