79474751

Date: 2025-02-28 07:11:55
Score: 0.5
Natty:
Report link

Double-check analysis_options.yaml You've already added this, but just to be sure, make sure it's correctly formatted:

yaml Copy Edit analyzer: exclude: - "**/*.g.dart"

linter: rules: require_trailing_commas: true Also, make sure this file is in the root of your Flutter project.

  1. Disable Auto-Formatting on Save VSCode's built-in formatter might be forcing its own rules. Try turning off auto-formatting:

Open VSCode settings (Ctrl + ,) Search for “Format On Save” and turn it off json Copy Edit "editor.formatOnSave": false Instead of letting VSCode auto-format, run this manually: lua Copy Edit dart format --fix . 3. Check Your Dart SDK Version Dart updates sometimes change how the formatter works. Make sure you’re using the latest stable version by running:

css Copy Edit dart --version If it’s outdated, update it using:

nginx Copy Edit flutter upgrade 4. Try Using a Different Formatter The default Dart formatter (dart_style) has strict rules, and it might not respect require_trailing_commas. If that’s the case, you may need a custom formatter or an extension that allows more control over formatting behavior.

Reasons:
  • Long answer (-1):
  • No code block (0.5):
  • Low reputation (1):
Posted by: michal janson