Skip to content

Commit 04d1742

Browse files
committed
feature: @putout/plugin-promises: add-missing-async: report: twice -> once
1 parent 246e2dc commit 04d1742

3 files changed

Lines changed: 18 additions & 0 deletions

File tree

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
test('redlint: exports: simple', (t) => {
2+
const result = await import('redlint/simple');
3+
const expected = await import('../lib/simple.js');
4+
5+
t.equal(result, expected);
6+
t.end();
7+
});
8+

packages/plugin-promises/lib/add-missing-async/index.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,10 @@ export const check = (push) => (path) => {
1818
if (fnPath.node.async)
1919
return;
2020

21+
if (fnPath.__putout_promises_add_missing_async)
22+
return;
23+
24+
fnPath.__putout_promises_add_missing_async = true;
25+
2126
push(fnPath);
2227
};

packages/plugin-promises/lib/add-missing-async/index.spec.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,11 @@ test('plugin-add-missing-async: exports: report: add-missing-async', (t) => {
1212
t.end();
1313
});
1414

15+
test('plugin-add-missing-async: exports: report: once', (t) => {
16+
t.report('once', [`Add missing 'async'`]);
17+
t.end();
18+
});
19+
1520
test('plugin-add-missing-async: transform: add-missing-async', (t) => {
1621
t.transform('add-missing-async');
1722
t.end();

0 commit comments

Comments
 (0)