Skip to content

Commit

Permalink
Merge pull request palantir#443 from palantir/vscode
Browse files Browse the repository at this point in the history
Set up TSLint on VSCode
  • Loading branch information
ashwinr committed Jun 21, 2015
2 parents ddf914a + b74bae1 commit f170da3
Show file tree
Hide file tree
Showing 16 changed files with 534 additions and 281 deletions.
20 changes: 20 additions & 0 deletions .settings/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
// Controls the rendering size of tabs in characters. If set to auto, the value will be guessed based on the opened file.
"editor.tabSize": 4,

// Controls if the editor will insert spaces for tabs. If set to auto, the value will be guessed based on the opened file.
"editor.insertSpaces": true,

// Controls after how many characters the editor will wrap to the next line. Setting this to 0 turns on viewport width wrapping
"editor.wrappingColumn": 140,

// The folders to exclude when doing a full text search in the workspace.
"search.excludeFolders": [
".git",
".tscache",
"bower_components",
"build",
"lib",
"node_modules"
]
}
28 changes: 28 additions & 0 deletions .settings/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// Available variables which can be used inside of strings.
// ${workspaceRoot}: the root folder of the team
// ${file}: the current opened file
// ${fileBasename}: the current opened file's basename
// ${fileDirname}: the current opened file's dirname
// ${fileExtname}: the current opened file's extension
// ${cwd}: the current working directory of the spawned process

// A task runner that calls the Typescipt compiler (tsc) and compiles based on a tsconfig.json file
{
"version": "0.1.0",

// The command is tsc. Assumes that tsc has been installed using npm install -g typescript
"command": "${workspaceRoot}/node_modules/typescript/bin/tsc",

// The command is a shell script
"isShellCommand": true,

// Show the output window only if unrecognized errors occur.
"showOutput": "silent",

// Tell the tsc compiler to use the tsconfig.json from the open folder.
"args": ["-p", "${fileDirname}"],

// use the standard tsc problem matcher to find compile problems
// in the output.
"problemMatcher": "$tsc"
}
2 changes: 1 addition & 1 deletion Gruntfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ module.exports = function (grunt) {
test: [
"test/**/*.ts",
"!test/**/*.test.ts",
"!test/typings/*.ts"
"!test/typings/**/*.ts"
]
},

Expand Down
6 changes: 5 additions & 1 deletion src/formatters/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.5.0-alpha",
"version": "1.5.0-beta",
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": true,
Expand All @@ -9,10 +9,14 @@
},
"filesGlob": [
"../../lib/tslint.d.ts",
"../../typings/*.d.ts",
"./*.ts"
],
"files": [
"../../lib/tslint.d.ts",
"../../typings/node.d.ts",
"../../typings/typescriptServices.d.ts",
"../../typings/typescriptServicesScanner.d.ts",
"./jsonFormatter.ts",
"./pmdFormatter.ts",
"./proseFormatter.ts",
Expand Down
4 changes: 2 additions & 2 deletions src/rules/labelUndefinedRule.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export class Rule extends Lint.Rules.AbstractRule {
}
}

class LabelUndefinedWalker extends Lint.ScopeAwareRuleWalker<{}> {
public createScope(): {} {
class LabelUndefinedWalker extends Lint.ScopeAwareRuleWalker<{[key: string]: any}> {
public createScope(): {[key: string]: any} {
return {};
}

Expand Down
2 changes: 1 addition & 1 deletion src/rules/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"version": "1.5.0-alpha",
"version": "1.5.0-beta",
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": true,
Expand Down
4 changes: 2 additions & 2 deletions src/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"version": "1.5.0-alpha",
"version": "1.5.0-beta",
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": true,
"declaration": true,
"sourceMap": false,
"target": "es5",
"out": "../build/tslint.js"
"out": "build/tslint.js"
},
"filesGlob": [
"../typings/*.d.ts",
Expand Down
4 changes: 4 additions & 0 deletions src/tslint-cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@
* limitations under the License.
*/

/// <reference path="../typings/node.d.ts"/>
/// <reference path="tslint.ts"/>
/// <reference path="configuration.ts"/>

var fs = require("fs");
var optimist = require("optimist")
.usage("usage: $0")
Expand Down
6 changes: 6 additions & 0 deletions test/chaiAssert.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
/*
* Copyright 2015 Palantir Technologies, Inc. All rights reserved.
*/

declare var assert: Chai.Assert;

3 changes: 2 additions & 1 deletion test/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"version": "1.5.0-beta",
"compilerOptions": {
"module": "commonjs",
"noImplicitAny": true,
Expand All @@ -18,9 +19,9 @@
"../typings/typescriptServices.d.ts",
"../typings/typescriptServicesScanner.d.ts",
"../lib/tslint.d.ts",
"./typings/chai-assert.d.ts",
"./typings/chai.d.ts",
"./typings/mocha.d.ts",
"./chaiAssert.ts",
"./formatters/externalFormatterTest.ts",
"./formatters/jsonFormatterTests.ts",
"./formatters/pmdFormatterTests.ts",
Expand Down
14 changes: 14 additions & 0 deletions test/tsd.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"version": "v4",
"repo": "borisyankov/DefinitelyTyped",
"ref": "master",
"path": "typings",
"installed": {
"chai/chai.d.ts": {
"commit": "aadd63ecae3feb76ea2d4be80511e266b5c2c4a7"
},
"mocha/mocha.d.ts": {
"commit": "aadd63ecae3feb76ea2d4be80511e266b5c2c4a7"
}
}
}
114 changes: 0 additions & 114 deletions test/typings/chai-assert.d.ts

This file was deleted.

Loading

0 comments on commit f170da3

Please sign in to comment.