AdguardTeam / AdguardTeam/AGLint

Add linter rule for detecting regex-like network rule patterns

Aperta
#264 0 commenti 1 reazione 1 assegnatario Rivendicata da @maximtop Vedi su GitHub
Priority: P4 T: Linter rule
Lingua principale
TypeScript
Stelle
70
Fork
4
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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/
```

Guida per i contributori

Apri la guida per i contributori

Valutazione

Questa issue non è ancora stata valutata.

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.