chore(tslint): disallow variable names that look like keywords.

We've had issues such as the one I documented: https://github.com/Microsoft/TypeScript/issues/5187
This tslint check prevents this happening again.
This change also updates to the newest tslint which gets typings from npm.

Closes #4970
This commit is contained in:
Alex Eagle
2015-10-27 20:51:03 -07:00
committed by Alex Eagle
parent 25ddd8718d
commit c90e1920f5
7 changed files with 708 additions and 275 deletions

View File

@ -294,14 +294,15 @@ gulp.task('lint', ['build.tools'], function() {
// https://github.com/palantir/tslint#supported-rules
var tslintConfig = {
"rules": {
"semicolon": true,
"requireParameterType": true,
"requireReturnType": true,
"requireParameterType": true
"semicolon": true,
"variable-name": [true, "ban-keywords"]
}
};
return gulp.src(['modules/angular2/src/**/*.ts', '!modules/angular2/src/testing/**'])
.pipe(tslint({
tslint: require('tslint'),
tslint: require('tslint').default,
configuration: tslintConfig,
rulesDirectory: 'dist/tools/tslint'
}))