Closed m-bert closed 4 months ago
We can make a CI out of this
I've partially did this. I don't think adding CI for capital letters makes sense (for example we have some eslint-disable
comments).
For the key part I've added new ESlint
rule called spaced-comment
- it enforces spaces after //
. It will also catch ///
stuff and similar problems. Unfortunately it is not run with lint-staged
so it won't be caught in pre-commit, but it will be checked on CI.
Description
This PR changes 3 things:
Unifies comments convention across
ts
/tsx
files.Simplifies one
return
statement inGestureHandler
onweb
Simplifies
userSelect
assignment inGestureHandlerWebDelegate
leads to many changed files, so if you think that 2. and 3. deserve their own PRs I'll open them 😅
Comments
Changed things:
//
instead of///
//
and actual commentIt also adds
ESlint
rulespaced-comment
, which enforces spaces between//
and comment content.return
I've removed
if
condition and moved it right toreturn
statementBefore
```tsx if ( offsetX >= left && offsetX <= right && offsetY >= top && offsetY <= bottom ) { return true; } return false; ```After
```tsx return ( offsetX >= left && offsetX <= right && offsetY >= top && offsetY <= bottom ); ```userSelect
assignmentI've changed
userSelect
assignment inGestureHandlerWebDelegate
to use??
operatorBefore
```tsx if (!config.userSelect) { this.view.style['webkitUserSelect'] = 'none'; this.view.style['userSelect'] = 'none'; } else { this.view.style['webkitUserSelect'] = config.userSelect; this.view.style['userSelect'] = config.userSelect; } ```After
```tsx this.view.style['userSelect'] = config.userSelect ?? 'none'; this.view.style['webkitUserSelect'] = config.userSelect ?? 'none'; ```Test plan
Verified that example app works as it used to.