github / github/eslint-plugin-github

`github/async-preventdefault` should not flag calls before the first `await`

オープン
#599 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
JavaScript
スター
336
フォーク
67
平均マージ
1日 9時間
マージ済み PR(30日)
6

説明

`preventDefault()` works fine before the first `await` in an async function, so this code works as expected, but if currently flagged:

```js
document.querySelector('a').addEventListener('click', e => {
e.preventDefault();
await fetch('/');
});
```

It's only after the first `await`, where `preventDefault` stops working. I suggest the rule to only flag `preventDefault()` after the first `await`.

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。