Skip to content
This repository has been archived by the owner on Dec 4, 2022. It is now read-only.

Commit

Permalink
feat(core): update rules [email protected] (#50)
Browse files Browse the repository at this point in the history
  • Loading branch information
fulls1z3 authored Jul 4, 2019
1 parent 0f96d95 commit 0bb6412
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 4 deletions.
25 changes: 23 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ If you have questions, comments or suggestions, just create an issue on this rep
these rules with new insights, experiences and remarks in alignment with the updates on [TSLint] and [codelyzer].

**Note**: The following set of rules depend on:
- [TSLint] v5.17.0
- [TSLint] v5.18.0
- [codelyzer] v5.0.0

## Table of contents:
Expand Down Expand Up @@ -138,7 +138,12 @@ A sample configuration is shown below, where `tslint.json` lives adjacent to you

- Member **overloads** should be **consecutive**.
```json
"adjacent-overload-signatures": true
"adjacent-overload-signatures": [
true,
{
"ignore-accessors": true,
}
]
```

- *Always prefer* **unifying any two overloads** into one, by using a **union** or an **optional/rest parameter**.
Expand Down Expand Up @@ -295,6 +300,11 @@ them is allowed by TypeScript*).
"await-promise": true
```

- Functions marked **`async`** must contain an **`await`** or **`return`** statement
```json
"no-async-without-await": true
```

- *Do not use* the **unnecessary** **`return await`**.
```json
"no-return-await": true
Expand Down Expand Up @@ -517,6 +527,17 @@ them is allowed by TypeScript*).
]
```

- Using **comparison operators** (`>`, `>=`, `<=`, `<`) to compare *non-numbers* should be **avoided**.
```json
"strict-comparisons": [
true,
{
"allow-object-equal-comparison": true,
"allow-string-order-comparison": false
}
]
```

- *Always prefer* explicit **`+= 1`** and **`-= 1`** *pre-unary* **operators** over **`++i`** and **`--i`**.
```json
"increment-decrement": [
Expand Down
17 changes: 15 additions & 2 deletions tslint.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,12 @@
"variables-before-functions"
],
"prefer-readonly": true,
"adjacent-overload-signatures": true,
"adjacent-overload-signatures": [
true,
{
"ignore-accessors": true
}
],
"unified-signatures": true,
"prefer-function-over-method": [
true,
Expand Down Expand Up @@ -57,6 +62,7 @@
"unnecessary-bind": true,
"promise-function-async": true,
"await-promise": true,
"no-async-without-await": true,
"no-return-await": true,
"no-floating-promises": true,
"prefer-const": true,
Expand Down Expand Up @@ -137,6 +143,13 @@
true,
"allow-null-check"
],
"strict-comparisons": [
true,
{
"allow-object-equal-comparison": true,
"allow-string-order-comparison": false
}
],
"increment-decrement": [
true,
"allow-post"
Expand All @@ -158,7 +171,7 @@
{
"allow-else-if": true
}
]
],
"strict-boolean-expressions": [
true,
"allow-undefined-union",
Expand Down

0 comments on commit 0bb6412

Please sign in to comment.