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

or

dart pub add --dev galactic_lints

Alternatively, you can directly add it to the devDependencies section in your pubspec.yaml:

dev_dependencies:
  galactic_lints: ^0.0.1

Note: While this package is unpublished, use:

dev_dependencies:
  galactic_lints:
    git:
      url: git@github.com:bjoernahrens/galactic_lints.git
      ref: main

Usage

Add the following line to your analysis_options.yaml:

include: package:galactic_lints/lints.yaml

Following that, you can still easily enable or disable rules as you please.

linter:
  rules:
    prefer_single_quotes: false

Additional information

Checkout the packages flutter_lints and lints.

Applied Rules

Group Errors

Group Style

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.

Libraries