arcanist-linters icon indicating copy to clipboard operation
arcanist-linters copied to clipboard

prettier-eslint linter doesn't work - missing binary

Open kuba-orlik opened this issue 3 years ago • 6 comments

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

kuba-orlik avatar Jul 11 '20 10:07 kuba-orlik

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

jparise avatar Jul 11 '20 21:07 jparise

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 [email protected] No description
npm WARN [email protected] No repository field.

+ [email protected]
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

kuba-orlik avatar Jul 13 '20 08:07 kuba-orlik

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.

gaving avatar Jan 16 '21 12:01 gaving

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

jparise avatar Jun 09 '21 21:06 jparise

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.

steverice avatar Jun 10 '21 01:06 steverice

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

642802017 avatar Oct 20 '21 04:10 642802017