If there are spaces on the last line, standard --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).
console.log('test');
becomes
console.log('test')
_
console.log('test');\n
..
becomes
console.log('test')
_
_
This looks like an ESLint bug, so I opened an issue there: https://github.com/eslint/eslint/issues/7866
Turns out the way ESLint counts lines at the end of the file is a bit wonky. They don't count the last \n, so we actually need to set maxEOF: 0 on the no-multiple-empty-lines rule:
"no-multiple-empty-lines": [2, { "max": 1, "maxEOF": 0 }],
That fixes this issue, and also another issue with standard right now, which is that we allow either 1 or 2 newlines at the end of a file. 馃憤
This will be part of standard v9. There were 12 repos that failed, but this is trivial to fix, is also automatically fixable with --fix, and was an enforced rule in the past (this was a regression).
Most helpful comment
This will be part of standard v9. There were 12 repos that failed, but this is trivial to fix, is also automatically fixable with
--fix, and was an enforced rule in the past (this was a regression).