Skip to content

Commit 104ef08

Browse files
authored
Format staged files with prettier (#88)
### Added - [internal] Add lint-staged setup with prettier formatting step
1 parent 756d9f1 commit 104ef08

File tree

5 files changed

+1329
-116
lines changed

5 files changed

+1329
-116
lines changed

.editorconfig

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
root = true
2+
[*.ts]
3+
indent_size = 2
4+
indent_style = space
5+
insert_final_newline = true

.prettierrc.js

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = {
2+
trailingComma: 'es5',
3+
tabWidth: 2,
4+
semi: false,
5+
singleQuote: true,
6+
};

package.json

+20-8
Original file line numberDiff line numberDiff line change
@@ -140,18 +140,30 @@
140140
"lint": "node ./node_modules/tslint/bin/tslint ./src/**/*.ts "
141141
},
142142
"devDependencies": {
143-
"@types/glob": "^5.0.30",
144143
"@types/fs-extra": "0.0.35",
145-
"fs-extra": "^1.0.0",
146-
"typescript": "^2.0.3",
147-
"vscode": "^1.0.3",
148-
"mocha": "^2.3.3",
149-
"decache": "^4.1.0",
150-
"@types/node": "^6.0.40",
144+
"@types/glob": "^5.0.30",
151145
"@types/mocha": "^2.2.32",
146+
"@types/node": "^6.0.40",
147+
"decache": "^4.1.0",
148+
"fs-extra": "^1.0.0",
152149
"glob": "^7.1.1",
150+
"husky": "^1.1.2",
153151
"istanbul": "^0.4.5",
152+
"lint-staged": "^7.3.0",
153+
"mocha": "^2.3.3",
154154
"remap-istanbul": "^0.8.4",
155-
"tslint": "^4.0.2"
155+
"tslint": "^4.0.2",
156+
"typescript": "^2.0.3",
157+
"vscode": "^1.0.3"
158+
},
159+
"husky": {
160+
"hooks": {
161+
"pre-commit": "lint-staged"
162+
}
163+
},
164+
"lint-staged": {
165+
"*.ts": [
166+
"prettier --write"
167+
]
156168
}
157169
}

0 commit comments

Comments
 (0)