github / github/eslint-plugin-github
`github/async-preventdefault` should not flag calls before the first `await`
未关闭
- 主要语言
- JavaScript
- 星标
- 336
- 派生
- 67
- 平均合并
- 1 天 9 小时
- 30 天内合并 PR
- 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 还没有评估数据。