Skip to content

Commit 6103cb7

Browse files
committed
chore: add prettier and format
1 parent 4fdc072 commit 6103cb7

File tree

10 files changed

+475
-10
lines changed

10 files changed

+475
-10
lines changed

Diff for: .prettierignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
dist

Diff for: .prettierrc.js

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
module.exports = {
2+
singleQuote: true,
3+
trailingComma: 'all',
4+
plugins: [require.resolve('@trivago/prettier-plugin-sort-imports')],
5+
};

Diff for: example/src/App.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import React from 'react';
21
import './App.css';
32
import Form1 from './components/Form1';
43
import Form2 from './components/Form2';
4+
import React from 'react';
55

66
const App: React.FC = () => {
77
return (

Diff for: example/src/components/Form1.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { useWindowControls } from '../hooks/useWindowControls';
12
import React from 'react';
23
import { useForm } from 'react-hook-form';
3-
import { useWindowControls } from '../hooks/useWindowControls';
44

55
const Form1: React.FC = () => {
66
const {

Diff for: example/src/components/Form2.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1+
import { useWindowControls } from '../hooks/useWindowControls';
12
import React from 'react';
23
import { useForm } from 'react-hook-form';
3-
import { useWindowControls } from '../hooks/useWindowControls';
44

55
const Form2: React.FC = () => {
66
const {

Diff for: example/src/hooks/useWindowControls.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { useDeepCompareEffect } from 'ahooks';
22
import { Control, FieldValues } from 'react-hook-form';
33

44
export function useWindowControls<
5-
TFieldValues extends FieldValues = FieldValues
5+
TFieldValues extends FieldValues = FieldValues,
66
>(id: string, control: Control<TFieldValues>) {
77
useDeepCompareEffect(() => {
88
window.__RHF_DEVTOOLS_CONTROLS__[id] = control;

Diff for: example/src/main.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1+
import App from './App';
12
import React from 'react';
23
import ReactDOM from 'react-dom/client';
3-
import App from './App';
44

55
window.__RHF_DEVTOOLS_CONTROLS__ = {};
66

77
ReactDOM.createRoot(document.getElementById('root')!).render(
88
<React.StrictMode>
99
<App />
10-
</React.StrictMode>
10+
</React.StrictMode>,
1111
);

Diff for: example/vite.config.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
1-
import { defineConfig } from 'vite'
2-
import react from '@vitejs/plugin-react'
1+
import react from '@vitejs/plugin-react';
2+
import { defineConfig } from 'vite';
33

44
// https://vitejs.dev/config/
55
export default defineConfig({
6-
plugins: [react()]
7-
})
6+
plugins: [react()],
7+
});

Diff for: package.json

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "rhf-devtools-extension",
3+
"version": "0.0.0",
4+
"main": "src/devtools.tsx",
5+
"scripts": {
6+
"dev": "",
7+
"build": "",
8+
"format": "prettier --write \"**/*.{js,ts,tsx}\""
9+
},
10+
"author": "Justin Sun",
11+
"license": "MIT",
12+
"devDependencies": {
13+
"@trivago/prettier-plugin-sort-imports": "^3.2.0",
14+
"prettier": "^2.7.1"
15+
}
16+
}

0 commit comments

Comments
 (0)