-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Adding tslint and gulp #1403
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
Merged
Merged
Adding tslint and gulp #1403
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
fed6449
Adding Gulp and tslint
WardenGnaw bea261b
Adding back license that was accidently deleted.
WardenGnaw 0a7d966
Updating package-lock.json and missing import
WardenGnaw f5d4bc9
Sorting and fixing commands for npm run
WardenGnaw e7072b3
Adding rules for whitespace and types for tslint
WardenGnaw ec9f8ba
Updating .gitignore rules
WardenGnaw 99cba5e
Adding more rules and sorting tslint.json
WardenGnaw 246cfd3
Adding rule to force brance on the same line
WardenGnaw edae8f5
tslint rule to add function return types
WardenGnaw 5c231a5
Adding tslint as part of travisci
WardenGnaw File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,7 @@ addons: | |
script: | ||
- cd Extension | ||
- npm install | ||
- npm run tslint | ||
- npm run pretest | ||
- npm run test | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,17 @@ | ||
# ignore dependency packages | ||
node_modules | ||
|
||
# ignore compliled typescript | ||
out | ||
|
||
# ignore downloaded extension files and folders | ||
server | ||
node_modules | ||
debugAdapters | ||
LLVM | ||
bin/Microsoft.VSCode.CPP.* | ||
|
||
# ignore lock files | ||
install.lock | ||
|
||
# ignore generated packages | ||
*.vsix |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
'use strict'; | ||
|
||
const gulp = require('gulp'); | ||
const tslint = require('gulp-tslint'); | ||
const mocha = require('gulp-mocha'); | ||
|
||
gulp.task('unitTest', () => { | ||
gulp.src('./out/test/unitTests', {read: false}).pipe( | ||
mocha({ | ||
ui: "tdd" | ||
}) | ||
); | ||
}); | ||
|
||
/// Misc Tasks | ||
const allTypeScript = [ | ||
'src/**/*.ts', | ||
'!**/*.d.ts', | ||
'!**/typings**' | ||
]; | ||
|
||
const lintReporter = (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(e => { | ||
var message = relativeBase + e.name + ':' + (e.startPosition.line + 1) + ':' + (e.startPosition.character + 1) + ': ' + e.failure; | ||
console.log('[tslint] ' + message); | ||
}); | ||
}; | ||
|
||
gulp.task('tslint', () => { | ||
gulp.src(allTypeScript) | ||
.pipe(tslint({ | ||
program: require('tslint').Linter.createProgram("./tsconfig.json"), | ||
configuration: "./tslint.json" | ||
})) | ||
.pipe(tslint.report(lintReporter, { | ||
summarizeFailureOutput: false, | ||
emitError: false | ||
})) | ||
}); |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
see if you could get source navigation from the lint output to code, from vscode build output.