mozilla / addons-linter

🔍 Firefox Add-ons linter, written in JavaScript. 👁

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Add-on with i18n message in CSS gets validation warning

danny0838 opened this issue · comments

Describe the problem and steps to reproduce it:

An add-on with i18n message in CSS gets validation warning.

What happened?

An add-on with i18n message in a CSS file, such as:

ul { padding-__MSG_@@bidi_start_edge__: 20px; }

gets an Unknown word warning during validation.

What did you expect to happen?

No warning should shown.

┆Issue is synchronized with this Jira Task

This was introduced in #53. The value at this point is unclear. Invalid CSS is not much different from invalid HTML: bugs that results in broken markup/appearance should be detected by the extension developer. Even if a CSS file is syntactically valid, there may be other issues. We should remove https://github.com/mozilla/addons-linter/blob/b7e0523ee331f0961807cef9df8cb064f41a6ded/src/scanners/css.js

I'm not opposed to CSS syntax checking, as a CSS syntax error usually imply an unconscious mistake and a potential error, and providing a check and warning is reasonable.

The problem is that, in the context of an extension, CSS syntax warning on a I18N message is obviously a false positive. If this is not fixed, developers can only choose to ignore the warning —and a potentially existing real CSS syntax error—when a CSS file has I18N.

Not sure how I18N message is handled for an extension CSS. It it's a simple pattern search and replace, maybe this issue can be easily fixed by running the CSS checker after applying the same search and replace of a CSS file.