lint 1.6.0 lint: ^1.6.0 copied to clipboard
An opiniated, community-driven set of lint rules for Dart and Flutter projects. Like pedantic but stricter
Add lint
as dependency to your pubspec.yaml
dev_dependencies:
lint: ^1.3.0
Add a analysis_options.yaml
to the root of you project.
include: package:lint/analysis_options.yaml
# Not happy with the default? Customize the rules depending on your needs.
# Here are some examples:
linter:
rules:
# Make constructors the first thing in every class
sort_constructors_first: true
# The new tabs vs. spaces. Choose wisely
prefer_single_quotes: true
prefer_double_quotes: true
# Good packages document everything
public_member_api_docs: true
# Blindly follow the Flutter code style, which prefers types everywhere
always_specify_types: true
# Back to the 80s
lines_longer_than_80_chars: true
# Use parameter order as in json response
always_put_required_named_parameters_first: false
# Util classes are awesome!
avoid_classes_with_only_static_members: false
Hit save and see the dartanalyzer
executing the lint checks in you favorite editor.