-
Notifications
You must be signed in to change notification settings - Fork 9
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
Make the rule fixable #8
Comments
Ah shoot, that's the only reason I was going to pull this library. I wanted to eslint --fix a file that has way too many functions and isn't sorted in any logical way. |
@channikhabra has written a brilliant utility for that https://github.com/channikhabra/js-sort-object-properties |
Thanks gajus! |
I spoke too soon, I couldn't get that to work on anything complex... Works great on the example code, though! |
@mherodev best to raise an issue where the author can see, https://github.com/channikhabra/js-sort-object-properties/issues |
I would be extremely helpful if this did fix itself. Otherwise it really isn't practical. Hey all, I dove into this a bit and it seems this is not possible with the current fixer in ESLint. I think a babel plugin would be the better choice here. |
You might be able to do something with jscodeshift, inspired by https://github.com/reactjs/react-codemod/blob/master/transforms/sort-comp.js |
@jacobrask Thank you. I'm still looking into this. For performance reasons, especially during dev, I'd like to avoid parsing the code twice. For reference, these discussion in eslint issues might be relevant: eslint/eslint#5329 estree/estree#41 |
It would be nice if this plugin/rule was able to fix itself.
The text was updated successfully, but these errors were encountered: