dart-lang / linter

Linter for Dart.
https://dart.dev/tools/linter-rules
BSD 3-Clause "New" or "Revised" License
636 stars 170 forks source link

auto-disable some lints if no langage support is enable #689

Open a14n opened 7 years ago

a14n commented 7 years ago

For instance prefer_asserts_in_initializer_list needs langage support enableAssertInitializer.

Those lints should be auto-disable if the context isn't configured to support the specific langage experimentation.

pq commented 7 years ago

Alternatively, we should warn about incompatibilities.

Maybe we could piggy-back on the proposal to generally validation options (https://github.com/dart-lang/sdk/issues/29317)?

srawlins commented 2 years ago

This is common practice in our current lint rules (unless I'm super mistaken). It might just be that some older ones like prefer_asserts_in_initializer_list and maybe UI-as-code and set literals need support.