github / github/eslint-plugin-github
New rule: Ban top-level querying in module.
- Linguagem predominante
- JavaScript
- Estrelas
- 336
- Forks
- 67
- Merge médio
- 1d 9h
- PRs com merge (30d)
- 6
Descrição
Querying should be wrapped in event listeners such as `document.addEventListener('DOMContentLoaded', ...)` or a Web Component.
## 👎🏻 Examples of bad code.
```js
const el = document.querySelector('.my-element')
```
## 👍🏻 Example of good code.
```js
document.addEventListener('DOMContentLoaded', function() {
const el = document.querySelector('.my-element')
})
```
Guia de contribuição
Direção de pesquisa
The issue names no files, tests, or entry points. Start by locating the repository's existing ESLint rule definitions and their tests, then compare how they detect top-level queries and report violations. Done means the new rule rejects the shown module-level query while allowing querying inside a DOMContentLoaded listener or Web Component.
Escrita pelo modelo de indexação a partir do texto da issue.
Avaliação
- Stack de tecnologia
- javascript
- Domínio
- tooling
- Tipo de issue
- Funcionalidade
- Dificuldade
- 3/5
- Tempo estimado
- 1-2 dias
- Status de atividade
- Estagnada
- Clareza
- Razoavelmente clara
- Facilidade para iniciantes
- 45/100