p-hatan/ mirror

pub repository

mirror.p-hatan.com

bloc_lint

0.1.0

Set of lint rules for the Flutter BLoC library.

Download archive

Readme

Bloc Lint

Custom linter rules for Flutter projects using the bloc library. This package is based on dart_custom_lint package.

Usage

Add the following to your pubspec.yaml file:

dev_dependencies:
  custom_lint: ^0.7.0
  bloc_lint: ^0.1.0

Add the following to your analysis_options.yaml file:

analyzer:
  plugins:
    - custom_lint

That's it! After running pub get (and possibly restarting their IDE), users should now see our custom lints in their Dart files. You can also run dart pub custom_lint to run the linter in your CLI.

Tests

The example folder contains a dart project to unit test the rules. (see custom_lint readme for more info)

Implemented Rules

Changelog

0.1.0 - 2024-11-10

  • Initial release
  • New rules implemented:
    • avoid_public_methods_on_bloc
    • avoid_public_properties_on_bloc_and_cubit
    • event_base_class_suffix
    • prefer_multi_bloc_listener
    • prefer_multi_bloc_provider
    • prefer_multi_repository_provider
    • state_base_class_suffix

Installing

export PUB_HOSTED_URL=https://pub.mirror.p-hatan.com
flutter pub add bloc_lint
pubspec.yaml
name: bloc_lint
version: 0.1.0
description: Set of lint rules for the Flutter BLoC library.
repository: https://github.com/vmichalak/bloc_lint
issue_tracker: https://github.com/vmichalak/bloc_lint/issues

environment:
  sdk: ">=3.3.3 <4.0.0"

dependencies:
  analyzer: ^6.7.0
  analyzer_plugin: ^0.11.3
  custom_lint_builder: ^0.7.0

dev_dependencies:
  very_good_analysis: ^6.0.0
  test: ^1.25.8

Version history

VersionPublishedArchiveSHA-256
0.1.02024-11-10T15:53:55.553997ZDownloadfcf80877faf222089436696681375bc3bc9ca023305b69180ea81b449134fc65
0.2.0-dev.02025-04-25T01:55:21.196831ZDownload634c3b6e6932f80d2d77bca7c17f2953906448b379c10d30c938282559f9a46e
0.2.0-dev.12025-05-01T04:28:49.362886ZDownload4921ede3985f52cb4534f92dcdeb61223f6551f278a992689b48f177e01ebaf8
0.2.0-dev.22025-05-03T03:41:50.889350ZDownloade4b48eb2e94573d07d09fbed9c448744b7e7bb0195957a77556ceb0266dcfd9b
0.2.0-dev.32025-05-12T04:46:27.916394ZDownload03629e15bab2b9fed80c6258f6e360908f809b9183b66e271d0f9dfdcd679c85
0.2.0-dev.42025-05-29T04:20:27.202943ZDownloada3f44e77cf976f70d767b73f92768433d7429da2b4fd9e08a53eec5a69fd9f22
0.2.0-dev.52025-06-05T03:56:07.873075ZDownload40ae2585fba504eb15a0072d15ef17db8890202efb51c5663a243398c79df805
0.2.0-dev.62025-06-06T01:35:48.868297ZDownloadd6e5a3f40a6d56bf482a0d5897f22a0ad882419ff8ccfebf95385cc8c91dec63
0.2.02025-06-29T21:30:48.136605ZDownloadaf7238054d0fb3bf56627285ff92076d1381dd321784f52fef2f1b15d4147c36
0.2.12025-07-20T03:13:25.584612ZDownload116bfd31fd1fa050212a7cd48fbf148661107edebab2f93264fb8ae213c64ae3
0.3.02025-08-19T04:11:35.494583ZDownloadc93fcf61da29c709b97e9764ab59c130a25b12c23608a60e3788b28bbc1a636b
0.3.12025-08-19T04:15:36.679302ZDownload9e0d71bb531a129b51f38aa3313ee1c2ca3881cdca27b3c087c291b64d81288f
0.3.22025-09-22T01:48:41.085805ZDownloadc7f0984689bccf5e8e08f1fd4054687547a558294b692c145211165eff1c19d4
0.3.32025-10-25T22:45:08.253811ZDownload5c1325b35bc4786ffd9eeba33d2015b72eb92fd30b36ebcd7732e55ad6fc0270
0.3.42025-11-20T20:01:55.737464ZDownload0bfcb2885c9faf2fb18b471ec34ed9efa2949799ecbcd2e9c5204f5b7cf94685
0.3.52025-11-21T14:11:07.542704ZDownload4ba9c78d73f97c5175eb2c419f94e6d8211edd06ace1783ea32dc64f865e0f38
0.3.62025-12-15T17:26:10.686037ZDownload4218f1b262066913f35941026efe824614df2e8d794f65ccde8f2e0f31bf5843
0.3.72026-02-09T20:52:39.142276ZDownload48d141f67552cc83703d5735f27ae9c549e4705b543e053eab77fa6cfa44ccf4
0.4.02026-02-09T21:36:53.817050ZDownloade40b578297488e5a263cbfa2180b186546f32da40ae8a57cad6aa68be5a46f79
0.4.12026-04-12T17:59:28.905063ZDownload5bf965e3be5346fd6133e7f2eb4c845de3f2ae09eeae4d6622f400848b4aba71
0.4.22026-07-04T23:45:07.080018ZDownload1259e2a4c44afaa5cb69115a4773be4868751735ecdfe65c146f07ff9120f4d5
0.4.32026-09-23T17:56:54.591419ZDownload7cbbc0de0ee041d1efcb522148b9add1b660e55a4d60242a023de0ffd2c60fe2

Dependencies

analyzer "^6.7.0"

analyzer_plugin "^0.11.3"

custom_lint_builder "^0.7.0"