Skip to content

Commit

Permalink
fixes palantir#20
Browse files Browse the repository at this point in the history
  • Loading branch information
ashwinr committed Aug 22, 2013
1 parent 68c8c91 commit 504383f
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 30 deletions.
26 changes: 16 additions & 10 deletions bin/tslint-cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -27070,10 +27070,11 @@ var Lint;
_super.apply(this, arguments);
}
IndentRule.prototype.isEnabled = function () {
var option = this.getOptions()[0];

if (typeof option === "number" && option > 0) {
return true;
if (_super.prototype.isEnabled.call(this)) {
var option = this.getOptions()[0];
if (typeof option === "number" && option > 0) {
return true;
}
}

return false;
Expand Down Expand Up @@ -27426,10 +27427,11 @@ var Lint;
_super.apply(this, arguments);
}
MaxLenRule.prototype.isEnabled = function () {
var option = this.getOptions()[0];

if (typeof option === "number" && option > 0) {
return true;
if (_super.prototype.isEnabled.call(this)) {
var option = this.getOptions()[0];
if (typeof option === "number" && option > 0) {
return true;
}
}

return false;
Expand Down Expand Up @@ -27802,8 +27804,12 @@ var Lint;
_super.apply(this, arguments);
}
QuoteMarkRule.prototype.isEnabled = function () {
var quoteMarkString = this.getOptions()[0];
return (quoteMarkString === "single" || quoteMarkString === "double");
if (_super.prototype.isEnabled.call(this)) {
var quoteMarkString = this.getOptions()[0];
return (quoteMarkString === "single" || quoteMarkString === "double");
}

return false;
};

QuoteMarkRule.prototype.apply = function (syntaxTree) {
Expand Down
26 changes: 16 additions & 10 deletions lib/tslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -27070,10 +27070,11 @@ var Lint;
_super.apply(this, arguments);
}
IndentRule.prototype.isEnabled = function () {
var option = this.getOptions()[0];

if (typeof option === "number" && option > 0) {
return true;
if (_super.prototype.isEnabled.call(this)) {
var option = this.getOptions()[0];
if (typeof option === "number" && option > 0) {
return true;
}
}

return false;
Expand Down Expand Up @@ -27426,10 +27427,11 @@ var Lint;
_super.apply(this, arguments);
}
MaxLenRule.prototype.isEnabled = function () {
var option = this.getOptions()[0];

if (typeof option === "number" && option > 0) {
return true;
if (_super.prototype.isEnabled.call(this)) {
var option = this.getOptions()[0];
if (typeof option === "number" && option > 0) {
return true;
}
}

return false;
Expand Down Expand Up @@ -27802,8 +27804,12 @@ var Lint;
_super.apply(this, arguments);
}
QuoteMarkRule.prototype.isEnabled = function () {
var quoteMarkString = this.getOptions()[0];
return (quoteMarkString === "single" || quoteMarkString === "double");
if (_super.prototype.isEnabled.call(this)) {
var quoteMarkString = this.getOptions()[0];
return (quoteMarkString === "single" || quoteMarkString === "double");
}

return false;
};

QuoteMarkRule.prototype.apply = function (syntaxTree) {
Expand Down
9 changes: 5 additions & 4 deletions src/rules/indentRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ module Lint.Rules {
public static FAILURE_STRING = "unexpected tab width: ";

public isEnabled(): boolean {
var option = this.getOptions()[0];

if (typeof option === "number" && option > 0) {
return true;
if (super.isEnabled()) {
var option = this.getOptions()[0];
if (typeof option === "number" && option > 0) {
return true;
}
}

return false;
Expand Down
9 changes: 5 additions & 4 deletions src/rules/maxLenRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,11 @@ module Lint.Rules {
public static FAILURE_STRING = "exceeds maximum line length of ";

public isEnabled(): boolean {
var option = this.getOptions()[0];

if (typeof option === "number" && option > 0) {
return true;
if (super.isEnabled()) {
var option = this.getOptions()[0];
if (typeof option === "number" && option > 0) {
return true;
}
}

return false;
Expand Down
8 changes: 6 additions & 2 deletions src/rules/quoteMarkRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,12 @@ module Lint.Rules {
public static DOUBLE_QUOTE_FAILURE = "' should be \"";

public isEnabled(): boolean {
var quoteMarkString = this.getOptions()[0];
return (quoteMarkString === "single" || quoteMarkString === "double");
if (super.isEnabled()) {
var quoteMarkString = this.getOptions()[0];
return (quoteMarkString === "single" || quoteMarkString === "double");
}

return false;
}

public apply(syntaxTree: TypeScript.SyntaxTree): RuleFailure[] {
Expand Down

0 comments on commit 504383f

Please sign in to comment.