Skip to content
This repository was archived by the owner on Oct 16, 2020. It is now read-only.
This repository was archived by the owner on Oct 16, 2020. It is now read-only.

Nano Linter issues mega thread #1

@jspenguin2017

Description

@jspenguin2017

Filter Linter

Show warning if:

  • Too many or too few arguments are passed in for a script snippet
  • Filter is platform specific and current platform does not support it
  • A script snippet injection rule only have negated domain (it will be converted to an exception rule)
  • A filter will match word boundary but the boundary character is not explicitly given
  • A common mistake is detected

Common mistakes:

  • ||example.com^$generichide - Forgot @@ or important
    It is quite rare that someone want to use important on generichide, chances are he forgot @@.
    Detection logic: If a filter has generhichide but not important and is not an exception filter, then dispatch a warning.
  • /example-path/ - Forgot trailing *
  • /example-path/im - Regular expression flags in procedural cosmetic filters gorhill/uBlock#3372
    When matching part of a path, trailing wildcard is required, otherwise it becomes a RegExp rule.
    Detection logic: If a RegExp rule only contains letters, numbers, -, _, and ., then dispatch a warning.
  • |example.com^ - Missed one |
    Can happen when copying filter, didn't select the whole line.
    Detection logic: For start anchor, if what is anchored does not include protocol, dispatch a warning.
  • ||example.com - Forgot ^
    Although the filter works, it is usually a mistake as it can match example.communicate.example.org.
    Detection logic: If a filter has host name anchor but no ^ nor : nor /, dispatch a warning.
  • example.blogspot.*##element - Wildcard matching half of public suffix
    Filter will not work as expected.
    Detection logic: Could be difficult to implement.

Whitelist Linter

Show warning if:

  • RegExp is used but that is unlikely to be the intent of the user

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions