Skip to content

Latest commit

 

History

History
64 lines (44 loc) · 2.46 KB

README.md

File metadata and controls

64 lines (44 loc) · 2.46 KB

lintervention

melos lints by lintervention

Effective lint rules used internally by whynotmake.it. Based on very_good_analysis, with some customizations, that make more sense for our workflows.

Installation 💻

❗ In order to start using Lintervention you must have the Dart SDK installed on your machine.

Install via dart pub add:

dart pub add dev:lintervention

or

flutter pub add dev:lintervention

Then, add an include in analysis_options.yaml:

include: package:lintervention/analysis_options.yaml

if you want to always use the latest version. If not, constrain the version:

include: package:lintervention/analysis_options.0.1.0.yaml

Why the changes? 🤔

We love the rules from very_good_analysis, but we wanted to make some changes to make it more suitable for our workflows. Here are the changes we made:

  • No prefer_single_quotes, since not all of our devs use US keyboard layouts, and it's not easier to type single quotes on most other layouts. Instead, we gain the benefit of never having to think about whether to use single or double quotes. We also don't have to worry about escaping quotes in strings.
  • Allow one_member_abstracts, since sometimes we need to define interfaces in the domain layer that need to be implemented in the data layer. They should be allowed even with one member. Top level functions don't work for this usecase.
  • No unnecessary_await_in_return since it can mess with error catching if not used carefully (see this issue)
  • We also exclude a bunch of generated file types from the lint rules.

Use the badge

Show off your cool linting by using the badge in your readme:

[![lints by lintervention](https://img.shields.io/badge/lints_by-lintervention-3A5A40)](https://github.com/whynotmake-it/lintervention)