-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Consider disabling require_trailing_commas
lint if language version of file is >= 3.7
#60119
Comments
Originally posted by @munificent in dart-lang/dart_style#1253 (comment) So I'm unsure if removing the lint is what we want, but I'll leave to the team to decide. |
The final decision was that the formatter will add or remove trailing commas based on whether or not the list is split across multiple lines. It will not honor the presence or absence of a trailing comma. That means that this lint is pointless for users that use the formatter. If we have enough users that don't use the formatter then it might make sense to keep this lint, but I, and several others, are hoping that most users will use the new formatter so that this lint is no longer helpful. |
require_trailing_commas
lint if language version of file is >= 3.7require_trailing_commas
lint if language version of file is >= 3.7
I didn't really consider projects not using the formatter, but I suppose that's a potential reason to keep it working with a language version after 3.7. However, in its docs, the rule says it assumes code is formatted with |
That makes sense to me. |
That makes sense to me too. I'll just note that:
It doesn't seem to be the case. If you open the above mentioned issue, it has been less than one day since Dart 3.7 is out and we have five different comments asking for the trailing commas to not get removed. |
Those comments are all related to the behavior of the formatter, which means that they're coming from users that use the formatter. They don't address the question of what percentage of users use the formatter (irrespective of whether or not they like the change).
The lint is no longer useful to users that use the formatter because the formatter no longer honors the use of a trailing comma as a way of deciding how to format the code. It simply formats the code the way it wants and then it adds or removes commas based on the format. In other words: using the formatter and enabling this lint are mutually exclusive options. The hope is that there are (or will be) few enough users that enable this lint that it would make sense to retire it. |
I understand your point now. Thanks! |
CC @pq looking at lints we may no longer want to maintain. |
There's so much activity over at dart-lang/dart_style, I'd strongly consider a cherry-pick to disable |
It will conflict with tall style formatting.
The text was updated successfully, but these errors were encountered: