passsy / dart-lint

An opinionated, community-driven set of lint rules for Dart and Flutter projects. Like pedantic but stricter
Apache License 2.0
277 stars 82 forks source link

analysis_options_package.yaml cannot be found #16

Closed Abhilash-Chandran closed 3 years ago

Abhilash-Chandran commented 4 years ago

I am using VSCode and I added lint:^1.2.0 as a dev_dependencies.

Now trying to import analysis_options_package.yaml as shown below breaks the flutter analyze.

include: package:lint/analysis_options_package.yaml

Following warning is raise by flutter analyze.

warning - The include file package:lint/analysis_options_package.yaml in
       C:\my\local\path\to\analysis_options.yaml cannot be found -
       analysis_options.yaml:1:11 - include_file_not_found

Should it be added to normal dependencies instead dev_dependecies? In my case that didn't help either. Not sure if I am missing any step.

kuhnroyal commented 4 years ago

I have been using the lint package for a while and now I am suddenly getting the same problem in a new project.

passsy commented 4 years ago

If you have a project with multiple modules you might run into this bug: https://github.com/dart-lang/sdk/issues/42910

When it happens for a single module this bug was fixed in Dart 2.10. Try to upgrade if possible.

kuhnroyal commented 4 years ago

Yea I just found and commented on this issue. Thanks!

Abhilash-Chandran commented 4 years ago

Thanks for the feed back @passsy. I checked even the closed issues list before opening this. Hope its not a repeated issue. Should I close this or leave it open until the main issue is resolved..?

passsy commented 4 years ago

Close when the issue is resolved on your side

passsy commented 3 years ago

The workaround https://github.com/dart-lang/sdk/issues/42910#issuecomment-851943584, adding analysis_options.yaml in every project is working. Including example projects