-
Notifications
You must be signed in to change notification settings - Fork 189
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
support eslint --fix #51
Comments
Okay, I have added Can you check that it works accordingly? Thanks! |
It's not working because eslint cannot find its configuration file. It cannot use a tempfile, it needs the path to the actual file. Or if you want to use a temp file, make the temp file in the same directory as the original file, this will allow eslint to find the configuration file. The configuration file is a dotfile that is stored with the original js file. |
Also, |
When |
Another option is to let neoformat look for the config file and supply it to eslint with the |
Just tried the
NeoFormat just ignores the |
Also, prettier is first so it will be run first and since it succeeds, eslint will not be run. |
OK, but shouldn't it at least give some output of trying to run eslint? I'm going to build a formatter based on https://www.npmjs.com/package/prettier-eslint-cli now, that should also get around the config file problem. |
Seems like that works: function! neoformat#formatters#javascript#prettiereslint() abort
return {
\ 'exe': 'prettier-eslint',
\ 'args': ['--stdin'],
\ 'stdin': 1,
\ }
endfunction |
thanks @manveru that works. I would still wait out for just eslint --fix since prettier has a strong opinion about how code that is linted OK should be formatted which I don't like, and it adds a considerable overhead for CPU that eslint already takes :( |
Yeah, I totally understand, just thought it might help other people like me that need both combined anyway. On my machine at least, I don't notice any performance issues, saving (which is when I run the formatter) is almost instant. It might depend on the rules you specify for eslint? |
After reading about this issue, I made a ESLint fork to support fixing code from stdin, allowing it to be used as a neoformat formatter. It worked great for me so far. This may not be a long term solution but it may interest those who want to use ESLint as a formatter without Prettier. I'm open to suggestions! |
I'm using the prettier-eslint solution. |
Going to close as it has been a long time and I'm not sure if this is relevant anymore. |
It would be nice to support http://eslint.org/docs/user-guide/command-line-interface#fix
The text was updated successfully, but these errors were encountered: