AdguardTeam / AGLint

Universal adblock filter list linter
https://www.npmjs.com/package/@adguard/aglint
MIT License
49 stars 3 forks source link

Implement suggestions, split fixes into "auto-fixable" and "suggestions" #200

Open scripthunter7 opened 7 months ago

scripthunter7 commented 7 months ago

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 a need to implement what could be termed a 'suggestion API.' This would be particularly useful in situations where the fix is not straightforward (for example, when multiple solutions could address the same issue) or when it's potentially risky.

Thus, we will have two types of fix:

  1. auto-fixable
  2. suggestion

Consequently, the --fix option will only apply those corrections that are assuredly safe (auto-fixable), leaving the decision on suggestions to the user.