Lymp Lymp - 2 months ago 13
Dart Question

How to set up strong-mode Dart Analyzer in Webstorm?

In my Dart yaml file I have

analyzer:
strong-mode: true


but it doesn't do anything. I also added the analyzer:

dependencies:
analyzer: any
browser: ^0.10.0
polymer: ^1.0.0-rc.16
polymer_elements: ^1.0.0-rc.8


I'm missing something (brain I reckon). What is it please?

Thanks

Steve

Answer

Add a file .analysis_options in the directory where your pubspec.yaml is.

add

analyzer:
  strong-mode: true

You can also enable additional linter rules

linter:
  rules:
    - always_declare_return_types

For all supported linter rules see http://dart-lang.github.io/linter/lints/ and Suppress hint about use of protected member

See also https://www.dartlang.org/guides/language/analysis-options

Comments