-
Notifications
You must be signed in to change notification settings - Fork 887
Commit
If rules directory is supplied in a tslint.json or package.json file, look for directory relative to .json file. If rules directory is supplied via CLI, look for directory relative to CwD.
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"rulesDirectory": "../files/custom-rules/", | ||
"rules": { | ||
"always-fail": true | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"rules": { | ||
"always-fail": true | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
var __extends = (this && this.__extends) || function (d, b) { | ||
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; | ||
function __() { this.constructor = d; } | ||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); | ||
}; | ||
var Lint = require("tslint/lib/lint"); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
jkillian
Contributor
|
||
var Rule = (function (_super) { | ||
__extends(Rule, _super); | ||
function Rule() { | ||
_super.apply(this, arguments); | ||
} | ||
Rule.prototype.apply = function (sourceFile) { | ||
return this.applyWithWalker(new AlwaysFailWalker(sourceFile, this.getOptions())); | ||
}; | ||
return Rule; | ||
})(Lint.Rules.AbstractRule); | ||
exports.Rule = Rule; | ||
var AlwaysFailWalker = (function (_super) { | ||
__extends(AlwaysFailWalker, _super); | ||
function AlwaysFailWalker() { | ||
_super.apply(this, arguments); | ||
} | ||
AlwaysFailWalker.prototype.visitSourceFile = function (node) { | ||
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), "failure")); | ||
}; | ||
return AlwaysFailWalker; | ||
})(Lint.RuleWalker); |
is it intentional that this test asserts against the released version of tslint in
node_modules
rather than the built version (eg usingrequire("../../../bin/tslint/lib/lint")
) ??It seems like this test only observes failures following a release, rather than catching issues introduced locally.
cc @ScottSWu