Skip to content

Remove require_trailing_commas #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

Merged

Conversation

masa-tokyo
Copy link
Contributor

@masa-tokyo masa-tokyo commented Feb 18, 2025

Hello mono-san,
Thank you for the great package :)
I'd be glad if you consider removing the lint rule require_trailing_commas from the list.

As Dart 3.7 introduced the new format style, the rule conflicts the formatted code in some cases.
For example, a function with positional parameters that contain list literals or function literals (a famous example is flutter_hooks useEffect) is cautioned by the rule. Please take a look at the sample code for details.

FYI:

@mono0926
Copy link
Owner

mono0926 commented Feb 18, 2025

@masa-tokyo

Since you can disable any rules for each project, I initially judged that it might be fine to just leave it as is and observe the situation.

The conflict issue might be resolved with a fix to either the formatter or require_trailing_commas. However, since the formatter in Dart 3.7 has a feature equivalent to require_trailing_commas (adding commas as needed), it might be acceptable to proceed without require_trailing_commas.

I was hesitating about whether to address this after the discussion in that area is settled, but since it seems like it will take some time, it might be best to go ahead and remove require_trailing_commas first and then add any necessary reasons later 🤔

@mono0926 mono0926 merged commit 166f70b into mono0926:main Feb 18, 2025
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

Successfully merging this pull request may close these issues.

2 participants