61 lines
1.5 KiB
YAML
61 lines
1.5 KiB
YAML
include: package:flutter_lints/flutter.yaml
|
|
|
|
analyzer:
|
|
plugins:
|
|
- custom_lint
|
|
|
|
exclude:
|
|
- '**/*.g.dart'
|
|
- '**/*.freezed.dart'
|
|
|
|
language:
|
|
strict-casts: true
|
|
strict-inference: true
|
|
strict-raw-types: true
|
|
|
|
errors:
|
|
# Treat missing required parameters as errors
|
|
missing_required_param: error
|
|
# Treat missing returns as errors
|
|
missing_return: error
|
|
# Treat invalid assignments as errors
|
|
invalid_assignment: error
|
|
|
|
linter:
|
|
rules:
|
|
# Basic rules
|
|
avoid_print: true
|
|
prefer_const_constructors: true
|
|
prefer_const_literals_to_create_immutables: true
|
|
prefer_final_fields: true
|
|
unnecessary_this: true
|
|
sort_child_properties_last: true
|
|
use_key_in_widget_constructors: true
|
|
|
|
# Type safety rules - NO DYNAMIC!
|
|
avoid_dynamic_calls: true
|
|
avoid_type_to_string: true
|
|
implicit_call_tearoffs: true
|
|
|
|
# Additional type safety
|
|
always_declare_return_types: true
|
|
always_specify_types: false # Too verbose, but we have strict-inference
|
|
type_annotate_public_apis: true
|
|
|
|
# Code quality
|
|
always_use_package_imports: true
|
|
avoid_empty_else: true
|
|
avoid_relative_lib_imports: true
|
|
avoid_slow_async_io: true
|
|
cancel_subscriptions: true
|
|
close_sinks: true
|
|
no_adjacent_strings_in_list: true
|
|
unnecessary_statements: true
|
|
|
|
# Style
|
|
prefer_single_quotes: true
|
|
require_trailing_commas: true
|
|
|
|
# Documentation
|
|
package_api_docs: true
|
|
public_member_api_docs: false # Can enable for stricter docs
|