Skip to content

Commit

Permalink
chore: Add no-var eslint rule to enforce code style (#35)
Browse files Browse the repository at this point in the history
Fix errors in OrbitControls file
  • Loading branch information
disambiguator authored Mar 16, 2021
1 parent 577bdff commit da68934
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
"import/default": "off",
"@typescript-eslint/explicit-module-boundary-types": "off",
"no-unused-vars": ["warn"],
"no-var": "error",
"react/jsx-uses-react": "error",
"react/jsx-uses-vars": "error",
"@typescript-eslint/no-unused-vars": ["warn", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }],
Expand Down
20 changes: 10 additions & 10 deletions src/controls/OrbitControls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -282,13 +282,13 @@ class OrbitControls extends EventDispatcher {
// internals
//

var scope = this
const scope = this

var changeEvent = { type: 'change' }
const changeEvent = { type: 'change' }
const startEvent = { type: 'start' }
const endEvent = { type: 'end' }

var STATE = {
const STATE = {
NONE: -1,
ROTATE: 0,
DOLLY: 1,
Expand All @@ -299,17 +299,17 @@ class OrbitControls extends EventDispatcher {
TOUCH_DOLLY_ROTATE: 6,
}

var state = STATE.NONE
let state = STATE.NONE

var EPS = 0.000001
const EPS = 0.000001

// current position in spherical coordinates
var spherical = new Spherical()
var sphericalDelta = new Spherical()
const spherical = new Spherical()
const sphericalDelta = new Spherical()

var scale = 1
var panOffset = new Vector3()
var zoomChanged = false
let scale = 1
const panOffset = new Vector3()
let zoomChanged = false

const rotateStart = new Vector2()
const rotateEnd = new Vector2()
Expand Down

1 comment on commit da68934

@vercel
Copy link

@vercel vercel bot commented on da68934 Mar 16, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.