-
Notifications
You must be signed in to change notification settings - Fork 677
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable tslint #1
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
"tslint.rulesDirectory": "node_modules/tslint-microsoft-contrib" | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"version": "0.1.0", | ||
"command": "gulp", | ||
"isShellCommand": true, | ||
"tasks": [ | ||
{ | ||
"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 | ||
} | ||
} | ||
} | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
var gulp = require('gulp'); | ||
var decompress = require('gulp-decompress'); | ||
var tslint = require("gulp-tslint"); | ||
var filter = require('gulp-filter'); | ||
var es = require('event-stream'); | ||
var GitHub = require('github-releases'); | ||
var tmp = require('tmp'); | ||
|
@@ -57,6 +59,39 @@ gulp.task('omnisharp:fetch', ['omnisharp:clean'], function () { | |
.pipe(gulp.dest('bin')); | ||
}); | ||
|
||
var allTypeScript = [ | ||
'src/**/*.ts' | ||
]; | ||
|
||
var tslintFilter = [ | ||
'**', | ||
'!**/*.d.ts', | ||
'!**/typings/**', | ||
'!**/*.test.ts', | ||
'!src/vs/editor/standalone-languages/test/**' | ||
]; | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. unused |
||
var 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).replace('\\', '/'); | ||
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)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @egamma To my knowledge you don't need the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yep, this works and it is simpler, updated the PR. |
||
.pipe(tslint({ | ||
rulesDirectory: "node_modules/tslint-microsoft-contrib" | ||
})) | ||
.pipe(tslint.report(lintReporter, { | ||
summarizeFailureOutput: false, | ||
emitError: false | ||
})) | ||
}); | ||
|
||
gulp.task('omnisharp:fixscripts', ['omnisharp:fetch'], function () { | ||
|
||
var _fixes = Object.create(null); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"rules": { | ||
"no-unused-expression": true, | ||
"no-unused-variable": true, | ||
"no-unreachable": true, | ||
"no-duplicate-variable": true, | ||
"no-var-keyword": true, | ||
"promise-must-complete": true, | ||
"curly": true, | ||
"semicolon": true | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
unused