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
CLIEngine docs do not explicitly indicate that fix option does not write to disk #6366
Comments
CLIEngine does not automatically output fixes to disk in case it is being used in a toolchain which might be better positioned to do so (e.g., Grunt/Gulp). Instead, In order to write the outputs to disk, you can call |
That said, it certainly couldn't hurt to call out that, in |
Ah, of course! I'd missed the docs for I'd be happy to submit a PR rewording the docs myself if you'd be amenable. |
@NickHeiner No worries, I agree it could be clearer. We usually like to get consensus among ESLint team members before accepting issues, but I'm fairly sure this will be accepted easily. So please feel free to submit a PR (with the caveat that there is a very tiny chance of this issue being rejected and then you would have waste your time, but again that chance should be very small). Thanks! |
Updating the NodeJS API docs to avoid surprising developers when trying to use the `fix` param.
Updating the NodeJS API docs to avoid surprising developers when trying to use the `fix` param.
Updating the NodeJS API docs to avoid surprising developers using the `fix` param.
Updating the NodeJS API docs to avoid surprising developers using the `fix` param.
What version of ESLint are you using?
2.12.0
What parser (default, Babel-ESLint, etc.) are you using?
default
Please show your full configuration:
demo.js
What did you do? Please include the actual source code causing the issue.
The file I linted:
sample.js
Running the linter:
What did you expect to happen?
I was hoping that the fix would be applied to the file on disk.
What actually happened? Please include the actual, raw output from ESLint.
The fix was not applied to the file on disk. Looking through the code, it appears that this is the intended behavior. If I just write
result.output
toresult.filePath
, then I'll be set. However, this was confusing for me because the NodeJS API docs say:If I'm understanding correctly, it would be more accurate to say:
The text was updated successfully, but these errors were encountered: