浏览代码

lint examples

Garrett Johnson 4 年之前
父节点
当前提交
d4bc0cfa6f
共有 6 个文件被更改,包括 15 次插入10 次删除
  1. 6 2
      example/FlyOrbitControls.js
  2. 1 1
      example/cmptExample.js
  3. 2 2
      example/customMaterial.js
  4. 2 2
      example/offscreenShadows.js
  5. 3 2
      example/vr.js
  6. 1 1
      package.json

+ 6 - 2
example/FlyOrbitControls.js

@@ -14,7 +14,11 @@ export class FlyOrbitControls extends OrbitControls {
 
 			if ( this.enabled ) {
 
-				Object.defineProperty( e, 'shiftKey', { get() { return false } } );
+				Object.defineProperty( e, 'shiftKey', { get() {
+
+					return false;
+
+				} } );
 
 			}
 
@@ -210,7 +214,7 @@ export class FlyOrbitControls extends OrbitControls {
 
 			}
 
-			switch( key ) {
+			switch ( key ) {
 
 				case this.forwardKey:
 					forwardHeld = false;

+ 1 - 1
example/cmptExample.js

@@ -66,7 +66,7 @@ function init() {
 		.load( '...' )
 		.then( res => {
 
-			console.log(res);
+			console.log( res );
 
 			// console.log( res );
 			// scene.add( res.scene );

+ 2 - 2
example/customMaterial.js

@@ -128,7 +128,7 @@ function updateMaterial( scene ) {
 		if ( c.isMesh ) {
 
 			c.material.dispose();
-			switch( materialIndex ) {
+			switch ( materialIndex ) {
 
 				case DEFAULT:
 					c.material = c.originalMaterial;
@@ -274,7 +274,7 @@ function init() {
 	gui.add( params, 'material', { DEFAULT, GRADIENT, TOPOGRAPHIC_LINES, LIGHTING } )
 		.onChange( () => {
 
-			tiles.forEachLoadedModel( updateMaterial )
+			tiles.forEachLoadedModel( updateMaterial );
 
 		} );
 	gui.add( params, 'rebuild' );

+ 2 - 2
example/offscreenShadows.js

@@ -80,7 +80,7 @@ function init() {
 	document.body.appendChild( renderer.domElement );
 
 	camera = new PerspectiveCamera( 60, window.innerWidth / window.innerHeight, 1, 4000 );
-	camera.position.set( -21, 13, 25 );
+	camera.position.set( - 21, 13, 25 );
 
 	orthoCamera = new OrthographicCamera();
 
@@ -173,7 +173,7 @@ function animate() {
 	requestAnimationFrame( animate );
 
 	tiles.errorTarget = params.errorTarget;
-	switch( parseFloat( params.shadowStrategy ) ) {
+	switch ( parseFloat( params.shadowStrategy ) ) {
 
 		case NONE:
 			tiles.displayActiveTiles = false;

+ 3 - 2
example/vr.js

@@ -29,12 +29,13 @@ import {
 	AdditiveBlending,
 	Line,
 	Vector3,
+	RingBufferGeometry,
 } from 'three';
 import * as dat from 'three/examples/jsm/libs/dat.gui.module.js';
 import { VRButton } from 'three/examples/jsm/webxr/VRButton.js';
 import { XRControllerModelFactory } from 'three/examples/jsm/webxr/XRControllerModelFactory.js';
 
-let camera,  scene, renderer, tiles;
+let camera, scene, renderer, tiles;
 let workspace;
 let box, grid;
 let raycaster, fwdVector, intersectRing;
@@ -237,7 +238,7 @@ function render() {
 		const currCamera = renderer.xr.getCamera( camera );
 		tiles.setCamera( currCamera );
 
-		const leftCam = currCamera.cameras[0];
+		const leftCam = currCamera.cameras[ 0 ];
 		if ( leftCam ) {
 
 			tiles.setResolution( currCamera, leftCam.viewport.z, leftCam.viewport.w );

+ 1 - 1
package.json

@@ -24,7 +24,7 @@
   "scripts": {
     "start": "concurrently \"parcel watch example/*.html --out-dir ./example/dev-bundle/ --public-url . --no-cache\" \"static-server\"",
     "build": "parcel build --no-content-hash example/*.html --out-dir ./example/bundle/ --public-url . --no-cache",
-    "lint": "eslint \"src/**/*.js\" \"test/**/*.js\" && tsc -p tsconfig.json --noEmit",
+    "lint": "eslint \"src/**/*.js\" \"test/**/*.js\" \"example/*.js\" && tsc -p tsconfig.json --noEmit",
     "test": "jest"
   },
   "repository": {