AdguardTeam / AdguardTeam/AGLint

Add new rule for detecting some unescaped dots

Aberta
#242 0 comentários 1 reação 1 responsável Reivindicada por @maximtop Ver no GitHub
Priority: P4 T: Linter rule
Linguagem predominante
TypeScript
Estrelas
71
Forks
4
Métricas de merge de PRs
Nenhum PR com merge em 30d

Descrição

If an unescaped dot (`.`) is found in a regex pattern, and it can be reasonably determined that the dot is still part of a valid domain or is followed by a valid TLD, a warning should be displayed, suggesting that the dot should be escaped.

For example, the following rules:

```adblock
/example.ru\/uploads\/banner\d+.png/
/example.(com|org)/
```
Should be rewritten as:

```adblock
/example\.ru\/uploads\/banner\d+.png/
/example\.(com|org)/
```

This is because an **unescaped dot (`.`)** in a regex pattern represents **any character**, while an **escaped dot (`\.`)** explicitly represents a **literal dot (`.`)**.

Can be autofixed.

Guia de contribuição

Abrir o guia de contribuição

Avaliação

Esta issue ainda não foi avaliada.

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.