github / github/eslint-plugin-github
`github/async-preventdefault` should not flag calls before the first `await`
オープン
- 主要言語
- 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 はまだ評価されていません。