Skip to content

Commit 9db96b4

Browse files
authored
build: add formatting check to lint stage (#2464)
* build: add formatting check to lint stage * fix: remove trailing space in script
1 parent 72127b1 commit 9db96b4

File tree

2 files changed

+25
-23
lines changed

2 files changed

+25
-23
lines changed

package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@
4444
"lint:code": "eslint . --ext .js,.ts,.jsx,.tsx",
4545
"lint:spelling": "mdspell 'packages/documentation/docsite/markdown/**/*.md' --en-us --report",
4646
"lint:tone": "alex .",
47+
"lint:formatting": "pretty-quick --check",
4748
"lint": "run-s lint:*",
4849
"changelog": "conventional-changelog -p eslint -i CHANGELOG.md -s -r 0",
4950
"release_canary": "lerna publish -c --preid next --yes",
@@ -172,7 +173,8 @@
172173
{
173174
"files": "*.md",
174175
"options": {
175-
"useTabs": false
176+
"useTabs": false,
177+
"trailingComma": "none"
176178
}
177179
},
178180
{

packages/documentation/docsite/markdown/docs/00 Quick Start/Tutorial.md

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ ReactDOM.render(
115115
<Square black>
116116
<Knight />
117117
</Square>,
118-
document.getElementById('root'),
118+
document.getElementById('root')
119119
)
120120
```
121121

@@ -140,7 +140,7 @@ export default function Square({ black, children }) {
140140
backgroundColor: fill,
141141
color: stroke,
142142
width: '100%',
143-
height: '100%',
143+
height: '100%'
144144
}}
145145
>
146146
{children}
@@ -178,7 +178,7 @@ import Board from './Board'
178178

179179
ReactDOM.render(
180180
<Board knightPosition={[0, 0]} />,
181-
document.getElementById('root'),
181+
document.getElementById('root')
182182
)
183183
```
184184

@@ -206,7 +206,7 @@ export default function Board({ knightPosition }) {
206206
<div
207207
style={{
208208
width: '100%',
209-
height: '100%',
209+
height: '100%'
210210
}}
211211
>
212212
{renderSquare(0, 0, knightPosition)}
@@ -252,7 +252,7 @@ export default function Board({ knightPosition }) {
252252
width: '100%',
253253
height: '100%',
254254
display: 'flex',
255-
flexWrap: 'wrap',
255+
flexWrap: 'wrap'
256256
}}
257257
>
258258
{squares}
@@ -274,7 +274,7 @@ import Board from './Board'
274274

275275
ReactDOM.render(
276276
<Board knightPosition={[7, 4]} />,
277-
document.getElementById('root'),
277+
document.getElementById('root')
278278
)
279279
```
280280

@@ -302,8 +302,8 @@ import { observe } from './Game'
302302

303303
const root = document.getElementById('root')
304304

305-
observe(knightPosition =>
306-
ReactDOM.render(<Board knightPosition={knightPosition} />, root),
305+
observe((knightPosition) =>
306+
ReactDOM.render(<Board knightPosition={knightPosition} />, root)
307307
)
308308
```
309309

@@ -446,7 +446,7 @@ Next, I'm going to create the constants for the draggable item types. We're only
446446

447447
```jsx
448448
export const ItemTypes = {
449-
KNIGHT: 'knight',
449+
KNIGHT: 'knight'
450450
}
451451
```
452452

@@ -459,9 +459,9 @@ The [`useDrag`](/docs/api/use-drag) hook accepts a specification object. In this
459459
```jsx
460460
const [{ isDragging }, drag] = useDrag({
461461
item: { type: ItemTypes.KNIGHT },
462-
collect: monitor => ({
463-
isDragging: !!monitor.isDragging(),
464-
}),
462+
collect: (monitor) => ({
463+
isDragging: !!monitor.isDragging()
464+
})
465465
})
466466
```
467467

@@ -558,7 +558,7 @@ Let's now wrap the `BoardSquare` with a [`useDrop`](/docs/api/use-drop) hook. I'
558558
```jsx
559559
const [, drop] = useDrop({
560560
accept: ItemTypes.KNIGHT,
561-
drop: () => moveKnight(x, y),
561+
drop: () => moveKnight(x, y)
562562
})
563563
```
564564

@@ -570,10 +570,10 @@ In my collecting function I'm going to ask the monitor whether the pointer is cu
570570
const [{ isOver, canDrop }, drop] = useDrop({
571571
accept: ItemTypes.KNIGHT,
572572
drop: () => moveKnight(x, y),
573-
collect: mon => ({
573+
collect: (mon) => ({
574574
isOver: !!mon.isOver(),
575-
canDrop: !!mon.canDrop(),
576-
}),
575+
canDrop: !!mon.canDrop()
576+
})
577577
})
578578
```
579579

@@ -638,10 +638,10 @@ const [{ isOver, canDrop }, drop] = useDrop({
638638
accept: ItemTypes.KNIGHT,
639639
canDrop: () => canMoveKnight(x, y),
640640
drop: () => moveKnight(x, y),
641-
collect: monitor => ({
641+
collect: (monitor) => ({
642642
isOver: !!monitor.isOver(),
643-
canDrop: !!monitor.canDrop(),
644-
}),
643+
canDrop: !!monitor.canDrop()
644+
})
645645
})
646646
```
647647

@@ -697,9 +697,9 @@ We are lucky again, because it is easy to do with React DnD. We just need to use
697697
```jsx
698698
const [{ isDragging }, drag, preview] = useDrag({
699699
item: { type: ItemTypes.KNIGHT },
700-
collect: monitor => ({
701-
isDragging: !!monitor.isDragging(),
702-
}),
700+
collect: (monitor) => ({
701+
isDragging: !!monitor.isDragging()
702+
})
703703
})
704704
```
705705

0 commit comments

Comments
 (0)