Last updated:
0 purchases
galactic lints
A very opinionated Collection of Linter Rules for Flutter and Dart (based on flutter_lints and lints) #
Getting started #
Add this package as a devDependency.
flutter pub add --dev galactic_lints
copied to clipboard
or
dart pub add --dev galactic_lints
copied to clipboard
Alternatively, you can directly add it to the devDependencies section in your pubspec.yaml:
dev_dependencies:
galactic_lints: ^0.0.1
copied to clipboard
Usage #
Add the following line to your analysis_options.yaml:
include: package:galactic_lints/lints.yaml
copied to clipboard
Following that, you can still easily enable or disable rules as you please.
linter:
rules:
prefer_single_quotes: false
copied to clipboard
Additional information #
Checkout the packages flutter_lints and lints.
Applied Rules #
Group Errors #
avoid_dynamic_calls
avoid_slow_async_io
cancel_subscriptions
close_sinks
collection_methods_unrelated_type
comment_references
diagnostic_describe_all_properties
discarded_futures
no_adjacent_strings_in_list
prefer_relative_imports
throw_in_finally
unnecessary_statements
Group Style #
always_declare_return_types
avoid_catches_without_on_clauses
avoid_catching_errors
avoid_classes_with_only_static_members
avoid_double_and_int_checks
avoid_escaping_inner_quotes
avoid_final_parameters
avoid_implementing_value_types
avoid_js_rounded_ints
avoid_multiple_declarations_per_line
avoid_positional_boolean_parameters
avoid_private_typedef_functions
avoid_redundant_argument_values
avoid_returning_this
avoid_setters_without_getters
avoid_types_on_closure_parameters
avoid_unused_constructor_parameters
avoid_void_async
cascade_invocations
dangling_library_doc_comments
deprecated_consistency
implicit_call_tearoffs
join_return_with_assignment
leading_newlines_in_multiline_strings
lines_longer_than_80_chars
missing_whitespace_between_adjacent_strings
noop_primitive_operations
one_member_abstracts
only_throw_errors
parameter_assignments
prefer_asserts_in_initializer_lists
prefer_asserts_with_message
prefer_constructors_over_static_methods
prefer_final_in_for_each
prefer_final_locals
prefer_if_elements_to_conditional_expressions
prefer_int_literals
prefer_null_aware_method_calls
prefer_single_quotes
secure_pubspec_urls
sort_pub_dependencies
sort_unnamed_constructors_first
type_literal_in_constant_pattern
unawaited_futures
unnecessary_await_in_return
unnecessary_lambdas
unnecessary_library_directive
unnecessary_null_aware_operator_on_extension_on_nullable
unnecessary_null_checks
unnecessary_parenthesis
unnecessary_raw_strings
unnecessary_to_list_in_spreads
use_colored_box
use_decorated_box
use_enums
use_if_null_to_convert_nulls_to_bools
use_is_even_rather_than_modulo
use_late_for_private_fields_and_variables
use_named_constants
use_raw_strings
use_setters_to_change_properties
use_string_buffers
use_string_in_part_of_directives
use_super_parameters
use_test_throws_matchers
Development #
This project is configured with husky and lint-staged to automatically format code pre-commit.
To install the pre-commit hook, you need to install and run husky via npm/npx.
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.