How to use the addons-linter.createInstance function in addons-linter

To help you get started, we’ve selected a few addons-linter examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github agiledigital / mule-preview-browser-extension / scripts / lint-addon.js View on Github external
// The CLI doesn't let you exclude files so I had to write this little wrapper script
const linter = require("addons-linter");
const { join } = require("path");

const sourceDir = join(__dirname, "../extension");

console.log(`Linting source dir: [${sourceDir}]`);

const instance = linter.createInstance({
  config: {
    // This mimics the first command line argument from yargs,
    // which should be the directory to the extension.
    _: [sourceDir],
    logLevel: process.env.VERBOSE ? "debug" : "fatal",
    stack: Boolean(process.env.VERBOSE),
    pretty: false,
    warningsAsErrors: true,
    metadata: false,
    output: "none",
    boring: false,
    selfHosted: false,
    // Hot update files are full of evals etc.
    shouldScanFile: fileName => !/.*dist\/.*js/.test(fileName),

    runAsBinary: false
github frigus02 / RESTer / tools / scripts / lint-firefox-addon.js View on Github external
async function lintFirefoxAddon(options) {
    const ignoreList = await getIgnoreList();

    const linter = addonsLinter.createInstance({
        config: {
            // This mimics the first command line argument from yargs,
            // which should be the directory to the extension.
            _: [options.addonDir],
            logLevel: process.env.VERBOSE ? 'debug' : 'fatal',
            stack: Boolean(process.env.VERBOSE),
            pretty: false,
            warningsAsErrors: false,
            metadata: false,
            output: 'none',
            boring: false,
            selfHosted: false
        },
        runAsBinary: false
    });

addons-linter

Mozilla Add-ons Linter

MPL-2.0
Latest version published 9 days ago

Package Health Score

80 / 100
Full package analysis

Popular addons-linter functions

Similar packages