Share a common tslint.json between the language service and the hyiene task

This commit is contained in:
Erich Gamma 2018-02-03 17:47:14 +01:00
parent 00df3bdc28
commit 9c553da1c8
3 changed files with 9 additions and 4 deletions

View file

@ -226,8 +226,8 @@ const hygiene = exports.hygiene = (some, options) => {
}
const program = tslint.Linter.createProgram("src/tsconfig.json");
const configuration = tslint.Configuration.findConfiguration('tslint.json', '.');
const tslintOptions = { formatter: 'json', rulesDirectory: 'build/lib/tslint' };
const configuration = tslint.Configuration.findConfiguration('tslint-hygiene.json', '.');
const tslintOptions = { fix: false, formatter: 'json' };
const linter = new tslint.Linter(tslintOptions, program);
const tsl = es.through(function (file) {
@ -266,7 +266,7 @@ const hygiene = exports.hygiene = (some, options) => {
this.emit('data', data);
}, function () {
process.stdout.write('\n');
const tslintResult = linter.getResult();
if (tslintResult.failures.length > 0) {
reportFailures(tslintResult.failures);

6
tslint-hygiene.json Normal file
View file

@ -0,0 +1,6 @@
{
"extends": "./tslint.json",
"rules": {
"no-unused-variable": true
}
}

View file

@ -6,7 +6,6 @@
"no-string-throw": true,
"no-unused-expression": true,
"no-duplicate-variable": true,
"no-unused-variable": true, // requires type information in tslint > v4 only works for hyiene tasks
"curly": true,
"class-name": true,
"semicolon": [