gulp-eslint
Advanced tools
Comparing version 0.2.2 to 0.3.0
@@ -59,1 +59,17 @@ # Changelog | ||
## 0.2.1 (unreleased) | ||
* Upgraded eslint to 0.11.0 | ||
## 0.2.2 | ||
* Upgraded eslint to 0.13.0 | ||
* Fix filesystem-local .eslintrc loading | ||
* Fix filesystem-local .eslintignore loading | ||
* Add failAfterError to fail at the end of the stream instead of the first error (works well with 'format' method) | ||
## 0.3.0 | ||
* Import filesystem-local config plugins | ||
* Fix doc typo | ||
@@ -17,3 +17,5 @@ 'use strict'; | ||
function verify(filePath, contents) { | ||
// mimic CLIEngine::processFile | ||
var config = linter.getConfigForFile(filePath); | ||
util.loadPlugins(config.plugins); | ||
var messages = eslint.verify(contents, config, filePath); | ||
@@ -20,0 +22,0 @@ //eslint.reset(); |
{ | ||
"name": "gulp-eslint", | ||
"version": "0.2.2", | ||
"version": "0.3.0", | ||
"description": "A gulp plugin for processing files with eslint", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -59,3 +59,3 @@ # gulp-eslint [![Build Status](https://travis-ci.org/adametry/gulp-eslint.png)](https://travis-ci.org/adametry/gulp-eslint) | ||
*No explicit configuration.* A `.eslintrc` file my be resolved relative to each linted file. | ||
*No explicit configuration.* A `.eslintrc` file may be resolved relative to each linted file. | ||
@@ -62,0 +62,0 @@ ### eslint(options) |
16
util.js
@@ -6,3 +6,3 @@ 'use strict'; | ||
through = require('through'), | ||
EsLint = require('eslint').CLIEngine, | ||
CLIEngine = require('eslint').CLIEngine, | ||
IgnoredPaths = require('eslint/lib/ignored-paths'), | ||
@@ -58,2 +58,14 @@ FileFinder = require('eslint/lib/file-finder'); | ||
/** | ||
* Mimic the CLIEngine::loadPlugins | ||
*/ | ||
exports.loadPlugins = function (pluginNames) { | ||
// WARNING: HACK AHEAD! | ||
// We can either process text/file, or create a new CLIEngine instance to make use of the internal plugin cache. | ||
// Creating a new CLIEngine is probably the cheapest approach. | ||
return pluginNames && new CLIEngine({ | ||
plugins: pluginNames | ||
}) && void 0; | ||
}; | ||
/** | ||
* Create config helper to merge various config sources | ||
@@ -138,3 +150,3 @@ */ | ||
// load formatter (module, relative to cwd, eslint formatter) | ||
formatter = (new EsLint()).getFormatter(formatter); | ||
formatter = (new CLIEngine()).getFormatter(formatter); | ||
@@ -141,0 +153,0 @@ if (typeof formatter === 'string') { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
19183
303