Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

Commit

Permalink
A few tiny style tweaks (#1188)
Browse files Browse the repository at this point in the history
  • Loading branch information
jkillian authored and adidahiya committed Apr 30, 2016
1 parent 97a3a98 commit a99fbf7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 1 addition & 2 deletions src/rules/useIsnanRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ export class Rule extends Lint.Rules.AbstractRule {
}

class UseIsnanRuleWalker extends Lint.RuleWalker {

protected visitBinaryExpression(node: ts.BinaryExpression): void {
if (this.isExpressionNaN(node.left) || this.isExpressionNaN(node.right)
if ((this.isExpressionNaN(node.left) || this.isExpressionNaN(node.right))
&& node.operatorToken.kind !== ts.SyntaxKind.EqualsToken) {
this.addFailure(this.createFailure(node.getStart(), node.getWidth(), Rule.FAILURE_STRING + node.getText()));
}
Expand Down
3 changes: 3 additions & 0 deletions test/configurationTests.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,7 @@ describe("Configuration", () => {

describe("with config not relative to tslint", () => {
let tmpfile: string;

beforeEach(() => {
for (let i = 0; i < 5; i++) {
const attempt = path.join(os.tmpdir(), `tslint.test${Math.round(Date.now() * Math.random())}.json`);
Expand All @@ -99,11 +100,13 @@ describe("Configuration", () => {
throw new Error("Couldn't create temp file");
}
});

afterEach(() => {
if (tmpfile !== undefined) {
fs.unlinkSync(tmpfile);
}
});

it("extends with package installed relative to tslint", () => {
fs.writeFileSync(tmpfile, JSON.stringify({ extends: "tslint-test-config-non-relative" }));
let config = loadConfigurationFromPath(tmpfile);
Expand Down

0 comments on commit a99fbf7

Please sign in to comment.