broccoli-lint-eslint
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -1,3 +0,5 @@ | ||
var Filter = require('broccoli-filter'), | ||
CLIEngine = require('eslint').CLIEngine; | ||
var Filter = require('broccoli-filter'); | ||
var CLIEngine = require('eslint').CLIEngine; | ||
var linter = require('eslint').linter; | ||
var path = require('path'); | ||
@@ -52,2 +54,3 @@ /** | ||
config.rulePaths = options.rulesdir ? [options.rulesdir] : []; | ||
if ('config' in options) { | ||
@@ -71,2 +74,15 @@ config.rulePaths = options.config; | ||
EslintValidationFilter.prototype.targetExtension = 'js'; | ||
EslintValidationFilter.prototype.write = function (readTree, destDir) { | ||
var that = this | ||
return readTree(this.inputTree).then(function (srcDir) { | ||
if (!that.eslintrc) { | ||
that.eslintrc = srcDir; | ||
} | ||
return Filter.prototype.write.call(that, readTree, destDir) | ||
}); | ||
}; | ||
EslintValidationFilter.prototype.processString = function (content, relativePath) { | ||
@@ -78,3 +94,4 @@ 'use strict'; | ||
// verify file content | ||
var result = this.cli.executeOnText(content).results[0].messages; | ||
var config = this.cli.getConfigForFile(this.eslintrc + '/' + relativePath); | ||
var result = linter.verify(content, config, relativePath); | ||
@@ -81,0 +98,0 @@ // if verification has result |
{ | ||
"name": "broccoli-lint-eslint", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "broccoli filter that runs eslint", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
15783
244