lints_tool 1.0.1 copy "lints_tool: ^1.0.1" to clipboard
lints_tool: ^1.0.1 copied to clipboard

A strict, prod-ready lint and analyzer rule set for Dart and Flutter projects, built on flutter_lints and DCM.

lints_tool #

CI License: MIT

A strict, prod-ready analyzer configuration for Dart and Flutter projects. Built on flutter_lints and DCM, and used unchanged by every app and package in this estate.

Use #

# analysis_options.yaml
include: package:lints_tool/lints_tool.yaml

formatter:
  page_width: 120
  trailing_commas: preserve
# pubspec.yaml
dev_dependencies:
  lints_tool:
    git:
      url: https://github.com/zs-dima/lints_tool.git
      ref: v1.0.1

A git dependency in dev_dependencies is invisible to anyone who depends on your package, so it does not stop you publishing.

What it is #

Two files. lib/lints_tool.yaml is the entry point an analysis_options.yaml includes; lib/src/analysis_options.yaml holds the rules themselves, both the analyzer's and DCM's, so a CI run and an IDE see the same set.

The DCM rules are read whether or not a DCM licence is present; without one they do nothing and the analyzer half still applies.

The shared CI recipe #

.github/workflows/ also holds the gate every repository in the estate runs, as reusable workflows: dart-package.yml, flutter-package.yml and test-report.yml. They live next to the rules because a repository that includes one includes the other, and a shared workflow has to sit in a public repository for a public caller to reach it. They are not part of the published package (.pubignore).

A caller pins the floating major tag:

jobs:
  ci:
    uses: zs-dima/lints_tool/.github/workflows/dart-package.yml@v1

Inputs: sdk and working-directory, test: false for a package with no tests, publish-check: false while a package is not publishable; the Flutter recipe takes flutter-version, channel and example-directory. Move v1 when a change is backwards compatible (git tag -f v1 && git push -f origin v1); cut v2 when a caller has to change its inputs.

Changelog #

CHANGELOG.md

License #

MIT

1
likes
160
points
--
downloads

Documentation

API reference

Publisher

verified publisherdmitrii.app

Weekly Downloads

A strict, prod-ready lint and analyzer rule set for Dart and Flutter projects, built on flutter_lints and DCM.

Repository (GitHub)
View/report issues

Topics

#lints #analyzer #dcm #style

License

MIT (license)

More

Packages that depend on lints_tool