Skip to content
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

Auto-fix for style/max-len #73

Closed
DamianGlowala opened this issue Nov 13, 2023 · 3 comments
Closed

Auto-fix for style/max-len #73

DamianGlowala opened this issue Nov 13, 2023 · 3 comments

Comments

@DamianGlowala
Copy link

It would be a great enhancement being able to auto-fix style/max-len linting errors without having to use Prettier.

@ljharb
Copy link
Member

ljharb commented Nov 13, 2023

I'm not sure this is a great approach; prettier's attempt to "fix" this results in much uglier code much of the time.

I think there should be different rules around when arrays/objects/function calls/function signatures/ternaries/imports/exports/etc should be single-line or multiline, and that if these are addressed, all the important use cases would be met without enabling max-len at all.

@antfu
Copy link
Member

antfu commented Nov 13, 2023

I don't think it will be trivial to support this, as it's hard to determine where to break the line. Having auto line-wrapping is the main reason driving me to move away from the Prettier. I personally have no interest in implementing that. If someone wants to give it a try, I would suggest to publish as a separate plugin and validating that idea in various projects. If that ends up working well, I'd be happy to have it back to this project.

@DamianGlowala
Copy link
Author

Thanks for both of your comments, closing!

@DamianGlowala DamianGlowala closed this as not planned Won't fix, can't repro, duplicate, stale Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants