Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to solve or deactivate return_of_invalid_type_from_closure #11

Open
novas1r1 opened this issue May 23, 2020 · 3 comments
Open

How to solve or deactivate return_of_invalid_type_from_closure #11

novas1r1 opened this issue May 23, 2020 · 3 comments

Comments

@novas1r1
Copy link

Hi,
I freshly installed your linter package. I'm using bloc and bloc_test and get tons of issues because of "return_of_invalid_type_from_closure".

 blocTest(
      'emits [ScannerLoadingState, ScannerNotValidState, ScannerInitState] if token is valid',
      build: () async {
        ...
      },
      // bloc.add is causing the "return_of_invalid_type_from_closure"
      act: (bloc) => bloc.add(CheckScannedCode(
        code: 'code',
        eventUuid: '123-jdakls-daksl',
        checkState: 'CHECKED_IN',
      )),
      expect: [
        isA<ScannerLoadingState>(),
        isA<ScannerNotValidState>(),
        isA<ScannerInitState>()
      ],
    );

I don't really know how to fix this so I tried decativating it in analysis_options.yaml but it doesn't work.

include: package:lint/analysis_options.yaml
linter:
  rules:
    return_of_invalid_type_from_closure: false

What am I doing wrong? How can I fix it?

Best regards and thanks for your help
Verena

@nodinosaur
Copy link

try:

include: package:lint/analysis_options.yaml

linter:
  rules:
 
analyzer:
  errors:
    return_of_invalid_type_from_closure: ignore

@novas1r1
Copy link
Author

Thank you, can be closed!

@nodinosaur
Copy link

nodinosaur commented Jun 22, 2020

Just one point for @passsy, that I feel there could be more/clearer examples in the documentation. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants