I want to ignore all files ending with .g.dart, .inject.dart, .inject.summary in bin/ lib/ and test/
What is the syntax to ignore files dartanalyzer
? I tried adding this section to my analysis_options.yaml file:
analyzer:
exclude:
- lib/**.g.dart
to my analysis_options.yaml and when I run dartanalyzer
on my project it doesn't take that in consideration. I also tried using dartanalyzer --options analysis_options.yaml
to make sure it'd use these options without luck.
The only syntax that I found would work with dartanalyzer
cli tool was:
analyzer:
exclude:
- **/*.g.dart
but IntelliJ says it's an error (Undefined alias
.)
if I use this syntax:
analyzer:
exclude:
- lib/**.g.dart
- lib/**.inject.dart
- lib/**.inject.summary
- test/**.g.dart
- test/**.inject.dart
The analyzer embedded in IntelliJ filters correctly those files, but the dartanalyzer
cli tool doesn't.
Is there any way that works both with IntelliJ and the dartanalyzer
CLI tool?
Note:
I'm using
❯ dart --version
Dart VM version: 2.4.0 (Wed Jun 19 11:53:45 2019 +0200) on "linux_x64"
As you can see in the docs (https://dart.dev/guides/language/analysis-options) the correct syntax of excluding files from analyzer is:
include: package:very_good_analysis/analysis_options.yaml
analyzer:
exclude: [build/**, lib/**.freezed.dart, lib/**.g.dart]
Well there's an issue on dartanalyzer about that. It's a known problem for a long time and won't be solved anytime soon.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With