tslint-jasmine-rules
Advanced tools
Comparing version 1.5.1 to 1.6.0
@@ -16,6 +16,7 @@ "use strict"; | ||
__extends(CallExpressionWalker, _super); | ||
function CallExpressionWalker(sourceFile, options, regex, failureString) { | ||
function CallExpressionWalker(sourceFile, options, regex, failureString, ruleSeverity) { | ||
var _this = _super.call(this, sourceFile, options) || this; | ||
_this.regex = regex; | ||
_this.failureString = failureString; | ||
_this.ruleSeverity = ruleSeverity; | ||
return _this; | ||
@@ -26,3 +27,5 @@ } | ||
if (match) { | ||
var fix = Lint.Replacement.deleteText(node.getStart(), 1); | ||
var fix = this.ruleSeverity === "error" | ||
? Lint.Replacement.deleteText(node.getStart(), 1) | ||
: undefined; | ||
this.addFailureAt(node.getStart(), match[0].length, this.failureString, fix); | ||
@@ -29,0 +32,0 @@ } |
module.exports = { | ||
rulesDirectory: "./", | ||
rulesDirectory: "./" | ||
}; |
@@ -21,3 +21,3 @@ "use strict"; | ||
Rule.prototype.apply = function (sourceFile) { | ||
return this.applyWithWalker(new callExpressionWalker_1.CallExpressionWalker(sourceFile, this.getOptions(), Rule.REGEX, Rule.FAILURE_STRING)); | ||
return this.applyWithWalker(new callExpressionWalker_1.CallExpressionWalker(sourceFile, this.getOptions(), Rule.REGEX, Rule.FAILURE_STRING, this.ruleSeverity)); | ||
}; | ||
@@ -24,0 +24,0 @@ Rule.FAILURE_STRING = "Disabled test (xit or xdescribe)"; |
@@ -21,3 +21,3 @@ "use strict"; | ||
Rule.prototype.apply = function (sourceFile) { | ||
return this.applyWithWalker(new callExpressionWalker_1.CallExpressionWalker(sourceFile, this.getOptions(), Rule.REGEX, Rule.FAILURE_STRING)); | ||
return this.applyWithWalker(new callExpressionWalker_1.CallExpressionWalker(sourceFile, this.getOptions(), Rule.REGEX, Rule.FAILURE_STRING, this.ruleSeverity)); | ||
}; | ||
@@ -24,0 +24,0 @@ Rule.FAILURE_STRING = "Focused test (fit or fdescribe)"; |
{ | ||
"name": "tslint-jasmine-rules", | ||
"version": "1.5.1", | ||
"version": "1.6.0", | ||
"description": "tslint rules for jasmine", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -35,1 +35,3 @@ # tslint-jasmine-rules | ||
* no-disabled-tests | ||
Fixes are __not__ applied when `"severity": "warning"` is used. |
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
10695
179
37