github / github/eslint-plugin-github
New rule: Ban top-level querying in module.
- 主要言語
- JavaScript
- スター
- 336
- フォーク
- 67
- 平均マージ
- 1日 9時間
- マージ済み PR(30日)
- 6
説明
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')
})
```
コントリビューションガイド
調査の方向性
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.
索引モデルが issue の本文から書いたものです。
評価
- 技術スタック
- javascript
- 領域
- tooling
- issue の種類
- 機能追加
- 難易度
- 3/5
- 見積もり時間
- 1〜2日
- 活発さ
- 停滞
- 明瞭さ
- おおむね明確
- 初心者へのやさしさ
- 45/100