Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ root = true
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true

# The indent size used in the `package.json` file cannot be changed
# https://github.com/npm/npm/pull/3180#issuecomment-16336516
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,4 @@ node_modules
.vscode-test
__pycache__
npm-debug.log
**/.mypy_cache/**
4 changes: 3 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,9 @@
"**/*.pyc": true,
"**/__pycache__": true,
"node_modules": true,
".vscode-test":true
".vscode-test": true,
"**/.mypy_cache/**": true,
"**/.ropeproject/**": true
},
"search.exclude": {
"out": true // set this to false to include "out" folder in search results
Expand Down
12 changes: 12 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,18 @@
"fileLocation": "relative"
}
]
},
{
"label": "lint-staged",
"type": "npm",
"script": "lint-staged",
"problemMatcher": [
"$tsc",
{
"base": "$tslint5",
"fileLocation": "relative"
}
]
}
]
}
17 changes: 9 additions & 8 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ function reportFailures(failures) {
const line = position.lineAndCharacter ? position.lineAndCharacter.line : position.line;
const character = position.lineAndCharacter ? position.lineAndCharacter.character : position.character;

// Output in format similar to tslint for the linter to pickup
// Output in format similar to tslint for the linter to pickup.
console.error(`ERROR: (${failure.ruleName}) ${relative(__dirname, name)}[${line + 1}, ${character + 1}]: ${failure.failure}`);
});
}
Expand All @@ -103,9 +103,9 @@ const hygiene = exports.hygiene = (some, options) => {
.split(/\r\n|\r|\n/)
.forEach((line, i) => {
if (/^\s*$/.test(line)) {
// empty or whitespace lines are OK
// Empty or whitespace lines are OK.
} else if (/^(\s\s\s\s)+.*/.test(line)) {
// good indent
// Good indent.
} else if (/^[\t]+.*/.test(line)) {
console.error(file.relative + '(' + (i + 1) + ',1): Bad whitespace indentation');
errorCount++;
Expand All @@ -118,9 +118,10 @@ const hygiene = exports.hygiene = (some, options) => {
const formatting = es.map(function (file, cb) {
tsfmt.processString(file.path, file.contents.toString('utf8'), {
verify: true,
tsfmt: true,
editorconfig: true
// verbose: true
tsconfig: true,
tslint: true,
editorconfig: true,
tsfmt: true
}).then(result => {
if (result.error) {
console.error(result.message);
Expand Down Expand Up @@ -176,7 +177,7 @@ const hygiene = exports.hygiene = (some, options) => {
console.error(error.message);
},
finish: function () {
// forget the summary
// forget the summary.
}
};
}
Expand Down Expand Up @@ -213,7 +214,7 @@ const hygiene = exports.hygiene = (some, options) => {

gulp.task('hygiene', () => hygiene());

// this allows us to run hygiene as a git pre-commit hook
// this allows us to run hygiene as a git pre-commit hook.
if (require.main === module) {
const cp = require('child_process');

Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -1595,6 +1595,7 @@
"postinstall": "node ./node_modules/vscode/bin/install",
"test": "node ./out/test/standardTest.js && node ./out/test/multiRootTest.js",
"precommit": "node gulpfile.js",
"lint-staged": "node gulpfile.js",
"lint": "tslint src/**/*.ts -t verbose"
},
"dependencies": {
Expand Down Expand Up @@ -1662,4 +1663,4 @@
"vscode": "^1.1.5",
"webpack": "^1.13.2"
}
}
}
Loading