The Flutter plugin in IntelliJ does not use the analyzer settings in
https://github.com/flutter/flutter/blob/master/.analysis_options_user
When running flutter analyze from the command line inside a Flutter project created with the IntelliJ plugin, settings from .analysis_options_user file are used.
When using a project specific .analysis_options file, IntelliJ plugin applies those settings.
Create a new Flutter project with IntelliJ
Add the following lines of code to lib/main.dart
```
var list = ["hello", "world"];
List
3. **Dart Analysis in IntelliJ does not show any warnings.**
4. **In the project folder run `flutter analyze`.**
Since strong mode is enabled in `.analysis_options_user`, the following warning is displayed:
> flutter analyze
> Running 'flutter packages get' in learning-flutter... 432ms
> Analyzing 2 files...
> [warning] A value of type 'List<String>' can't be assigned to a variable of type 'List<int>'. (lib/HelloWorld.dart, line 2, col 24)
> (Ran in 5.8s)
5. **Create an `.analysis_options` file in the main project folder with the following content:**
analyzer:
strong-mode: true
```
[✓] Flutter (on Mac OS, channel master)
• Flutter at /Users/raju/dev/flutter
• Framework revision 57be959887 (8 hours ago), 2016-11-07 10:03:11
• Engine revision 16077d474b
• Tools Dart version 1.21.0-dev.3.0[✓] Android toolchain - develop for Android devices (Android SDK 24.0.3)
• Android SDK at /Users/raju/Library/Android/sdk
• Platform android-24, build-tools 24.0.3
• Java(TM) SE Runtime Environment (build 1.8.0_101-b13)[✓] iOS toolchain - develop for iOS devices (Xcode 8.1)
• XCode at /Applications/Xcode.app/Contents/Developer
• Xcode 8.1, Build version 8B62[✓] IntelliJ IDEA Community Edition (version 2016.2.5)
• Dart plugin installed
• Flutter plugin installed[✓] Connected devices
• Lumigon T3 • 30067719 • android-arm • Android 6.0 (API 23)
@danrubel any idea on this one?
Addressing issues like this is part of my long arc of work to cleanup the differences between analysis server, dartanalyzer, and flutter analyze.
Great. Is there a master/meta bug we can link the individual issues like this one to?
@danrubel : is this issue better tracked elsewhere?
This should be fixed as of https://github.com/flutter/flutter/commit/52245e5082d70e089d6b9460a681849000de2340
to use the analysis options in package:flutter/analysis_options_user.yaml.
Please re-open if this is not the case.
Fantastic!
Most helpful comment
This should be fixed as of https://github.com/flutter/flutter/commit/52245e5082d70e089d6b9460a681849000de2340
to use the analysis options in package:flutter/analysis_options_user.yaml.
Please re-open if this is not the case.