mirror of
https://github.com/vale981/tridactyl
synced 2025-03-05 09:31:41 -05:00
Add the Prettier linter
This commit is contained in:
parent
7ea938f74f
commit
82c06fd920
3 changed files with 18 additions and 0 deletions
5
.prettierrc
Normal file
5
.prettierrc
Normal file
|
@ -0,0 +1,5 @@
|
||||||
|
tabWidth: 4
|
||||||
|
useTabs: false
|
||||||
|
semi: false
|
||||||
|
singleQuote: false
|
||||||
|
arrowParens: avoid
|
11
hooks/pre-commit
Executable file
11
hooks/pre-commit
Executable file
|
@ -0,0 +1,11 @@
|
||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
filetypes="*.js *.jsx *.ts"
|
||||||
|
|
||||||
|
# Run prettier on the diffs
|
||||||
|
$(npm bin)/precise-commits $filetypes
|
||||||
|
# Re-add the modified files
|
||||||
|
files=$(git diff --cached --name-only --diff-filter=ACM $filetypes)
|
||||||
|
if [ "" != "$files" ]; then
|
||||||
|
echo "$files" | xargs git add
|
||||||
|
fi
|
|
@ -13,6 +13,8 @@
|
||||||
"cleanslate": "^0.10.1",
|
"cleanslate": "^0.10.1",
|
||||||
"copy-webpack-plugin": "^4.2.0",
|
"copy-webpack-plugin": "^4.2.0",
|
||||||
"jest": "^21.2.1",
|
"jest": "^21.2.1",
|
||||||
|
"precise-commits": "^1.0.2",
|
||||||
|
"prettier": "^1.11.1",
|
||||||
"shared-git-hooks": "^1.2.1",
|
"shared-git-hooks": "^1.2.1",
|
||||||
"source-map-loader": "^0.2.2",
|
"source-map-loader": "^0.2.2",
|
||||||
"ts-jest": "^21.1.3",
|
"ts-jest": "^21.1.3",
|
||||||
|
|
Loading…
Add table
Reference in a new issue