Skip to content

Commit 1be3dfc

Browse files
authored
add prettier format in script and git hook (#134)
* chore: add prettier format in script and git hook * style: format code
1 parent 6c456f1 commit 1be3dfc

File tree

5 files changed

+11
-16
lines changed

5 files changed

+11
-16
lines changed

.storybook/main.js

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
module.exports = {
2-
"stories": [
3-
"../src/**/*.stories.mdx",
4-
"../src/**/*.stories.@(js|jsx|ts|tsx)"
5-
],
6-
"addons": [
7-
"@storybook/addon-links",
8-
"@storybook/addon-essentials"
9-
]
10-
}
2+
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
3+
addons: ['@storybook/addon-links', '@storybook/addon-essentials'],
4+
};

.storybook/preview.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
21
export const parameters = {
3-
actions: { argTypesRegex: "^on[A-Z].*" },
2+
actions: { argTypesRegex: '^on[A-Z].*' },
43
controls: {
54
matchers: {
65
color: /(background|color)$/i,
76
date: /Date$/,
87
},
98
},
10-
}
9+
};

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
"source.fixAll.eslint": true
44
},
55
"typescript.tsdk": "node_modules/typescript/lib"
6-
}
6+
}

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ const App = () => {
4343
<>
4444
<DevTool control={control} placement="top-left" />
4545

46-
<form onSubmit={handleSubmit(d => console.log(d))}>
46+
<form onSubmit={handleSubmit((d) => console.log(d))}>
4747
<h1>React Hook Form DevTools</h1>
4848

4949
<label>Test</label>

package.json

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,8 @@
3131
"release": "changeset publish",
3232
"storybook": "start-storybook -p 6006",
3333
"build-storybook": "build-storybook",
34-
"prepare": "husky install"
34+
"prepare": "husky install",
35+
"format": "prettier --write \"**/*.{js,ts,tsx,md,json}\""
3536
},
3637
"keywords": [
3738
"react",
@@ -117,7 +118,8 @@
117118
},
118119
"lint-staged": {
119120
"*.{js,ts,tsx}": [
120-
"npm run lint:fix"
121+
"npm run lint:fix",
122+
"prettier --write"
121123
],
122124
"*.{md,json}": [
123125
"prettier --write"

0 commit comments

Comments
 (0)