Added a gulp task to lint all the .ts files

This commit is contained in:
Erich Gamma 2016-09-16 12:11:00 +02:00
Родитель 7725a60755
Коммит 6bd1d931d0
5 изменённых файлов: 66 добавлений и 86 удалений

1
.gitignore поставляемый Normal file
Просмотреть файл

@ -0,0 +1 @@
node_modules

31
.vscode/tasks.json поставляемый Normal file
Просмотреть файл

@ -0,0 +1,31 @@
{
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
"version": "0.1.0",
"command": "gulp",
"isShellCommand": true,
"args": [
"--no-color"
],
"tasks": [
{
"taskName": "tslint",
"args": [],
"problemMatcher": {
"owner": "tslint",
"fileLocation": [
"relative",
"${workspaceRoot}"
],
"severity": "warning",
"pattern": {
"regexp": "^(\\S.*)\\[(\\d+), (\\d+)\\]:\\s+(.*)$",
"file": 1,
"line": 2,
"column": 3,
"message": 4
}
}
}
]
}

12
gulpfile.js Normal file
Просмотреть файл

@ -0,0 +1,12 @@
'use strict';
const gulp = require('gulp');
const gulp_tslint = require('gulp-tslint');
gulp.task('default', ['tslint']);
gulp.task('tslint', () => {
return gulp.src(['**/*.ts', '!**/*.d.ts', '!node_modules/**'])
.pipe(gulp_tslint())
.pipe(gulp_tslint.report());
});

16
package.json Normal file
Просмотреть файл

@ -0,0 +1,16 @@
{
"name": "vscode-tslint",
"version": "1.0.0",
"description": "The umbrella project for the tslint client and server",
"main": " ",
"devDependencies": {
"tslint": "^3.15.0",
"gulp": "^3.9.1",
"gulp-tslint": "^6.1.1"
},
"repository": {
"type": "git",
"url": "git+https://github.com/Microsoft/vscode-tslint.git"
},
"author": "egamma"
}

Просмотреть файл

@ -1,92 +1,12 @@
{ {
"rules": { "rules": {
"class-name": true,
"comment-format": [
true,
"check-space"
],
"curly": true,
"eofline": true,
"forin": true,
"indent": [
true,
"tabs"
],
"label-position": true,
"label-undefined": true,
"max-line-length": [
true,
140
],
"member-access": true,
"member-ordering": [
true,
"public-before-private",
"static-before-instance",
"variables-before-functions"
],
"no-arg": true,
"no-bitwise": true,
"no-console": [
true,
"debug",
"info",
"time",
"timeEnd",
"trace"
],
"no-construct": true,
"no-debugger": true,
"no-duplicate-key": true,
"no-duplicate-variable": true,
"no-empty": true,
"no-eval": true,
"no-inferrable-types": true,
"no-shadowed-variable": true,
"no-string-literal": true,
"no-switch-case-fall-through": true,
"trailing-comma": true,
"no-trailing-whitespace": true,
"no-unused-expression": true, "no-unused-expression": true,
"no-duplicate-variable": true,
"no-duplicate-key": true,
"no-unused-variable": true, "no-unused-variable": true,
"no-unreachable": true, "curly": true,
"no-use-before-declare": true, "class-name": true,
"no-var-keyword": true, "semicolon": ["always"],
"object-literal-sort-keys": false, "triple-equals": true
"one-line": [
true,
"check-open-brace",
"check-catch",
"check-else",
"check-whitespace"
],
"radix": true,
"semicolon": [
true,
"always"
],
"triple-equals": [
true,
"allow-null-check"
],
"typedef-whitespace": [
true,
{
"call-signature": "nospace",
"index-signature": "nospace",
"parameter": "nospace",
"property-declaration": "nospace",
"variable-declaration": "nospace"
}
],
"variable-name": false,
"whitespace": [
true,
"check-branch",
"check-decl",
"check-operator",
"check-separator",
"check-type"
]
} }
} }