fluffychat/analysis_options.yaml
2026-02-19 11:41:57 +01:00

60 lines
No EOL
1.6 KiB
YAML

include: package:flutter_lints/flutter.yaml
linter:
rules:
- camel_case_types
- avoid_print
- constant_identifier_names
- prefer_final_locals
- prefer_final_in_for_each
- sort_pub_dependencies
- require_trailing_commas
- omit_local_variable_types
analyzer:
plugins:
- dart_code_linter
errors:
todo: ignore
use_build_context_synchronously: ignore
exclude:
- lib/l10n/*.dart
dart_code_linter:
rules:
# Dart specific:
- avoid-dynamic
- avoid-redundant-async
- avoid-unnecessary-type-assertions
- avoid-unnecessary-type-casts
- avoid-unrelated-type-assertions
- no-boolean-literal-compare
- no-equal-then-else
- prefer-first
- prefer-last
- prefer-immediate-return
- prefer-enums-by-name
- avoid-unnecessary-conditionals
# TODO:
# - member-ordering
# - avoid-late-keyword
# - avoid-non-null-assertion
# - avoid-global-state
# - prefer-match-file-name
# - avoid-banned-imports:
# entries:
# - paths: ['some/folder/.*\.dart', 'another/folder/.*\.dart']
# deny: ['package:flutter/material.dart']
# message: 'Do not import Flutter Material Design library, we should not depend on it!'
# - no-magic-number:
# allowed: [-1, 0, 1,2,4,6,8,12,16,32,40,56,64]
# allow-only-once: true
# Flutter specific:
- prefer-media-query-direct-access
- avoid-wrapping-in-padding
- prefer-correct-edge-insets-constructor
# TODO:
# - avoid-returning-widgets
# - prefer-single-widget-per-file:
# ignore-private-widgets: true
# - prefer-extracting-callbacks