Skip to content

Commit ba28576

Browse files
committed
Fix prettier and run format
1 parent f03f010 commit ba28576

File tree

4 files changed

+111
-60
lines changed

4 files changed

+111
-60
lines changed

.prettierrc

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"trailingComma": "es5",
3+
"tabWidth": 2,
4+
"semi": true,
5+
"printWidth": 100,
6+
"singleQuote": false,
7+
"quoteProps": "preserve",
8+
"arrowParens": "avoid"
9+
}

package-lock.json

Lines changed: 50 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
"lint": "eslint 'src/**/*.tsx'",
1616
"build": "rollup -c",
1717
"start": "rollup -c -w",
18+
"format": "prettier --write --ignore-unknown src/**/*",
1819
"storybook": "start-storybook -s public -p 6006",
1920
"build-storybook": "build-storybook -s public"
2021
},
@@ -42,6 +43,7 @@
4243
"babel-eslint": "^10.1.0",
4344
"eslint": "^7.32.0",
4445
"eslint-plugin-react": "^7.31.10",
46+
"prettier": "^2.7.1",
4547
"react": "^17.0.2",
4648
"react-dom": "^17.0.2",
4749
"rollup": "^2.49.0",

src/stories/skinview3d.stories.tsx

Lines changed: 50 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,14 @@ export const basic = () => (
2020
);
2121

2222
export const basicWithKnobs = () => {
23-
2423
const options: any = [
25-
'textures/skin-legacyhat-default-no_hd.png',
26-
'textures/skin-1.8-default-no_hd.png',
27-
'textures/skin-1.8-slim-no_hd.png',
28-
'textures/skin-old-default-no_hd.png',
29-
]
24+
"textures/skin-legacyhat-default-no_hd.png",
25+
"textures/skin-1.8-default-no_hd.png",
26+
"textures/skin-1.8-slim-no_hd.png",
27+
"textures/skin-old-default-no_hd.png",
28+
];
3029

31-
const value = radios('Skin URL', options, 'textures/skin-legacyhat-default-no_hd.png');
30+
const value = radios("Skin URL", options, "textures/skin-legacyhat-default-no_hd.png");
3231

3332
const numberOptions = {
3433
range: true,
@@ -37,75 +36,72 @@ export const basicWithKnobs = () => {
3736
step: 1,
3837
};
3938

40-
const width = number('Width', 150, numberOptions);
41-
const height = number('Height', 300, numberOptions);
39+
const width = number("Width", 150, numberOptions);
40+
const height = number("Height", 300, numberOptions);
4241

43-
return <Skinview3d
44-
className='viewer'
45-
skinUrl={value}
46-
height={height}
47-
width={width}
48-
/>
42+
return <Skinview3d className="viewer" skinUrl={value} height={height} width={width} />;
4943
};
5044

5145
export const multiple = () => (
52-
<div style={{ display: 'flex', flexDirection: 'row', }}>
46+
<div style={{ display: "flex", flexDirection: "row" }}>
5347
<Skinview3d
54-
className='viewer'
48+
className="viewer"
5549
skinUrl="textures/skin-legacyhat-default-no_hd.png"
5650
height={300}
5751
width={120}
5852
/>
5953
<Skinview3d
60-
className='viewer'
54+
className="viewer"
6155
skinUrl="textures/skin-1.8-default-no_hd.png"
6256
height={300}
6357
width={120}
6458
/>
65-
<Skinview3d
66-
skinUrl="textures/skin-1.8-slim-no_hd.png"
67-
height={300}
68-
width={120}
69-
/>
59+
<Skinview3d skinUrl="textures/skin-1.8-slim-no_hd.png" height={300} width={120} />
7060
</div>
7161
);
7262

7363
export const withAnimation = () => {
74-
return <Skinview3d
75-
className='viewer'
76-
skinUrl="textures/skin-legacyhat-default-no_hd.png"
77-
height={300}
78-
width={150}
79-
onReady={(skinViewer: skinview3d.SkinViewer) => {
80-
// Add an animation
81-
skinViewer.animation = new skinview3d.WalkingAnimation();
82-
// Add another animation
83-
skinViewer.autoRotate = true;
84-
}}
85-
/>
64+
return (
65+
<Skinview3d
66+
className="viewer"
67+
skinUrl="textures/skin-legacyhat-default-no_hd.png"
68+
height={300}
69+
width={150}
70+
onReady={(skinViewer: skinview3d.SkinViewer) => {
71+
// Add an animation
72+
skinViewer.animation = new skinview3d.WalkingAnimation();
73+
// Add another animation
74+
skinViewer.autoRotate = true;
75+
}}
76+
/>
77+
);
8678
};
8779

8880
export const cape = () => {
89-
return <Skinview3d
90-
className='viewer'
91-
skinUrl="textures/skin-legacyhat-default-no_hd.png"
92-
capeUrl="textures/mojang-classic-cape.png"
93-
height={300}
94-
width={150}
95-
/>
81+
return (
82+
<Skinview3d
83+
className="viewer"
84+
skinUrl="textures/skin-legacyhat-default-no_hd.png"
85+
capeUrl="textures/mojang-classic-cape.png"
86+
height={300}
87+
width={150}
88+
/>
89+
);
9690
};
9791

9892
export const controlsDisabled = () => {
99-
return <Skinview3d
100-
className='viewer'
101-
skinUrl="textures/skin-legacyhat-default-no_hd.png"
102-
height={300}
103-
width={150}
104-
onReady={(skinViewer: skinview3d.SkinViewer) => {
105-
skinViewer.autoRotate = false;
106-
skinViewer.controls.enablePan = false;
107-
skinViewer.controls.enableRotate = false;
108-
skinViewer.controls.enableZoom = false;
109-
}}
110-
/>
93+
return (
94+
<Skinview3d
95+
className="viewer"
96+
skinUrl="textures/skin-legacyhat-default-no_hd.png"
97+
height={300}
98+
width={150}
99+
onReady={(skinViewer: skinview3d.SkinViewer) => {
100+
skinViewer.autoRotate = false;
101+
skinViewer.controls.enablePan = false;
102+
skinViewer.controls.enableRotate = false;
103+
skinViewer.controls.enableZoom = false;
104+
}}
105+
/>
106+
);
111107
};

0 commit comments

Comments
 (0)