mirror of
https://github.com/Microsoft/vscode
synced 2024-08-24 19:46:05 +00:00
Integrated tslint
This commit is contained in:
parent
491fc08ea2
commit
8fac1e1017
19
.vscode/tasks.json
vendored
19
.vscode/tasks.json
vendored
|
@ -25,6 +25,25 @@
|
|||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"taskName": "tslint",
|
||||
"args": [],
|
||||
"problemMatcher": {
|
||||
"owner": "tslint",
|
||||
"fileLocation": [
|
||||
"relative",
|
||||
"${workspaceRoot}"
|
||||
],
|
||||
"severity": "warning",
|
||||
"pattern": {
|
||||
"regexp": "^\\[tslint\\] (.*):(\\d+):(\\d+):\\s+(.*)$",
|
||||
"file": 1,
|
||||
"line": 2,
|
||||
"column": 3,
|
||||
"message": 4
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"taskName": "test",
|
||||
"args": [
|
||||
|
|
|
@ -7,6 +7,7 @@ var gulp = require('gulp');
|
|||
var filter = require('gulp-filter');
|
||||
var es = require('event-stream');
|
||||
var path = require('path');
|
||||
var tslint = require("gulp-tslint");
|
||||
|
||||
var all = [
|
||||
'*',
|
||||
|
@ -138,6 +139,40 @@ gulp.task('hygiene', function () {
|
|||
return hygiene();
|
||||
});
|
||||
|
||||
var allTypeScript = [
|
||||
'src/**/*.ts',
|
||||
'extensions/**/*.ts'
|
||||
];
|
||||
|
||||
var tslintFilter = [
|
||||
'**',
|
||||
'!**/*.d.ts',
|
||||
'!**/typings/**',
|
||||
'!**/*.test.ts',
|
||||
'!src/vs/editor/standalone-languages/test/**'
|
||||
];
|
||||
|
||||
const lintReporter = function (output, file, options) {
|
||||
//emits: src/helloWorld.c:5:3: warning: implicit declaration of function ‘prinft’
|
||||
var relativeBase = file.base.substring(file.cwd.length + 1);
|
||||
output.forEach(function(e) {
|
||||
var message = relativeBase + e.name + ':' + (e.startPosition.line + 1) + ':' + (e.startPosition.character + 1) + ': ' + e.failure;
|
||||
console.log('[tslint] ' + message);
|
||||
});
|
||||
};
|
||||
|
||||
gulp.task('tslint', function () {
|
||||
gulp.src(allTypeScript)
|
||||
.pipe(filter(tslintFilter))
|
||||
.pipe(tslint({
|
||||
rulesDirectory: "node_modules/tslint-microsoft-contrib"
|
||||
}))
|
||||
.pipe(tslint.report(lintReporter, {
|
||||
summarizeFailureOutput: false,
|
||||
emitError: false
|
||||
}))
|
||||
});
|
||||
|
||||
// this allows us to run this as a git pre-commit hook
|
||||
if (require.main === module) {
|
||||
var cp = require('child_process');
|
||||
|
|
|
@ -63,6 +63,8 @@
|
|||
"gulp-util": "^3.0.6",
|
||||
"gulp-vinyl-zip": "^1.1.0",
|
||||
"gulp-watch": "^4.2.4",
|
||||
"gulp-tslint": "^4.3.0",
|
||||
"tslint-microsoft-contrib": "^2.0.0",
|
||||
"innosetup-compiler": "^5.5.60",
|
||||
"istanbul": "^0.3.17",
|
||||
"jsdom-no-contextify": "^3.1.0",
|
||||
|
|
5
tslint.json
Normal file
5
tslint.json
Normal file
|
@ -0,0 +1,5 @@
|
|||
{
|
||||
"rules": {
|
||||
"no-unused-variable": true
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue