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
eol-last
and no-trailing-spaces
--fix interfere with each other
#7866
Comments
What do you get for this case? console.log('test')..\n |
console.log('test')..\n becomes console.log('test') // all whitespaces were removed. |
Yes, all whitespaces are removed, and the console.log('test')\n |
If you don't want multiple empty lines at the end of file, you should use |
@alberto We're already doing This appears to be a bug in the auto-fixing code. |
Indeed, changing the setting to: "no-multiple-empty-lines": [2, { "max": 1, "maxEOF": 1, "maxBOF": 1 }] does not solve the problem. The fixer still adds an extra newline at the end. |
Correction: |
@not-an-aardvark Ah, I think you're right. |
Closing, as I don't think there's an ESLint bug here anymore. Cheers, @not-an-aardvark! |
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using? default
Please show your full configuration:
What did you do? Please include the actual source code causing the issue.
What did you expect to happen?
What actually happened? Please include the actual, raw output from ESLint.
If there are spaces on the last line,
--fix
will remove the spaces, but still add a newline.In the following example I added characters to visualize newlines and spaces. An empty line is marked with a
_
(underscore) and a space is marked with a.
(dot).Correct:
becomes
Wrong:
becomes
(Originally reported here: standard/standard#733)
The text was updated successfully, but these errors were encountered: