Open cjb opened 5 years ago
IMHO the first case is not always explicit (is a comment attached to the next line or not ?) and therefore could be cause more harm than the problem. I was more impacted by the second which is pretty explicit : the action of sorting keys should actually sort lines attached to the keys.
Is there any update on this? This is a super annoying bug.
I wasted nearly a day due to this bug.
I had next code
const babelJestTransformer = require('babel-jest')
module.exports = {
shouldBabelize,
...babelJestTransformer,
// otherwise we have some cache issues: files are not transpiled correctly
createTransformer: undefined,
process,
}
After applying the fix I got next
const babelJestTransformer = require('babel-jest')
module.exports = {
createTransformer: undefined,
...babelJestTransformer,
// otherwise we have some cache issues: files are not transpiled correctly
process,
shouldBabelize,
}
and I was wondering why it stopped working. Actually, this file was written by my teammate and I understood the reason only when I compared this file with source branch.
Please don't underestimate this bug.
Also, there is another problem: props, split by rest operator, shouldn't mix up. If there is no such issue, I'll prepare a new one
this bug still exists https://github.com/leo-buneev/eslint-plugin-sort-keys-fix/issues/22
I fixed this in my fork and also some other critical bugs as well. Look like this repo is not in maintenance anymore, if anyone still interested in this sort keys plugin please try mine: https://github.com/namnm/eslint-plugin-sort-keys
Install: eslint-plugin-sort-keys
Rule: sort-keys/sort-keys-fix
It's common to use eslint declarations that apply to the next line. Before:
But sort-keys-fix will attach the comment to a different line. After:
There's also another way that comments are detached from their target. Before:
After: