AGLint
AGLint copied to clipboard
Universal adblock filter list linter
https://github.com/typicode/husky/releases/tag/v9.0.1
For example: https://github.com/AdguardTeam/tsurlfilter/blob/4276bdfb494cbf704ba41ec6b07c4eac4426b430/packages/tsurlfilter/src/rules/cosmetic-rule.ts#L71-L115 Pseudo classes should be specified via the rule configuration
* `beverfood.com#$#a[href^="/bnlink/?bnid="] { remove: true; }` `{ remove: true; }` can be used only with `#$?#` * Warn, if used an extended CSS selector with `##` marker. `##div:contains(a)` `##div:has(> table:contains(a))`...
Incorrect usage of `|`, `||` is not detected, for example - `|||`  * Invalid rules `|||example.com^` - should be `||` `https://example.com/ads.js||` - should be `|` at the end *...
We already have a [basic domain validator in AGTree](https://github.com/AdguardTeam/tsurlfilter/blob/master/packages/agtree/src/utils/domain.ts). This is used to [validate the domain list of the cosmetic rule](https://github.com/AdguardTeam/AGLint/blob/85794436d94bb8f34d22aa4125f0ae8133b29a2d/src/linter/rules/invalid-domain-list.ts#L23) or the value of the `$domain` modifier. I recommend...
There are cases where something is just misspelled, like the modifier name: `scipt` instead of `script`. In this case, the provided modifier name is very similar to the name of...
The linter won't let the rule below through because of a supposedly incorrect value in the domain, but that's not true. ```adblock /xyzsports\d+\.xyz\/assets\/images\/\w{3}\//$image,domain=/xyzsports\d+\.xyz/ ``` Screenshot: 
We need to implement a caching mechanism that allows us to check only the changed files. For example, writing information to `.aglintcache` as ESLint does. See https://eslint.org/docs/latest/use/command-line-interface#caching In addition, we...
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...
If a linter rule is violated, it's possible to correct the issue in certain cases. As it stands, the linter rule API only provides a basic fix feature. However, there's...