Skip to content

Commit 5da8451

Browse files
committed
prettierの設定
1 parent d36165d commit 5da8451

6 files changed

Lines changed: 652 additions & 3 deletions

File tree

.husky/pre-commit

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/usr/bin/env sh
2+
. "$(dirname -- "$0")/_/husky.sh"
3+
4+
npm run lint-staged

.lintstagedrc.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
const path = require('path');
2+
3+
module.exports = {
4+
'*.{js,jsx,ts,tsx,css,scss,html}': (absolutePaths) => {
5+
const cwd = process.cwd();
6+
const relativePaths = absolutePaths
7+
.map((file) => path.relative(cwd, file))
8+
.join(' ');
9+
return [`prettier --write ${relativePaths}`];
10+
},
11+
};

.prettierrc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"singleQuote": true
3+
}

0 commit comments

Comments
 (0)