-
Notifications
You must be signed in to change notification settings - Fork 22
Nano Linter issues mega thread #1
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Some Linter issues:
|
@grenzor By design, the linter will never show error if the filter is accepted, but I do agree warnings should be shown for some of these cases. I'll work on that later. I think these should generate warning:
The error in |
They may be easy to spot if you have a few filters, but for someone with 100s/1000s of their own filters it is not easy at all. It's easier for the user to scroll down and just look at the sidebar for an icon of error or warning than manually checking each line's color syntaxing. |
@grenzor |
I agree, but my use case was someone with already written filters in uBO who then imported them into Nano. |
@grenzor |
Filter Linter
Show warning if:
Common mistakes:
||example.com^$generichide
- Forgot@@
orimportant
It is quite rare that someone want to use important on generichide, chances are he forgot
@@
.Detection logic: If a filter has
generhichide
but notimportant
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#3372When 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 suffixFilter will not work as expected.
Detection logic: Could be difficult to implement.
Whitelist Linter
Show warning if:
The text was updated successfully, but these errors were encountered: