浏览代码

cleanup lint-addons and lint-examples (#25739)

hybridherbst 2 年之前
父节点
当前提交
6622dbf73b

+ 1 - 0
.eslintrc.json

@@ -33,6 +33,7 @@
     "GPUShaderStage": "readonly",
     "GPUShaderStage": "readonly",
     "GPUBufferUsage": "readonly",
     "GPUBufferUsage": "readonly",
     "GPUTextureUsage": "readonly",
     "GPUTextureUsage": "readonly",
+    "GPUTexture": "readonly",
     "GPUMapMode": "readonly",
     "GPUMapMode": "readonly",
     "QUnit": "readonly",
     "QUnit": "readonly",
     "Ammo": "readonly",
     "Ammo": "readonly",

+ 8 - 8
examples/jsm/controls/TrackballControls.js

@@ -209,13 +209,13 @@ class TrackballControls extends EventDispatcher {
 
 
 				} else if ( scope.object.isOrthographicCamera ) {
 				} else if ( scope.object.isOrthographicCamera ) {
 
 
-						scope.object.zoom = MathUtils.clamp( scope.object.zoom / factor, scope.minZoom, scope.maxZoom );
-						
-						if ( lastZoom !== scope.object.zoom ) {
+					scope.object.zoom = MathUtils.clamp( scope.object.zoom / factor, scope.minZoom, scope.maxZoom );
 
 
-							scope.object.updateProjectionMatrix();
-							
-						}
+					if ( lastZoom !== scope.object.zoom ) {
+
+						scope.object.updateProjectionMatrix();
+
+					}
 
 
 				} else {
 				} else {
 
 
@@ -236,11 +236,11 @@ class TrackballControls extends EventDispatcher {
 					} else if ( scope.object.isOrthographicCamera ) {
 					} else if ( scope.object.isOrthographicCamera ) {
 
 
 						scope.object.zoom = MathUtils.clamp( scope.object.zoom / factor, scope.minZoom, scope.maxZoom );
 						scope.object.zoom = MathUtils.clamp( scope.object.zoom / factor, scope.minZoom, scope.maxZoom );
-						
+
 						if ( lastZoom !== scope.object.zoom ) {
 						if ( lastZoom !== scope.object.zoom ) {
 
 
 							scope.object.updateProjectionMatrix();
 							scope.object.updateProjectionMatrix();
-							
+
 						}
 						}
 
 
 					} else {
 					} else {

+ 1 - 1
examples/jsm/loaders/DRACOLoader.js

@@ -82,7 +82,7 @@ class DRACOLoader extends Loader {
 
 
 	}
 	}
 
 
-	parse ( buffer, onLoad, onError ) {
+	parse( buffer, onLoad, onError ) {
 
 
 		this.decodeDracoFile( buffer, onLoad, null, null, SRGBColorSpace ).catch( onError );
 		this.decodeDracoFile( buffer, onLoad, null, null, SRGBColorSpace ).catch( onError );
 
 

+ 1 - 1
examples/jsm/loaders/NRRDLoader.js

@@ -388,7 +388,7 @@ class NRRDLoader extends Loader {
 			const yIndex = headerObject.vectors.findIndex( vector => vector[ 1 ] !== 0 );
 			const yIndex = headerObject.vectors.findIndex( vector => vector[ 1 ] !== 0 );
 			const zIndex = headerObject.vectors.findIndex( vector => vector[ 2 ] !== 0 );
 			const zIndex = headerObject.vectors.findIndex( vector => vector[ 2 ] !== 0 );
 
 
-			let axisOrder = [];
+			const axisOrder = [];
 
 
 			if ( xIndex !== yIndex && xIndex !== zIndex && yIndex !== zIndex ) {
 			if ( xIndex !== yIndex && xIndex !== zIndex && yIndex !== zIndex ) {
 
 

+ 1 - 1
examples/jsm/renderers/CSS2DRenderer.js

@@ -130,7 +130,7 @@ class CSS2DRenderer {
 
 
 					const element = object.element;
 					const element = object.element;
 
 
-					element.style.transform = 'translate(' + ( - 100 * object.center.x ) + '%,' + ( - 100 * object.center.y ) + '%)' +  'translate(' + ( _vector.x * _widthHalf + _widthHalf ) + 'px,' + ( - _vector.y * _heightHalf + _heightHalf ) + 'px)';
+					element.style.transform = 'translate(' + ( - 100 * object.center.x ) + '%,' + ( - 100 * object.center.y ) + '%)' + 'translate(' + ( _vector.x * _widthHalf + _widthHalf ) + 'px,' + ( - _vector.y * _heightHalf + _heightHalf ) + 'px)';
 
 
 					if ( element.parentNode !== domElement ) {
 					if ( element.parentNode !== domElement ) {
 
 

+ 1 - 1
examples/webgl_geometry_spline_editor.html

@@ -369,7 +369,7 @@
 				onUpPosition.y = event.clientY;
 				onUpPosition.y = event.clientY;
 
 
 				if ( onDownPosition.distanceTo( onUpPosition ) === 0 ) {
 				if ( onDownPosition.distanceTo( onUpPosition ) === 0 ) {
-					
+
 					transformControl.detach();
 					transformControl.detach();
 					render();
 					render();
 
 

+ 2 - 2
examples/webgpu_skinning_points.html

@@ -51,10 +51,10 @@
 				}
 				}
 
 
 				camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 1, 1000 );
 				camera = new THREE.PerspectiveCamera( 50, window.innerWidth / window.innerHeight, 1, 1000 );
-				camera.position.set( 0, 300, -85 );
+				camera.position.set( 0, 300, - 85 );
 
 
 				scene = new THREE.Scene();
 				scene = new THREE.Scene();
-				camera.lookAt( 0, 0, -85 );
+				camera.lookAt( 0, 0, - 85 );
 
 
 				clock = new THREE.Clock();
 				clock = new THREE.Clock();