npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

broccoli-lint-eslint

v6.0.0

Published

broccoli filter that runs eslint

Downloads

127,416

Readme

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

npm install --save broccoli-lint-eslint

broccoli-lint-eslint@5 uses eslint@5 which requires Node.js 6 or above. If you need support for Node.js 4, you may use broccoli-lint-eslint@4 which uses eslint@4 and is compatible with Node.js 4:

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

Usage

var ESLint = require('broccoli-lint-eslint');
var outputNode = ESLint.create(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.create(inputNode, {
        options: {
          configFile: this.eslintrc.app + '/eslint.json'
        },
        testGenerator: testGenerator
      });
    • group {string|undefined}: Groups the generated ESLint tests into a single file and test suite with the given group name.

      Default: undefined

    • 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

    • extensions {Array}: File extensions to lint. NOTE: If you add Typescript files typescript-eslint-parser has to be installed and specified as the parser. For more information take a look at the typescript-eslint-parser

      Default: ['js']