github / github/eslint-plugin-github

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

Abierto
#599 0 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
JavaScript
Estrellas
336
Forks
67
Merge medio
1 d 9 h
PR fusionados (30 d)
6

Descripción

`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`.

Guía de contribución

Abrir la guía de contribución

Evaluación

Este issue todavía no se ha evaluado.

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.