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

Commit 92abbcd

Browse files
committed
Merge pull request #533 from telerik/linter
Enable linter for common lib
2 parents 5843c03 + 526784c commit 92abbcd

File tree

3 files changed

+63
-1
lines changed

3 files changed

+63
-1
lines changed

Gruntfile.js

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,17 @@ module.exports = function(grunt) {
6767
}
6868
},
6969

70+
tslint: {
71+
build: {
72+
files: {
73+
src: ["**/*.ts", "!node_modules/**/*.ts", "!messages/**/*.ts", "!**/*.d.ts"]
74+
},
75+
options: {
76+
configuration: grunt.file.readJSON("./tslint.json")
77+
}
78+
}
79+
},
80+
7081
watch: {
7182
devall: {
7283
files: ["**/*.ts", "!node_modules/**/*.ts", 'test/**/*.ts'],
@@ -121,6 +132,7 @@ module.exports = function(grunt) {
121132
grunt.loadNpmTasks("grunt-contrib-watch");
122133
grunt.loadNpmTasks("grunt-shell");
123134
grunt.loadNpmTasks("grunt-ts");
135+
grunt.loadNpmTasks("grunt-tslint");
124136

125137
grunt.registerTask("set_package_version", function(version) {
126138
var buildVersion = getBuildVersion(version);
@@ -167,6 +179,6 @@ module.exports = function(grunt) {
167179
"shell:build_package",
168180
"setPackageName"
169181
]);
170-
182+
grunt.registerTask("lint", ["tslint:build"]);
171183
grunt.registerTask("default", "ts:devlib");
172184
};

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
"grunt-contrib-watch": "0.6.1",
7979
"grunt-shell": "1.1.2",
8080
"grunt-ts": "4.2.0",
81+
"grunt-tslint": "2.5.0",
8182
"istanbul": "0.3.17",
8283
"mocha": "2.2.5",
8384
"mocha-fibers": "https://github.com/Icenium/mocha-fibers/tarball/master",

tslint.json

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"rules": {
3+
"class-name": true,
4+
"curly": true,
5+
"eofline": true,
6+
"indent": true,
7+
"interface-name": true,
8+
"jsdoc-format": true,
9+
"max-line-length": [false, 140],
10+
"no-consecutive-blank-lines": true,
11+
"no-construct": true,
12+
"no-debugger": true,
13+
"no-duplicate-key": true,
14+
"no-duplicate-variable": true,
15+
"no-shadowed-variable": true,
16+
"no-empty": true,
17+
"no-eval": true,
18+
"no-switch-case-fall-through": true,
19+
"no-trailing-whitespace": true,
20+
"no-unreachable": true,
21+
"no-unused-expression": true,
22+
"no-unused-variable": true,
23+
"no-use-before-declare": true,
24+
"no-var-keyword": true,
25+
"no-var-requires": false,
26+
"one-line": [
27+
true,
28+
"check-open-brace",
29+
"check-catch",
30+
"check-else"
31+
],
32+
"quotemark": [false, "double"],
33+
"semicolon": true,
34+
"switch-default": false,
35+
"triple-equals": [true, "allow-null-check"],
36+
"use-strict": true,
37+
"variable-name": [false, "allow-leading-underscore"],
38+
"whitespace": [
39+
false,
40+
"check-branch",
41+
"check-decl",
42+
"check-operator",
43+
"check-module",
44+
"check-separator",
45+
"check-type",
46+
"check-typecast"
47+
]
48+
}
49+
}

0 commit comments

Comments
 (0)