瀏覽代碼

fix some of the lint-addons warnings and errors (#26388)

hybridherbst 2 年之前
父節點
當前提交
1bb77a707f

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

@@ -1270,7 +1270,7 @@ class FBXTreeParser {
 
 		} else {
 
-			material = new MeshPhongMaterial( { 
+			material = new MeshPhongMaterial( {
 				name: Loader.DEFAULT_MATERIAL_NAME,
 				color: 0xcccccc
 			} );

+ 2 - 0
examples/jsm/loaders/KTX2Loader.js

@@ -315,12 +315,14 @@ class KTX2Loader extends Loader {
 
 			const texture = mipmaps[ 0 ];
 			texture.mipmaps = mipmaps.map( dt => {
+
 				return {
 					data: dt.source.data,
 					width: dt.source.data.width,
 					height: dt.source.data.height,
 					depth: dt.source.data.depth
 				};
+
 			} );
 			return texture;
 

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

@@ -767,7 +767,7 @@ class LDrawParsedCache {
 				const text = await fileLoader.loadAsync( subobjectURL );
 				return text;
 
-			} catch {
+			} catch ( _ ) {
 
 				continue;
 

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

@@ -473,10 +473,10 @@ class NRRDLoader extends Loader {
 
 		volume.inverseMatrix = new Matrix4();
 		volume.inverseMatrix.copy( volume.matrix ).invert();
-		
+
 		volume.RASDimensions = [
-			Math.floor( volume.xLength * spacingX ), 
-			Math.floor( volume.yLength * spacingY ), 
+			Math.floor( volume.xLength * spacingX ),
+			Math.floor( volume.yLength * spacingY ),
 			Math.floor( volume.zLength * spacingZ )
 		];
 

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

@@ -706,7 +706,7 @@ class PLYLoader extends Loader {
 			// ascii section using \r\n as line endings
 			if ( hasCRNL === true ) i ++;
 
-			return { headerText: lines.join( '\r' ) + '\r',  headerLength: i };
+			return { headerText: lines.join( '\r' ) + '\r', headerLength: i };
 
 		}
 

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

@@ -960,7 +960,7 @@ class VRMLLoader extends Loader {
 
 			// if the appearance field is NULL or unspecified, lighting is off and the unlit object color is (0, 0, 0)
 
-			let material = new MeshBasicMaterial( { 
+			let material = new MeshBasicMaterial( {
 				name: Loader.DEFAULT_MATERIAL_NAME,
 				color: 0x000000
 			} );

+ 4 - 6
examples/jsm/misc/Volume.js

@@ -340,20 +340,18 @@ class Volume {
 
 		}
 
-
-		let iLength, jLength;
-
-		if( ! this.segmentation ) {
+		if ( ! this.segmentation ) {
 
 			firstDirection.applyMatrix4( volume.inverseMatrix ).normalize();
 			secondDirection.applyMatrix4( volume.inverseMatrix ).normalize();
 			axisInIJK.applyMatrix4( volume.inverseMatrix ).normalize();
 
 		}
+
 		firstDirection.arglet = 'i';
 		secondDirection.arglet = 'j';
-		iLength = Math.floor( Math.abs( firstDirection.dot( dimensions ) ) );
-		jLength = Math.floor( Math.abs( secondDirection.dot( dimensions ) ) );
+		const iLength = Math.floor( Math.abs( firstDirection.dot( dimensions ) ) );
+		const jLength = Math.floor( Math.abs( secondDirection.dot( dimensions ) ) );
 		const planeWidth = Math.abs( iLength * firstSpacing );
 		const planeHeight = Math.abs( jLength * secondSpacing );
 

+ 2 - 2
examples/jsm/nodes/geometry/RangeNode.js

@@ -44,8 +44,8 @@ class RangeNode extends Node {
 
 		if ( object.isInstancedMesh === true ) {
 
-			let minValue = this.minNode.value;
-			let maxValue = this.maxNode.value;
+			const minValue = this.minNode.value;
+			const maxValue = this.maxNode.value;
 
 			const minLength = builder.getTypeLength( getValueType( minValue ) );
 			const maxLength = builder.getTypeLength( getValueType( maxValue ) );

+ 1 - 1
examples/jsm/nodes/shadernode/ShaderNode.js

@@ -261,7 +261,7 @@ const safeGetNodeType = ( node ) => {
 
 		return node.getNodeType();
 
-	} catch {
+	} catch ( _ ) {
 
 		return undefined;
 

+ 1 - 0
examples/jsm/renderers/webgpu/utils/WebGPUAttributeUtils.js

@@ -57,6 +57,7 @@ class WebGPUAttributeUtils {
 			buffer.unmap();
 
 			bufferData.buffer = buffer;
+
 		}
 
 	}