Skip to content

Commit 4a9ae9c

Browse files
committed
Add prettier config.
1 parent 4fa32ad commit 4a9ae9c

File tree

6 files changed

+240
-6
lines changed

6 files changed

+240
-6
lines changed

.eslintrc

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,17 @@
22
"root": true,
33
"parser": "@typescript-eslint/parser",
44
"plugins": [
5-
"@typescript-eslint"
5+
"@typescript-eslint",
6+
"prettier"
67
],
78
"extends": [
89
"eslint:recommended",
910
"plugin:@typescript-eslint/eslint-recommended",
10-
"plugin:@typescript-eslint/recommended"
11+
"plugin:@typescript-eslint/recommended",
12+
"prettier"
1113
],
1214
"rules": {
13-
"no-console": 1
15+
"no-console": 1,
16+
"prettier/prettier": 2
1417
}
1518
}

.prettierrc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
{
2+
"semi": true,
3+
"trailingComma": "all",
4+
"singleQuote": true,
5+
"printWidth": 80
6+
}

.prettierrc.js

Whitespace-only changes.

package-lock.json

Lines changed: 220 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@
77
"build": "rimraf ./build && tsc",
88
"start:dev": "nodemon",
99
"start": "npm run build && node build/index.js",
10-
"lint": "eslint . --ext .ts"
10+
"lint": "eslint . --ext .ts",
11+
"prettier-format": "prettier --config .prettierrc 'src/**/*.ts' --write",
12+
"prettier-watch": "onchange 'src/**/*.ts' -- prettier --write {{changed}}"
1113
},
1214
"keywords": [],
1315
"author": "",
@@ -17,7 +19,11 @@
1719
"@typescript-eslint/eslint-plugin": "^2.21.0",
1820
"@typescript-eslint/parser": "^2.21.0",
1921
"eslint": "^6.8.0",
22+
"eslint-config-prettier": "^6.10.0",
23+
"eslint-plugin-prettier": "^3.1.2",
2024
"nodemon": "^1.19.1",
25+
"onchange": "^6.1.0",
26+
"prettier": "^1.19.1",
2127
"rimraf": "^3.0.0",
2228
"ts-node": "^8.3.0",
2329
"typescript": "^3.6.2"

src/index.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1 @@
1-
2-
console.log('Hello world!')
1+
console.log('Hello world!');

0 commit comments

Comments
 (0)