Skip to content
This repository was archived by the owner on Aug 9, 2021. It is now read-only.

Commit

Permalink
add tslint
Browse files Browse the repository at this point in the history
  • Loading branch information
wuhanyumsft committed Aug 25, 2017
1 parent c394228 commit 05344b3
Show file tree
Hide file tree
Showing 7 changed files with 176 additions and 5 deletions.
2 changes: 1 addition & 1 deletion dist/main.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var greet_1 = require("./greet");
console.log(greet_1.sayHello("TypeScript"));
console.log(greet_1.sayHello('TypeScript'));
10 changes: 9 additions & 1 deletion gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
var gulp = require("gulp");
var ts = require("gulp-typescript");
var tslint = require("gulp-tslint");
var tsProject = ts.createProject("tsconfig.json");

gulp.task("default", function () {
return tsProject.src()
.pipe(tslint({
options: {
configuration: 'tslint.json'
},
formatter: "verbose"
}))
.pipe(tslint.report())
.pipe(tsProject())
.js.pipe(gulp.dest("dist"));
});
});
98 changes: 98 additions & 0 deletions package-lock.json

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

2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@
"homepage": "https://github.com/wuhanyumsft/type2docfx#readme",
"devDependencies": {
"gulp": "^3.9.1",
"gulp-tslint": "^8.1.2",
"gulp-typescript": "^3.2.2",
"tslint": "^5.6.0",
"typescript": "^2.4.2"
}
}
2 changes: 1 addition & 1 deletion src/greet.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export function sayHello(name: string) {
return `Hello from ${name}`;
}
}
4 changes: 2 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
import { sayHello } from "./greet";
import { sayHello } from './greet';

console.log(sayHello("TypeScript"));
console.log(sayHello('TypeScript'));
63 changes: 63 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"rules": {
"align": false,
"ban": [],
"class-name": true,
"comment-format": [ true, "check-space" ],
"curly": true,
"eofline": true,
"forin": false,
"indent": [ true, "spaces" ],
"interface-name": [ true, "never-prefix" ],
"jsdoc-format": true,
"label-position": true,
"max-line-length": 120,
"member-access": false,
"member-ordering": false,
"no-any": false,
"no-arg": true,
"no-bitwise": false,
"no-consecutive-blank-lines": true,
"no-console": false,
"no-construct": false,
"no-debugger": true,
"no-duplicate-variable": true,
"no-empty": false,
"no-eval": true,
"no-inferrable-types": [ true, "ignore-params" ],
"no-shadowed-variable": false,
"no-string-literal": false,
"no-switch-case-fall-through": false,
"no-trailing-whitespace": true,
"no-unused-expression": false,
"no-use-before-declare": false,
"no-var-keyword": true,
"no-var-requires": false,
"object-literal-sort-keys": false,
"one-line": [ true, "check-open-brace", "check-whitespace", "check-else", "check-catch" ],
"quotemark": [ true, "single", "avoid-escape" ],
"radix": true,
"semicolon": [ true, "always" ],
"trailing-comma": [ true, {
"multiline": "never",
"singleline": "never"
} ],
"triple-equals": [ true, "allow-null-check" ],
"typedef": false,
"typedef-whitespace": [ true, {
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}, {
"call-signature": "onespace",
"index-signature": "onespace",
"parameter": "onespace",
"property-declaration": "onespace",
"variable-declaration": "onespace"
} ],
"variable-name": [ true, "check-format", "allow-leading-underscore", "ban-keywords" ],
"whitespace": [ true, "check-branch", "check-decl", "check-operator", "check-module", "check-separator", "check-type", "check-typecast" ]
}
}

0 comments on commit 05344b3

Please sign in to comment.