New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extract tslint config into a standalone package #2159
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,6 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/tslint", | ||
"extends": [ | ||
"./tslint.common.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. | ||
|
||
// User-land promises like Bluebird implement "PromiseLike" (not "Promise") | ||
// interface only. The string "PromiseLike" bellow is needed to | ||
// tell tslint that it's ok to `await` such promises. | ||
"await-promise": [true, "PromiseLike", "RequestPromise"], | ||
"no-floating-promises": [true, "PromiseLike", "RequestPromise"], | ||
"no-unused-variable": true, | ||
"no-void-expression": [true, "ignore-arrow-function-shorthand"] | ||
} | ||
"@loopback/tslint-config/tslint.build.json" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,26 +1,6 @@ | ||
{ | ||
// See https://palantir.github.io/tslint/rules/ | ||
"rules": { | ||
// These rules find errors related to TypeScript features. | ||
"adjacent-overload-signatures": true, | ||
"prefer-for-of": true, | ||
"unified-signatures": true, | ||
"no-any": true, | ||
|
||
// These rules catch common errors in JS programming or otherwise | ||
// confusing constructs that are prone to producing bugs. | ||
|
||
"label-position": true, | ||
"no-arg": true, | ||
"no-construct": true, | ||
"no-duplicate-variable": true, | ||
|
||
"no-invalid-this": true, | ||
"no-misused-new": true, | ||
"no-shadowed-variable": true, | ||
"no-string-throw": true, | ||
"no-unused-expression": true, | ||
"no-var-keyword": true, | ||
"triple-equals": [true, "allow-null-check", "allow-undefined-check"] | ||
} | ||
"$schema": "http://json.schemastore.org/tslint", | ||
"extends": [ | ||
"@loopback/tslint-config/tslint.common.json" | ||
] | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
package-lock=false |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
Copyright (c) IBM Corp. 2017,2018. All Rights Reserved. | ||
Node module: @loopback/tslint-config | ||
This project is licensed under the MIT License, full text below. | ||
|
||
-------- | ||
|
||
MIT license | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in | ||
all copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# @loopback/tslint-config | ||
|
||
Shared TSLint config to enforce a consistent code style for LoopBack development | ||
|
||
## Installation | ||
|
||
```shell | ||
$ npm install --save @loopback/tslint-config | ||
``` | ||
|
||
## Basic Use | ||
|
||
An example `tslint.json` file: | ||
|
||
```json5 | ||
{ | ||
$schema: 'http://json.schemastore.org/tslint', | ||
extends: ['@loopback/tslint-config/tslint.common.json'], | ||
} | ||
``` | ||
|
||
An example `tslint.buid.json` file: | ||
|
||
```json5 | ||
{ | ||
$schema: 'http://json.schemastore.org/tslint', | ||
extends: ['@loopback/tslint-config/tslint.build.json'], | ||
} | ||
``` | ||
|
||
## Contributions | ||
|
||
- [Guidelines](https://github.com/strongloop/loopback-next/blob/master/docs/CONTRIBUTING.md) | ||
- [Join the team](https://github.com/strongloop/loopback-next/issues/110) | ||
|
||
## Contributors | ||
|
||
See | ||
[all contributors](https://github.com/strongloop/loopback-next/graphs/contributors). | ||
|
||
## License | ||
|
||
MIT |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"name": "@loopback/tslint-config", | ||
"version": "1.0.0-1", | ||
"description": "", | ||
"engines": { | ||
"node": ">=8.9" | ||
}, | ||
"author": "IBM", | ||
"copyright.owner": "IBM Corp.", | ||
"license": "MIT", | ||
"peerDependencies": { | ||
"tslint": ">=5.11.0" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hmm. The idea behind this peer dependency is to specify the minimum version of As a result,
I am not sure what to do about it. We can remove this peer dependency, but that way we loose control over I think in the long term, it may be best to get rid of @strongloop/loopback-maintainers thoughts? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. |
||
}, | ||
"files": [ | ||
"README.md", | ||
"tslint.common.json", | ||
"tslint.build.json" | ||
], | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/strongloop/loopback-next.git" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"$schema": "http://json.schemastore.org/tslint", | ||
"extends": [ | ||
"./tslint.common.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. | ||
|
||
// User-land promises like Bluebird implement "PromiseLike" (not "Promise") | ||
// interface only. The string "PromiseLike" bellow is needed to | ||
// tell tslint that it's ok to `await` such promises. | ||
"await-promise": [true, "PromiseLike", "RequestPromise"], | ||
"no-floating-promises": [true, "PromiseLike", "RequestPromise"], | ||
"no-unused-variable": true, | ||
"no-void-expression": [true, "ignore-arrow-function-shorthand"] | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
// See https://palantir.github.io/tslint/rules/ | ||
"rules": { | ||
// These rules find errors related to TypeScript features. | ||
"adjacent-overload-signatures": true, | ||
"prefer-for-of": true, | ||
"unified-signatures": true, | ||
"no-any": true, | ||
|
||
// These rules catch common errors in JS programming or otherwise | ||
// confusing constructs that are prone to producing bugs. | ||
|
||
"label-position": true, | ||
"no-arg": true, | ||
"no-construct": true, | ||
"no-duplicate-variable": true, | ||
|
||
"no-invalid-this": true, | ||
"no-misused-new": true, | ||
"no-shadowed-variable": true, | ||
"no-string-throw": true, | ||
"no-unused-expression": true, | ||
"no-var-keyword": true, | ||
"triple-equals": [true, "allow-null-check", "allow-undefined-check"] | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hmm why is this dependency
^1.0.0-1
as opposed to^1.0.0
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tslint-config was not released yet. I specified the version number as a pre-release version, hoping that
lerna
will automatically increment it to1.0.0
when we run the release process. Should I use a different version number?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No it's fine to leave it as is, just wanted to know the reasoning behind it.