Skip to content

Commit 4fae7a8

Browse files
committed
fix: added prettier config, changed tslint rules and changed readme
1 parent 1cb4e3b commit 4fae7a8

File tree

4 files changed

+77
-4
lines changed

4 files changed

+77
-4
lines changed

.circleci/config.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ version: 2
22
machine:
33
services:
44
- docker
5-
65
jobs:
76
build:
87
docker:

README.md

Lines changed: 69 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,77 @@
11
# tscommons
22

3-
All you need to start your typescript project:
3+
![GitHub tag (latest SemVer)](https://img.shields.io/github/tag/kube-js/tscommons.svg)
4+
5+
## Available configs:
46
- tsconfig.json
57
- tslint.json
68
- jest.config.js
9+
- prettier.config.js
10+
11+
## Usage:
12+
13+
### tsconfig.json
14+
15+
```json
16+
{
17+
"extends": "./node_modules/@kube-js/tscommons/configs/tsconfig.json",
18+
// your overrides
19+
}
20+
```
21+
22+
### tslint.json
23+
24+
```json
25+
{
26+
"extends": [
27+
"./node_modules/@kube-js/tscommons/configs/tslint.json",
28+
"tslint-config-prettier"
29+
],
30+
"rules": {
31+
// your overrides
32+
}
33+
}
34+
```
35+
36+
### jest.config.js
37+
```js
38+
const baseConfig = require("@kube-js/tscommons/configs/jest.config.js");
39+
40+
module.exports = {
41+
...baseConfig
42+
// your overrides
43+
};
44+
```
45+
46+
### prettier.config.js
47+
48+
```js
49+
const baseConfig = require("@kube-js/tscommons/configs/prettier.config.js");
50+
51+
module.exports = {
52+
...baseConfig
53+
// your overrides
54+
};
55+
```
56+
57+
Also if you are using tslint install `tslint-config-prettier`
58+
59+
```
60+
npm install --save-dev tslint-config-prettier
61+
```
62+
63+
Then in tslint.json add:
64+
```json
65+
{
66+
"extends": [
67+
"./node_modules/@kube-js/tscommons/configs/tslint.json",
68+
"tslint-config-prettier"
69+
],
70+
"rules": {
71+
// your overrides
72+
}
73+
}
74+
```
775

876
Credits:
977
[ryansmith94](https://github.com/ryansmith94)

configs/prettier.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
trailingComma: "es5",
3+
tabWidth: 2,
4+
semi: true,
5+
singleQuote: true
6+
};

configs/tslint.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,12 +64,12 @@
6464
"no-sparse-arrays": true,
6565
"no-string-literal": true,
6666
"no-string-throw": true,
67-
"no-submodule-imports": true,
67+
"no-submodule-imports": false,
6868
"no-switch-case-fall-through": true,
6969
"no-this-assignment": true,
7070
"no-unbound-method": true,
7171
"no-unnecessary-class": true,
72-
"no-unsafe-any": true,
72+
"no-unsafe-any": false,
7373
"no-unsafe-finally": true,
7474
"no-unused-expression": true,
7575
"no-var-keyword": true,

0 commit comments

Comments
 (0)