addons-linter
The Add-ons Linter is being used by web-ext and addons.mozilla.org to lint WebExtensions.
It can also be used as a standalone binary and library.
You can find more information about the linter and it's implemented rules in our documentation.
Usage
Command Line
You need Node.js to use the add-ons linter.
To validate your add-on locally, install the linter from npm:
# Install globally so you can use the linter from any directory on
# your machine.
npm install -g addons-linterAfter installation, run the linter and direct it to your add-on file:
addons-linter my-addon.zipAlternatively you can point it at a directory:
addons-linter my-addon/src/The addons-linter will check your add-on and show you errors, warnings, and friendly messages for your add-on. If you want more info on the options you can enable/disable for the command-line app, use the --help option:
addons-linter --help#### Privileged extensions
The addons-linter can lint privileged extensions only when the --privileged option is passed to it. This option changes the behavior of the linter to:
- emit errors when the input file (or directory) is a regular extension (i.e. the extension does not use privileged features)
- hide messages related to privileged features (e.g., permissions and properties) when the input file (or directory) is a privileged extension