mirror of
https://github.com/pmndrs/zustand.git
synced 2025-12-08 19:45:52 +00:00
style(examples): run prettier on the examples (#1092)
* chore: add dir "example" and file types "js,jsx" to prettier script * chore: create .prettierignore and add "/examples/build" * chore: remove deprecated prettier config * style: run yarn prettier * chore: make prettier run only for `example/src` * chore: add `"bracketSameLine": true` to prettier config * style: run yarn prettier * Update examples/config-overrides.js Co-authored-by: Daishi Kato <dai-shi@users.noreply.github.com>
This commit is contained in:
parent
37112e585c
commit
c16c8d108f
@ -39,7 +39,7 @@
|
|||||||
"semi": false,
|
"semi": false,
|
||||||
"trailingComma": "es5",
|
"trailingComma": "es5",
|
||||||
"singleQuote": true,
|
"singleQuote": true,
|
||||||
"jsxBracketSameLine": true,
|
"bracketSameLine": true,
|
||||||
"tabWidth": 2,
|
"tabWidth": 2,
|
||||||
"printWidth": 120
|
"printWidth": 120
|
||||||
},
|
},
|
||||||
|
|||||||
@ -10,8 +10,7 @@ export default function Backdrop() {
|
|||||||
className="canvas-container"
|
className="canvas-container"
|
||||||
orthographic
|
orthographic
|
||||||
gl={{ powerPreference: 'high-performance', antialias: false, stencil: false, alpha: false, depth: false }}
|
gl={{ powerPreference: 'high-performance', antialias: false, stencil: false, alpha: false, depth: false }}
|
||||||
camera={{ zoom: 5, position: [0, 0, 200], far: 300, near: 0 }}
|
camera={{ zoom: 5, position: [0, 0, 200], far: 300, near: 0 }}>
|
||||||
>
|
|
||||||
<Suspense fallback={null}>
|
<Suspense fallback={null}>
|
||||||
<Scene dof={dof} />
|
<Scene dof={dof} />
|
||||||
</Suspense>
|
</Suspense>
|
||||||
|
|||||||
@ -9,7 +9,7 @@ export default function CopyButton({ code, ...props }) {
|
|||||||
const [isCopied, setIsCopied] = useState(false)
|
const [isCopied, setIsCopied] = useState(false)
|
||||||
const timer = useRef()
|
const timer = useRef()
|
||||||
|
|
||||||
const handleCopy = useCallback(() => {
|
const handleCopy = useCallback(() => {
|
||||||
clearTimeout(timer.current)
|
clearTimeout(timer.current)
|
||||||
copyToClipboard(code).then(() => {
|
copyToClipboard(code).then(() => {
|
||||||
setIsCopied(true)
|
setIsCopied(true)
|
||||||
@ -34,8 +34,7 @@ export default function CopyButton({ code, ...props }) {
|
|||||||
strokeWidth={2}
|
strokeWidth={2}
|
||||||
strokeLinecap="round"
|
strokeLinecap="round"
|
||||||
strokeLinejoin="round"
|
strokeLinejoin="round"
|
||||||
{...props}
|
{...props}>
|
||||||
>
|
|
||||||
<rect x={9} y={9} width={13} height={13} rx={2} ry={2} />
|
<rect x={9} y={9} width={13} height={13} rx={2} ry={2} />
|
||||||
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" />
|
<path d="M5 15H4a2 2 0 01-2-2V4a2 2 0 012-2h9a2 2 0 012 2v1" />
|
||||||
</svg>
|
</svg>
|
||||||
|
|||||||
@ -1,3 +1,3 @@
|
|||||||
export const copyToClipboard = (str) => {
|
export const copyToClipboard = (str) => {
|
||||||
return navigator.clipboard.writeText(str)
|
return navigator.clipboard.writeText(str)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -68,8 +68,8 @@
|
|||||||
"build:shallow": "rollup -c --config-shallow",
|
"build:shallow": "rollup -c --config-shallow",
|
||||||
"build:context": "rollup -c --config-context",
|
"build:context": "rollup -c --config-context",
|
||||||
"postbuild": "yarn copy",
|
"postbuild": "yarn copy",
|
||||||
"prettier": "prettier '*.{js,json,md}' '{src,tests,docs}/**/*.{ts,tsx,md,mdx}' --write",
|
"prettier": "prettier '*.{js,json,md}' '{examples/src,src,tests,docs}/**/*.{js,jsx,ts,tsx,md,mdx}' --write",
|
||||||
"prettier:ci": "prettier '*.{js,json,md}' '{src,tests,docs}/**/*.{ts,tsx,md,mdx}' --list-different",
|
"prettier:ci": "prettier '*.{js,json,md}' '{examples/src,src,tests,docs}/**/*.{js,jsx,ts,tsx,md,mdx}' --list-different",
|
||||||
"eslint": "eslint --fix '*.{js,json}' '{src,tests}/**/*.{ts,tsx}'",
|
"eslint": "eslint --fix '*.{js,json}' '{src,tests}/**/*.{ts,tsx}'",
|
||||||
"eslint:ci": "eslint '*.{js,json}' '{src,tests}/**/*.{ts,tsx}'",
|
"eslint:ci": "eslint '*.{js,json}' '{src,tests}/**/*.{ts,tsx}'",
|
||||||
"pretest": "tsc --noEmit",
|
"pretest": "tsc --noEmit",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user