AdguardTeam / AdguardTeam/AGLint

Add linter rule for detecting regex-like network rule patterns

未關閉
#264 0 則留言 1 個 reaction 已指派 1 人 已被 @maximtop 認領 在 GitHub 檢視
Priority: P4 T: Linter rule
主要語言
TypeScript
星號
71
分支
4
PR 合併指標
30 天內沒有已合併 PR

描述

There are cases where a network rule pattern looks like a regular expression even though it is probably not.
For example:

```adblock
/foo/
```

It starts and ends with a slash but does not contain any [regexp syntax characters](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Regular_expressions/Literal_character#description).

In such cases, we can _suggest_ adding a trailing wildcard so that the pattern is not interpreted as a regular expression, making the network rule more optimal:

```adblock
/foo/*
```

Also, we may need to handle such cases as well:

```adblock
/foo/bar/
```

貢獻指南

開啟貢獻指南

評估

這個 Issue 還沒有評估資料。

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

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