github / github/eslint-plugin-github
`github/async-preventdefault` should not flag calls before the first `await`
Offen
- Vorherrschende Sprache
- JavaScript
- Sterne
- 336
- Forks
- 67
- Ø Merge
- 1 T. 9 Std.
- Gemergte PRs (30 T.)
- 6
Beschreibung
`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`.
Beitragsleitfaden
Bewertung
Dieses Issue wurde noch nicht bewertet.