Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Add missing trailing commas in project

Currently in the project I'm working on we have 3K+ Problems, 577 of those are Missing a required trailing comma. It's very easy to fix, but at the same time it's very time consuming so...

Question: Is there any way to set every missing trailing comma in project? Basically I want to reduce the overall time it may take me to make those monotonous changes.

Maybe it exists a dart package or VS Code extension that does that for me? Haven't found any.

like image 726
Savvy Avatar asked May 10 '26 08:05

Savvy


1 Answers

Add require_trailing_commas rule to analysis_options.yaml

  rules:
    require_trailing_commas: true

and run

dart fix --apply

See dart fix for details.

like image 100
user18309290 Avatar answered May 13 '26 00:05

user18309290



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!