How to disable the warning "Omit type annotations for local variables"? in Dart (with Pedantic Package)
Asked Answered
S

1

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?

Solidary answered 13/5, 2020 at 14:6 Comment(1)
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.Jacobsen
P
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
Phonology answered 17/11, 2020 at 23:59 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.