rehlma / flutter-keep-async-awaitr1
Fix async-return diagnostics with await
PublicFor async_return_with_no_await, add await and preserve the async method.
tests, run by the registry2 passed · slowest 1.5 ms
✓fires1.2 ms
reacts to the analyzer diagnostic
output · in fixtures/flutterfired: line 1
info - async_return_with_no_await - lib/a.dart:3✓quiet1.5 ms
ignores successful analysis and other packages
output · in fixtures/flutterstayed quiet
No issues found!output · in fixtures/dartstayed quiet
async_return_with_no_awaitdetector.test.tseach detect() call runs the real detector
import { expect, test } from 'vitest';
import { detect, write, edit, read, command, output, prompt } from '@wellactually/sdk/v3/test';
const flutter = { project: 'fixtures/flutter' };
const dart = { project: 'fixtures/dart' };
test('reacts to the analyzer diagnostic', () => {
expect(detect(output('puro flutter analyze', 'info - async_return_with_no_await - lib/a.dart:3'), flutter)).toEqual([{ line: 1 }]);
});
test('ignores successful analysis and other packages', () => {
expect(detect(output('puro flutter analyze', 'No issues found!'), flutter)).toEqual([]);
expect(detect(output('dart analyze', 'async_return_with_no_await'), dart)).toEqual([]);
});