My linting works fine if I add rules and errors but excluding something does not have any effect.
Here is my analysis_options.yaml in the project root directory.
include: package:pedantic/analysis_options.yaml
analyzer:
exclude:
- lib/generated/**
- test/**
errors:
...
linter:
rules:
...
My project hierarchy is like this:
/analysis_options.yaml
/test/...
/lib/generated/...
So I would like to ignore linting on test and generated folder under lib. But somehow it does not
I followed the instructions based on the docs: https://dart.dev/guides/language/analysis-options
Dart version: 2.8.4
Flutter version: 1.17.5
In my pubspec.yaml this is under dependencies:
dependencies:
...
pedantic: ^1.8.0
...
So how to prevent linting not to check in excluded folders?
Thank you for your time and help.
Since linter does not support exclude, and if you exclude your directory from analyzer you won't get any static analysis and will miss errors, what I did was adding an empty analysis_options.yaml
inside my test
directory. That fixed the problem.
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