neoformat icon indicating copy to clipboard operation
neoformat copied to clipboard

Neoformat writes to buffer on formatter error

Open FuzzOli87 opened this issue 7 years ago • 4 comments

Hello,

I'm running into an issue with prettier-eslint-cli. Just updated my modules so I'm digging around a bit more.

However, there is a recurring issue I see and that is that when neoformat fails to run the formatter, it writes the error to the file.

These are my current configurations:

let g:neoformat_javascript_prettiereslint = {
  \ 'exe': 'prettier-eslint',
  \ 'args': ['--stdin'],
  \ 'stdin': 1
  \ }
let g:neoformat_enabled_javascript=['prettiereslint']

FuzzOli87 avatar May 31 '18 16:05 FuzzOli87

If you set verbose=1, and run :Neoformat, what exit code does it print out?

sbdchd avatar Jun 02 '18 00:06 sbdchd

image

Here is the tail-end of the output @sbdchd Not sure which one is the exit code.

FuzzOli87 avatar Jun 04 '18 16:06 FuzzOli87

yeah, probably should make the logging more explicit. Pretty sure that is an exit code of 1, while valid exit codes being [0].

sbdchd avatar Jun 18 '18 23:06 sbdchd

@FuzzOli87 did you ever figure this out?

Seems like prettier-eslint is reading the file from stdin and it's having some issue loading up the eslintrc usually read from the file location.. hence the "No parser and no filepath given"

EDIT: found the solution, related to https://github.com/BenoitZugmeyer/prettier-eslint-cli/commit/a1a21f1c4d860a6f34dd2d2e726d768d8b96e0df

pxue avatar Jun 20 '19 20:06 pxue