Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

broccoli-lint-eslint

Package Overview
Dependencies
Maintainers
5
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

broccoli-lint-eslint

broccoli filter that runs eslint

  • 3.3.2
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
24K
increased by14.98%
Maintainers
5
Weekly downloads
 
Created
Source

broccoli-lint-eslint

Latest NPM release TravisCI Build Status License Dependencies Dev Dependencies

Lint JavaScript with ESLint as part of your Broccoli build pipeline.

Most of the test setup and the build configuration is based on sindresorhus/grunt-eslint. The internal validation is heavily inspired by eslint cli.js.

Installation

As of 3.0.0, broccoli-lint-eslint uses versions of eslint greater than 3.0.0. Because eslint@3.0.0 dropped support for Node versions below 4, you may need to use the latest 2.x version of broccoli-lint-eslint (which uses eslint@2.13.1), if your support needs also fall below Node v4:

npm install --save broccoli-lint-eslint@2

If versions of Node >= 4 suit your needs, you can safely install the latest version of broccoli-lint-eslint:

npm install --save broccoli-lint-eslint

Usage

var eslint = require('broccoli-lint-eslint');
var outputNode = eslint(inputNode, options);

API

  • inputNode A Broccoli node

  • options {Object}: Options to control how broccoli-lint-eslint is run.

    • format {string|function}: The path, or function reference, to a custom formatter (See eslint/tree/master/lib/formatters for alternatives).

      Default: 'eslint/lib/formatters/stylish'

    • testGenerator {function(relativePath, errors), returns reporter output string}: The function used to generate test modules. You can provide a custom function for your client side testing framework of choice.

      Default: null

      • relativePath - The relative path to the file being tested.
      • errors - An array of eslint error objects found.

      If you provide a string one of the predefined test generators is used. Currently supported are qunit and mocha.

      Example usage:

      var path = require('path');
      
      function testGenerator(relativePath, errors) {
        return "module('" + path.dirname(relativePath) + "');\n";
               "test('" + relativePath + "' should pass ESLint', function() {\n" +
               "  ok(" + passed + ", '" + moduleName + " should pass ESLint." + (errors ? "\\n" + errors : '') + "');\n" +
               "});\n";
      };
      
      return eslint(inputNode, {
        options: {
          configFile: this.eslintrc.app + '/eslint.json',
          rulesdir: this.eslintrc.app
        },
        testGenerator: testGenerator
      });
      
    • throwOnError {boolean}: Cause exception error on first violation with error-level severity.

      Default: false

    • throwOnWarn {boolean}: Cause exception error on first violation with warn-level severity. NOTE: Setting this to true will automatically enable throwOnError behavior.

      Default: false

    • persist {boolean}: Persist the state of filter output across restarts

      Default: false

    • console: {Object}: A custom console object with a log method for broccoli-lint-eslint to use when logging formatter output.

      Default: The global console object

    • options {options}: Options native to ESLint CLI. While all options will be passed to the ESLint CLIEngine, these are the ones that broccoli-lint-eslint makes use of in particular:

      • configFile {string}: Path to eslint configuration file.

        Default: ./eslintrc

      • rulePaths {Array}: Paths to a directory with custom rules. Your custom rules will be used in addition to the built-in ones. Recommended read: Working with Rules.

        Default: built-in rules directory

      • ignore {boolean}: false disables use of .eslintignore, ignorePath and ignorePattern

        Default: true

Keywords

FAQs

Package last updated on 14 Nov 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc