Skip to content

Commit

Permalink
Update to have lint, watch, and build commands.
Browse files Browse the repository at this point in the history
  • Loading branch information
abierbaum committed Apr 21, 2017
1 parent 64d0ed2 commit 7cd9a45
Show file tree
Hide file tree
Showing 9 changed files with 849 additions and 26 deletions.
13 changes: 12 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,20 @@
],
"license": "MIT",
"dependencies": {
"tslint": "^4.1.1"
"tslint": "^4.1.1",
"chokidar-cli": "1.2.0"
},
"devDependencies": {
"typescript": "~2.1.0"
},
"watch": {
"test": "rules/*.ts"
},
"scripts": {
"build": "tsc -p .",
"lint": "tslint rules/*.ts",
"test:once": "./run_tests.sh",
"test": "npm run lint && npm run build && npm run test:once",
"watch": "chokidar 'rules/*.ts' 'test/**/*' -c 'npm run test'"
}
}
2 changes: 1 addition & 1 deletion rules/literalSpacingRule.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions rules/literalSpacingRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -114,10 +114,10 @@ class LiteralSpacingRuleWalker extends Lint.RuleWalker {
}

if (ALWAYS_OPT === checkType) {
if((!is_empty) &&
(edgeText.length === 0) &&
(nodeEdgeChar !== " ")) {
self.addFailure(self.createFailure(start, 1, ALWAYS_FAIL));
if ((!is_empty) &&
(edgeText.length === 0) &&
(nodeEdgeChar !== " ")) {
self.addFailure(self.createFailure(start, 1, ALWAYS_FAIL));
}
}
}
Expand Down
6 changes: 3 additions & 3 deletions rules/noJasmineFocusRule.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions rules/noJasmineFocusRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import * as Lint from "tslint";
import * as ts from "typescript";

const JASMINE_FOCUS_FAIL = "Don't keep jasmine focus methods";
const BAD_CALL_NAMES = ['fdescribe', 'fit'];
const BAD_CALL_NAMES = ["fdescribe", "fit"];

export class Rule extends Lint.Rules.AbstractRule {
public apply(sourceFile: ts.SourceFile): Lint.RuleFailure[] {
Expand All @@ -28,7 +28,7 @@ class NoJasmineFocusRuleWalker extends Lint.RuleWalker {
let func_id = (node.expression as ts.Identifier);
let func_name = func_id.getText();

if (BAD_CALL_NAMES.indexOf(func_name) != -1) {
if (BAD_CALL_NAMES.indexOf(func_name) !== -1) {
this.addFailure(this.createFailure(func_id.getStart(), func_id.getWidth(), JASMINE_FOCUS_FAIL));
}

Expand Down
2 changes: 1 addition & 1 deletion run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
set -v

# Compile all rules
./node_modules/.bin/tsc -p .
#./node_modules/.bin/tsc -p .

# Now run the tests
#./node_modules/.bin/tslint --test test/rules/no-imports/default
Expand Down
4 changes: 3 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"removeComments": true,
"inlineSourceMap": true,
"preserveConstEnums": true,
"strictNullChecks": true
"strictNullChecks": false,
"noUnusedLocals": true,
"noUnusedParameters": true
}
}
1 change: 0 additions & 1 deletion tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"object-literal-sort-keys": true,
Expand Down
Loading

0 comments on commit 7cd9a45

Please sign in to comment.