This repository has been archived by the owner on Mar 25, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 887
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #912 from palantir/rules-directory-fix
Improve handling of paths to custom rules directories
- Loading branch information
Showing
7 changed files
with
123 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"rulesDirectory": "../files/custom-rules/", | ||
"rules": { | ||
"always-fail": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
{ | ||
"rules": { | ||
"always-fail": true | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); | ||
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); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters