AdguardTeam / AdguardTeam/AGLint

Linter rule ideas

未關閉
#13 47 則留言 1 個 reaction 已指派 1 人 已被 @scripthunter7 認領 在 GitHub 檢視
enhancement help wanted P: High question Status: In progress T: Linter T: Linter rule
主要語言
TypeScript
星號
71
分支
4
PR 合併指標
30 天內沒有已合併 PR

描述

In this issue, we can collect the main linter rule ideas. A linter rule basically targets a specific problem and the rules can be enabled / disabled individually in the linter config. Let's try to define each rule as best as possible.

Example rules:
- Check unopened / unclosed if directives. For example:
```adblock
! Unopened if:
!#endif
rule
! Unclosed if:
!#if (adguard)
rule
```
- Warning on multilple selectors. For example:
```adblock
! Multiple selectors are used simultaneously within the rule:
example.com##.ad, .ad2
! But this is ok:
example.net###.ad
```
- Suggest fix (the linter can suggest a fix):
```adblock
example.com##.ad
example.com##.ad2
example.net###.ad
```
- Check redundant wildcards. For example:
```adblock
! Redundant *^
example.*^
! Redundant *
ex**ample.com
```

@ameshkov
@Alex-302

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。