Detalhes do pacote

broccoli-lint-eslint

ember-cli91.9kMIT6.0.0

broccoli filter that runs eslint

broccoli, broccoli-eslint, broccoli-lint, broccoli-plugin

readme (leia-me)

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']

changelog (log de mudanças)

v6.0.0 (2019-09-05)

:boom: Breaking Change

:rocket: Enhancement

:house: Internal

  • #161 TravisCI: Remove deprecated sudo: false option (@Turbo87)
  • #150 test/run-eslint: Use p-finally instead of .finally() (@Turbo87)

Committers: 3

v5.0.0 (2018-11-09)

:boom: Breaking Change

:memo: Documentation

:house: Internal

  • #151 Increase default mocha timeout to 5sec (@Turbo87)
  • #117 Ensure linting is ran as part of CI. (@rwjblue)
  • #140 Fix ci with broccoli-persistent-filter 2.1.0 (@Gaurav0)
  • #143 Convert EslintValidationFilter to an ES6 class (@Turbo87)
  • #139 Fix .eslintignore test and add test for including dotfile (@Gaurav0)

Committers: 4

v4.2.1 (2017-11-07)

Full Changelog

Fixed bugs:

  • Invoke super with the valid args to avoid ENOENT #115 (rwjblue)

Merged pull requests:

  • Failing test PR emulating ember-cli/ember-cli#7347 #118 (rwjblue)
  • Cleaning up unused options #114 (chrmod)

v4.2.0 (2017-10-27)

Full Changelog

Implemented enhancements:

  • Add static immutable "testGenerators" list property #113 (Turbo87)
  • Deprecate constructor usage in favor of .create() and add documentation #109 (Turbo87)

Fixed bugs:

  • Update README with details on test grouping. #107

Merged pull requests:

v4.1.0 (2017-07-17)

Full Changelog

Merged pull requests:

v4.0.0 (2017-06-18)

Full Changelog

Merged pull requests:

v3.3.1 (2017-05-04)

Full Changelog

Implemented enhancements:

  • CI: Use "auto-dist-tag" for deployment #97 (Turbo87)

Closed issues:

  • Extract test generators into "broccoli-lint-test-generators" package #96

Merged pull requests:

  • Use "aot-test-generators" to generate tests #98 (Turbo87)

v3.3.0 (2017-05-01)

Full Changelog

Implemented enhancements:

  • Add factory function and "group" option #95 (Turbo87)

Fixed bugs:

Merged pull requests:

v3.2.1 (2017-03-19)

Full Changelog

Fixed bugs:

Closed issues:

  • An in-range update of broccoli-merge-trees is breaking the build 🚨 #80

Merged pull requests:

v3.2.0 (2017-01-03)

Full Changelog

Closed issues:

  • Plans for migrating to ESLint 3.0? #76

Merged pull requests:

v2.7.0 (2016-09-13)

Full Changelog

Implemented enhancements:

  • Add support for setting throwOnWarn option #45

Closed issues:

  • Minimum builderFeatures required; persistent output flag error #39

Merged pull requests:

v2.6.0 (2016-08-19)

Full Changelog

v2.5.0 (2016-08-19)

Full Changelog

Implemented enhancements:

Merged pull requests:

v3.1.0 (2016-08-08)

Full Changelog

Closed issues:

  • Cannot set throwOnError #7

Merged pull requests:

v3.0.0 (2016-07-18)

Full Changelog

Closed issues:

  • Upgrade to eslint 3.0.x #40

Merged pull requests:

v2.4.1 (2016-07-17)

Full Changelog

Merged pull requests:

v2.4.0 (2016-06-10)

Full Changelog

Closed issues:

  • Allow test generator to determine what counts as failing #10

Merged pull requests:

  • Allow the testGenerator function to handle warnings. #38 (rwjblue)

v2.3.0 (2016-05-19)

Full Changelog

Merged pull requests:

  • Improve logic that filters out error messages related to ignored files #37 (BrianSipple)

v2.2.1 (2016-04-20)

Full Changelog

Closed issues:

  • Windows : Invalid regular expression #35
  • Support for ".eslintrc.js" #33
  • Needs to have 2.2.0 published to NPM #32

Merged pull requests:

v2.2.0 (2016-04-12)

Full Changelog

Closed issues:

  • Not accepting nested configurations #26
  • Other maintainer wanted #20
  • Update broccoli-filter #12

Merged pull requests:

v2.1.0 (2016-03-21)

Full Changelog

Closed issues:

  • Pin ESLint dependency to 2.2.0 #23

Merged pull requests:

v2.0.1 (2016-03-14)

Closed issues:

  • Latest version is missing build directory when installed #22
  • Update versioning to match with 2.x eslint #17
  • OS-dependent path-handling #15
  • Use of arrow functions breaks non-harmony node #13
  • Upgrade dependencies #8
  • Make pass eslint-config-nightmare-mode #5
  • Improve documentation #3

Merged pull requests:

* This Change Log was automatically generated by github_changelog_generator