github / github/eslint-plugin-github
`github/async-preventdefault` should not flag calls before the first `await`
- Linguagem predominante
- JavaScript
- Estrelas
- 336
- Forks
- 67
- Merge médio
- 1d 9h
- PRs com merge (30d)
- 6
Descrição
`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`.
Guia de contribuição
Direção de pesquisa
Start by locating the github/async-preventdefault rule and its existing tests. Add coverage for preventDefault() before and after the first await, then verify the rule flags only the latter case.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- eslint, javascript
- Domínio
- tooling
- Tipo de issue
- Bug
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 48/100