Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linter should report wrong min version for APIs usage, based on mdn/browser-compat-data #1493

Closed
yfdyh000 opened this issue Aug 22, 2017 · 3 comments

Comments

@yfdyh000
Copy link
Contributor

Describe the problem and steps to reproduce it:

e.g. M-Reimer/undoclosetab#9

What happened?

No errors or warnings reported.

What did you expect to happen?

Based on https://github.com/mdn/browser-compat-data/tree/master/webextensions, check for possible errors and report in amo validator and web-ext lint.

@EnTeQuAk
Copy link
Contributor

I think this is a great idea, we already have our linter use the official schema for validation but that schema is not yet versioned so either we start versioning the schema and report based on that or indeed use mdn/browser-compat-data which seems quite extensive. I don't know if the browser-compat-data contains all APIs though, maybe @andymckay knows how that's maintained?

@EnTeQuAk
Copy link
Contributor

Note to myself: https://github.com/mdn/browser-compat-data#installation - browser-compat-data is available as an npm package which should make things easier.

@andymckay
Copy link

@EnTeQuAk that repo is maintained by @wbamberg and the MDN team.

freaktechnik added a commit to freaktechnik/addons-linter that referenced this issue Nov 23, 2018
freaktechnik added a commit to freaktechnik/addons-linter that referenced this issue Nov 23, 2018
freaktechnik added a commit to freaktechnik/addons-linter that referenced this issue Dec 5, 2018
freaktechnik added a commit to freaktechnik/addons-linter that referenced this issue Dec 5, 2018
freaktechnik added a commit to freaktechnik/addons-linter that referenced this issue Dec 5, 2018
EnTeQuAk pushed a commit that referenced this issue Dec 11, 2018
…ersion (#1493) (#2290)

Fixes #1493

This is a first attempt at integrating the browser-compat-data from the MDN compatibility tables with the linter.
It currently checks for manifest keys, permissions and APIs to be supported by the given `strict_min_version` in the manifest for both Firefox and Firefox for Android. All produced messages are warnings. However, no warning is shown if Firefox or Firefox for Android do not implement an API and that is documented in the compat data. This is to avoid a lot of Firefox for Android spam, plus the totally unsupported APIs should be caught by the schemas.

I'm not quite happy with the amount of duplication of logic, even though it's subtly different for all cases, so improvement suggestions welcome! Further I'll happily add more tests, these are just the ones I could come up with.
EnTeQuAk added a commit that referenced this issue Dec 11, 2018
* Pin dependencies to fixed version again
* Don't ignore files and folders with a leading dot. (#2316)
* Detect API and manifest key incompatibilities with strict_min_version (#1493) (#2290)
* Move internal scripts to separate folder (#2309)
* Various dependency updates
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants