pinterest / arcanist-linters

A collection of custom Arcanist linters
Apache License 2.0
63 stars 45 forks source link

prettier-eslint linter doesn't work - missing binary #44

Open kuba-orlik opened 4 years ago

kuba-orlik commented 4 years ago

I'm running arc lint with this config:

{
    "linters": {
        "prettier-eslint": {
            "type": "prettier-eslint",
            "bin": "./node_modules/.bin/prettier-eslint",
            "include": ["(\\.ts$)", "(\\.css$)"]
        }
    }
}

arc lint shows this error:

 Exception 
Error in parsing '.arclint' file, in key 'bin' for linter 'prettier-eslint'.
None of the configured binaries can be located.
(Run with `--trace` for a full exception trace.)

I've already installed prettier-eslint inside the repo

jparise commented 4 years ago

Does it work if you don't use the bin configuration key? It looks like we have some custom path resolution stuff in there, but it defaults to ./node_modules/.bin/prettier-eslint:

https://github.com/pinterest/arcanist-linters/blob/d6a2d851d455ca9600ee5dacdce1e3a94c54b6a9/src/PrettierESLintLinter.php#L76

kuba-orlik commented 4 years ago

The problem seems to be that prettier-eslint does not register a binary:

[kuba@laptop repro]$ npm install --save-dev prettier-eslint
npm notice created a lockfile as package-lock.json. You should commit this file.
npm WARN repro@1.0.0 No description
npm WARN repro@1.0.0 No repository field.

+ prettier-eslint@11.0.0
added 163 packages from 101 contributors and audited 163 packages in 10.121s

18 packages are looking for funding
  run `npm fund` for details

found 0 vulnerabilities

[kuba@laptop repro]$ ls node_modules/.bin
acorn  eslint  esparse  esvalidate  js-yaml  mkdirp  prettier  rimraf  semver  tsc  tsserver  which
gaving commented 3 years ago

Not sure if this is still relevant but you're probably looking for this cli package instead: https://github.com/prettier/prettier-eslint-cli

Recently burned by the same thing elsewhere.

jparise commented 3 years ago

@kuba-orlik did @gaving's suggestion help you get this sorted out?

steverice commented 3 years ago

Note that since ea1b7a2564c0d38e72612261787498f678c94d03 the linter should properly detect and suggest the right package to install if it's missing. It's likely you don't need to specify a custom bin path.

642802017 commented 3 years ago

open .arclint file find NO.45andNO.58 row 's bin path ,open file open terminal $ yarn install