passsy / dart-lint

An opinionated, community-driven set of lint rules for Dart and Flutter projects. Like pedantic but stricter
Apache License 2.0
277 stars 82 forks source link

Add information that rules can be customized #3

Closed szotp closed 4 years ago

szotp commented 4 years ago

Thanks for making this package.

I think it would make sense to inform people that these rules can easily be customized. It was not clear to me until I checked Dart docs.

Ignoring rules is very nice when migrating from ugly codebase - I just added this to my project and I have hundreds of warnings and errors. I fixed what I could, ignored the rest, and will continue cleanup when I have more time.

passsy commented 4 years ago

Good point, added!

kuhnroyal commented 4 years ago

This is not working correctly for me, I don't think this is an issue of this library but maybe you know where to look. My guess is somewhere in the analyzer.

lint version: 1.1.0 analyzer version: 0.38.5

This works: extending the set of rules with the YAML list syntax

include: package:lint/analysis_options.yaml

linter:
  rules:
    - prefer_double_quotes

This does not work: extending the set of rules with the YAML property syntax

include: package:lint/analysis_options.yaml

linter:
  rules:
    prefer_double_quotes: true

Now only prefer_double_quotes gets flagged as warning. As a result one can not remove a rule that is configured in the lint package. Only adding is possible.

This could also be a limitation or bug in some YAML library that prevents the merging of List and Map.