6

I use the pedantic package in Flutter and I have the following anaylsis_options.yaml file:

include: package:pedantic/analysis_options.yaml # advanced linter

analyzer:
  enable-experiment:
    - extension-methods

linter:
  rules:
    omit_local_variables_types: false
    # always_specify_types: true

I try to disable the "Omit type annotations for local variables" warning. I can only disable it, I uncomment the last line (see question Dart 2.8.0 sdk: how to globally ignore omit_local_variable_types warning?). But I don't want to specify every type. So that's not what I want.

So how get I disable this warning globally?

DarkMath
  • 1,089
  • 2
  • 15
  • 29
  • Just a comment, Pedantic Dart is really aimed at the Google dart / flutter sdk developers. You may be better off using the effective_dart package. I started using pedantic but have switched to effective. – GrahamD May 13 '20 at 15:46

1 Answers1

12

I'm not sure if this is a feature that came later than when the question is posted, but according to here you can ignore rules.

So if you want to disable warnings for omit_local_variable_types rule you can do the following in your anaylsis_options.yaml file:

analyzer:
  errors:
    omit_local_variable_types: ignore
Can Vural
  • 2,222
  • 1
  • 28
  • 43