Skip to content

how to enable custom lints in an application when using my lint package. #346

@bsutton

Description

@bsutton

I'm a little confused on how to trigger a custom lint in my scenario.

I maintain the package lint_hard https://pub.dev/packages/lint_hard and I've added a custom lint using the dart_custom_lint package.

In the lint_hard package I have:

name: lint_hard
version: 6.2.1
environment:
  sdk: '>=3.7.0 <4.0.0'
dependencies:
  analyzer: ^7.6.0
  analyzer_plugin: ^0.13.4
  custom_lint_builder: ^0.8.0

and in lint_hard's analysis_options.yaml:

analyzer:
  plugins:
    - custom_lint

I have another package (called monitor) that uses lint_hard and it correctly shows the custom lints that I've created in lint_hard.
The problem is that I have a flutter app that also uses the same version of lint_hard and the custom lint isn't showing.

When developing the custom lint I used the monitor package to experiment with getting the custom_lint to work and did lots of operations on the package in an attempt to get it to work. So now I'm not certain if there was some action (like running the custom_lint builder) that I did on that package.

The doco says the the client package (monitor) needs to include a 'plugin' statement for custom_lint but clearly I don't have that (instead its in the lint_hard package) and the custom_lint is working.

So what I'm looking for is what instructions do I need to give users of lint_hard in order for my custom lint to be triggered in their application given that lint_hard declares the custom_lint plugin?

Metadata

Metadata

Assignees

Labels

documentationImprovements or additions to documentation

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions