github / github/eslint-plugin-github

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

Aberta
#599 0 comentários 0 reações 0 responsáveis Ver no GitHub
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

Abrir o 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

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.