From b622910f374c1ae9ffc9ef3cb12c35b66fb8291a Mon Sep 17 00:00:00 2001 From: Raymond Feng Date: Tue, 6 Feb 2018 09:03:47 -0800 Subject: [PATCH] chore: separate tslint config files for build and vscode This is a follow-up to https://github.com/strongloop/loopback-next/pull/964/. Two config files are in place now: - tslint.build.json for CLI build scripts - tslint.json for vscode --- .../project/templates/tslint.build.json | 15 +------------ .../generators/project/templates/tslint.json | 2 +- tslint.build.json | 22 +++++-------------- tslint.json | 2 +- 4 files changed, 9 insertions(+), 32 deletions(-) diff --git a/packages/cli/generators/project/templates/tslint.build.json b/packages/cli/generators/project/templates/tslint.build.json index 11aa5c89be1e..0ace3417fa90 100644 --- a/packages/cli/generators/project/templates/tslint.build.json +++ b/packages/cli/generators/project/templates/tslint.build.json @@ -1,17 +1,4 @@ { "$schema": "http://json.schemastore.org/tslint", - "extends": ["./tslint.json"], - // This configuration files enabled rules which require type checking - // and therefore cannot be run by Visual Studio Code TSLint extension - // See https://github.com/Microsoft/vscode-tslint/issues/70 - "rules": { - // These rules find errors related to TypeScript features. - - // These rules catch common errors in JS programming or otherwise - // confusing constructs that are prone to producing bugs. - - "await-promise": true, - "no-floating-promises": true, - "no-void-expression": [true, "ignore-arrow-function-shorthand"] - } + "extends": ["./node_modules/@loopback/build/config/tslint.build.json"] } diff --git a/packages/cli/generators/project/templates/tslint.json b/packages/cli/generators/project/templates/tslint.json index f151a872949c..6a8445c727c3 100644 --- a/packages/cli/generators/project/templates/tslint.json +++ b/packages/cli/generators/project/templates/tslint.json @@ -1,7 +1,7 @@ { "$schema": "http://json.schemastore.org/tslint", <% if (project.loopbackBuild) { -%> - "extends": ["./node_modules/@loopback/build/config/tslint.build.json"] + "extends": ["./node_modules/@loopback/build/config/tslint.common.json"] <% } else { -%> // See https://palantir.github.io/tslint/rules/ "rules": { diff --git a/tslint.build.json b/tslint.build.json index 67f07ae8d46f..0de4205d0047 100644 --- a/tslint.build.json +++ b/tslint.build.json @@ -1,20 +1,10 @@ { "$schema": "http://json.schemastore.org/tslint", - "extends": [ - "./tslint.json" - ], - // This configuration files enabled rules which require type checking - // and therefore cannot be run by Visual Studio Code TSLint extension - // See https://github.com/Microsoft/vscode-tslint/issues/70 - "rules": { - // These rules find errors related to TypeScript features. - - - // These rules catch common errors in JS programming or otherwise - // confusing constructs that are prone to producing bugs. - - "await-promise": true, - "no-floating-promises": true, - "no-void-expression": [true, "ignore-arrow-function-shorthand"] + "extends": ["./packages/build/config/tslint.build.json"], + "linterOptions": { + "exclude": [ + "./packages/cli/generators/*/templates/**/*", + "./packages/cli/test/sandbox/**/*" + ] } } diff --git a/tslint.json b/tslint.json index 0de4205d0047..57fe820a65da 100644 --- a/tslint.json +++ b/tslint.json @@ -1,6 +1,6 @@ { "$schema": "http://json.schemastore.org/tslint", - "extends": ["./packages/build/config/tslint.build.json"], + "extends": ["./packages/build/config/tslint.common.json"], "linterOptions": { "exclude": [ "./packages/cli/generators/*/templates/**/*",