Provides custom lint rules broadly used in supernova.io.
List of currently implemented rules:
Requires this expression to be placed in all possible cases.
Exception: usages of State.context and State.setState don't require this expression.
GOOD:
class Model {
String? property;
String? get getter => this.property;
String? method() {
return this.property;
}
}BAD:
class Model {
String? property;
String? get getter => property;
String? method() {
return property;
}
}Prefer double quotes over single quotes.
Exceptions: directives (import, part, part of, export, library).
GOOD:
final String doubleQuotedString = "";BAD:
final String singleQuotedString = '';- Add the following to your
pubspec.yamlfile:
dev_dependencies:
supernova_lints: ^0.0.5
- Add the following to your
analysis_options.yamlfile:
analyzer:
plugins:
- custom_lint
- Restart your IDE
Feedback and contribution are always welcome at the GitHub repo.