Skip to content

Commit

Permalink
chore: separate tslint config files for build and vscode
Browse files Browse the repository at this point in the history
This is a follow-up to #964.

Two config files are in place now:
- tslint.build.json for CLI build scripts
- tslint.json for vscode
  • Loading branch information
raymondfeng committed Feb 8, 2018
1 parent a438729 commit b622910
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 32 deletions.
15 changes: 1 addition & 14 deletions packages/cli/generators/project/templates/tslint.build.json
Original file line number Diff line number Diff line change
@@ -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"]
}
2 changes: 1 addition & 1 deletion packages/cli/generators/project/templates/tslint.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down
22 changes: 6 additions & 16 deletions tslint.build.json
Original file line number Diff line number Diff line change
@@ -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/**/*"
]
}
}
2 changes: 1 addition & 1 deletion tslint.json
Original file line number Diff line number Diff line change
@@ -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/**/*",
Expand Down

0 comments on commit b622910

Please sign in to comment.