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

Enable linter for common lib #533

Merged
merged 1 commit into from
Nov 18, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,17 @@ module.exports = function(grunt) {
}
},

tslint: {
build: {
files: {
src: ["**/*.ts", "!node_modules/**/*.ts", "!messages/**/*.ts", "!**/*.d.ts"]
},
options: {
configuration: grunt.file.readJSON("./tslint.json")
}
}
},

watch: {
devall: {
files: ["**/*.ts", "!node_modules/**/*.ts", 'test/**/*.ts'],
Expand Down Expand Up @@ -121,6 +132,7 @@ module.exports = function(grunt) {
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-shell");
grunt.loadNpmTasks("grunt-ts");
grunt.loadNpmTasks("grunt-tslint");

grunt.registerTask("set_package_version", function(version) {
var buildVersion = getBuildVersion(version);
Expand Down Expand Up @@ -167,6 +179,6 @@ module.exports = function(grunt) {
"shell:build_package",
"setPackageName"
]);

grunt.registerTask("lint", ["tslint:build"]);
grunt.registerTask("default", "ts:devlib");
};
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@
"grunt-contrib-watch": "0.6.1",
"grunt-shell": "1.1.2",
"grunt-ts": "4.2.0",
"grunt-tslint": "2.5.0",
"istanbul": "0.3.17",
"mocha": "2.2.5",
"mocha-fibers": "https://github.com/Icenium/mocha-fibers/tarball/master",
Expand Down
49 changes: 49 additions & 0 deletions tslint.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"rules": {
"class-name": true,
"curly": true,
"eofline": true,
"indent": true,
"interface-name": true,
"jsdoc-format": true,
"max-line-length": [false, 140],
"no-consecutive-blank-lines": true,
"no-construct": true,
"no-debugger": true,
"no-duplicate-key": true,
"no-duplicate-variable": true,
"no-shadowed-variable": true,
"no-empty": true,
"no-eval": true,
"no-switch-case-fall-through": true,
"no-trailing-whitespace": true,
"no-unreachable": true,
"no-unused-expression": true,
"no-unused-variable": true,
"no-use-before-declare": true,
"no-var-keyword": true,
"no-var-requires": false,
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else"
],
"quotemark": [false, "double"],
"semicolon": true,
"switch-default": false,
"triple-equals": [true, "allow-null-check"],
"use-strict": true,
"variable-name": [false, "allow-leading-underscore"],
"whitespace": [
false,
"check-branch",
"check-decl",
"check-operator",
"check-module",
"check-separator",
"check-type",
"check-typecast"
]
}
}