Kaynağa Gözat

Addons: auto-fix linting problems (#27457)

Brings 93 problems (60 errors, 33 warnings) down to 37 problems (4 errors, 33 warnings).
hybridherbst 1 yıl önce
ebeveyn
işleme
cd614f62e9

+ 2 - 2
examples/jsm/controls/OrbitControls.js

@@ -373,14 +373,14 @@ class OrbitControls extends EventDispatcher {
 					}
 
 				} else if ( scope.object.isOrthographicCamera ) {
-					
+
 					zoomChanged = scale !== 1;
 
 					if ( zoomChanged ) {
 
 						scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / scale ) );
 						scope.object.updateProjectionMatrix();
-						
+
 					}
 
 				}

+ 4 - 4
examples/jsm/exporters/USDZExporter.js

@@ -1,11 +1,11 @@
 import {
-  NoColorSpace,
-  DoubleSide,
+	NoColorSpace,
+	DoubleSide,
 } from 'three';
 
 import {
-  strToU8,
-  zipSync,
+	strToU8,
+	zipSync,
 } from '../libs/fflate.module.js';
 
 import { decompress } from './../utils/TextureUtils.js';

+ 3 - 3
examples/jsm/helpers/TextureHelper.js

@@ -216,8 +216,8 @@ function createSliceGeometry( texture, width, height, depth ) {
 			const w = sliceCount === 1
 				? 1
 				: texture.isDataArrayTexture || texture.isCompressedArrayTexture
-				? i
-				: i / ( sliceCount - 1 );
+					? i
+					: i / ( sliceCount - 1 );
 
 			uvw.setXYZ( j, u, v, w );
 
@@ -234,4 +234,4 @@ function createSliceGeometry( texture, width, height, depth ) {
 
 }
 
-export { TextureHelper };
+export { TextureHelper };

+ 25 - 24
examples/jsm/loaders/3DMLoader.js

@@ -235,7 +235,7 @@ class Rhino3dmLoader extends Loader {
 
 		//console.log(material)
 
-		let mat = new MeshPhysicalMaterial( {
+		const mat = new MeshPhysicalMaterial( {
 
 			color: new Color( material.diffuseColor.r / 255.0, material.diffuseColor.g / 255.0, material.diffuseColor.b / 255.0 ),
 			emissive: new Color( material.emissionColor.r, material.emissionColor.g, material.emissionColor.b ),
@@ -310,7 +310,7 @@ class Rhino3dmLoader extends Loader {
 						mat.envMap = map;
 
 						break;
-					
+
 					case 'Opacity':
 
 						mat.transmissionMap = map;
@@ -330,7 +330,7 @@ class Rhino3dmLoader extends Loader {
 						mat.transparent = true;
 
 						break;
-					
+
 					case 'PBR_AmbientOcclusion':
 
 						mat.aoMap = map;
@@ -461,7 +461,7 @@ class Rhino3dmLoader extends Loader {
 		object.userData.settings[ 'renderSettings' ] = data.renderSettings;
 		object.userData[ 'objectType' ] = 'File3dm';
 		object.userData[ 'materials' ] = null;
-		
+
 		object.name = this.url;
 
 		let objects = data.objects;
@@ -490,7 +490,8 @@ class Rhino3dmLoader extends Loader {
 
 					let matId;
 
-					switch( attributes.materialSource.name ) {
+					switch ( attributes.materialSource.name ) {
+
 						case 'ObjectMaterialSource_MaterialFromLayer':
 							//check layer index
 							if ( attributes.layerIndex >= 0 ) {
@@ -1129,7 +1130,7 @@ function Rhino3dmWorker() {
 
 			const _material = doc.materials().get( i );
 
-			let material = extractProperties( _material );
+			const material = extractProperties( _material );
 
 			const textures = [];
 
@@ -1232,42 +1233,42 @@ function Rhino3dmWorker() {
 		// Handle Render Environments for Material Environment
 
 		// get the id of the active render environment skylight, which we'll use for environment texture
-		const reflectionId = doc.settings().renderSettings().renderEnvironments.reflectionId
+		const reflectionId = doc.settings().renderSettings().renderEnvironments.reflectionId;
 
-		const rc = doc.renderContent()
+		const rc = doc.renderContent();
 
-		let renderEnvironment = null
+		let renderEnvironment = null;
 
-		for( let i = 0; i < rc.count; i++ ) {
+		for ( let i = 0; i < rc.count; i ++ ) {
 
-			const content = rc.get(i)
+			const content = rc.get( i );
 
-			switch( content.kind ) {
+			switch ( content.kind ) {
 
 				case 'environment':
 
-					const id = content.id
+					const id = content.id;
 
 					// there could be multiple render environments in a 3dm file
 					if ( id !== reflectionId ) break;
 
-					const renderTexture = content.findChild( 'texture' )
-					const fileName = renderTexture.fileName
+					const renderTexture = content.findChild( 'texture' );
+					const fileName = renderTexture.fileName;
 
 					for ( let j = 0; j < doc.embeddedFiles().count; j ++ ) {
 
-						const _fileName = doc.embeddedFiles().get( j ).fileName
+						const _fileName = doc.embeddedFiles().get( j ).fileName;
 
 						if ( fileName === _fileName ) {
 
-							const background = doc.getEmbeddedFileAsBase64( fileName )
-							const backgroundImage = 'data:image/png;base64,' + background
+							const background = doc.getEmbeddedFileAsBase64( fileName );
+							const backgroundImage = 'data:image/png;base64,' + background;
 							renderEnvironment = { type: 'renderEnvironment', image: backgroundImage, name: fileName };
 
 						}
 
 					}
-					
+
 					break;
 
 			}
@@ -1307,7 +1308,7 @@ function Rhino3dmWorker() {
 			renderEnvironments: extractProperties( doc.settings().renderSettings().renderEnvironments ),
 			postEffects: extractProperties( doc.settings().renderSettings().postEffects ),
 
-		}
+		};
 
 		doc.delete();
 
@@ -1317,7 +1318,7 @@ function Rhino3dmWorker() {
 
 	function extractTextures( m, tTypes, d ) {
 
-		const textures = []
+		const textures = [];
 
 		for ( let i = 0; i < tTypes.length; i ++ ) {
 
@@ -1584,13 +1585,13 @@ function Rhino3dmWorker() {
 			if ( _attributes.decals().count > 0 ) {
 
 				self.postMessage( { type: 'warning', id: taskID, data: {
-					message: `THREE.3DMLoader: No conversion exists for the decals associated with this object.`,
+					message: 'THREE.3DMLoader: No conversion exists for the decals associated with this object.',
 					type: 'no conversion',
 					guid: _attributes.id
 				}
-	
+
 				} );
-				
+
 			}
 
 			attributes.drawColor = _attributes.drawColor( doc );

+ 1 - 0
examples/jsm/loaders/DDSLoader.js

@@ -221,6 +221,7 @@ class DDSLoader extends CompressedTextureLoader {
 					}
 
 				}
+
 				break;
 
 			default:

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

@@ -865,8 +865,8 @@ async function createRawTexture( container ) {
 	if ( UNCOMPRESSED_FORMATS.has( FORMAT_MAP[ vkFormat ] ) ) {
 
 		texture = container.pixelDepth === 0
-		? new DataTexture( mipmaps[ 0 ].data, container.pixelWidth, container.pixelHeight )
-		: new Data3DTexture( mipmaps[ 0 ].data, container.pixelWidth, container.pixelHeight, container.pixelDepth );
+			? new DataTexture( mipmaps[ 0 ].data, container.pixelWidth, container.pixelHeight )
+			: new Data3DTexture( mipmaps[ 0 ].data, container.pixelWidth, container.pixelHeight, container.pixelDepth );
 
 	} else {
 

+ 3 - 2
examples/jsm/loaders/LUTImageLoader.js

@@ -12,9 +12,10 @@ import {
 export class LUTImageLoader extends Loader {
 
 	constructor( flipVertical = false ) {
-		//The NeutralLUT.png has green at the bottom for Unreal ang green at the top for Unity URP Color Lookup 
+
+		//The NeutralLUT.png has green at the bottom for Unreal ang green at the top for Unity URP Color Lookup
 		//post-processing. If you're using lut image strips from a Unity pipeline then pass true to the constructor
-		
+
 		super();
 
 		this.flip = flipVertical;

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

@@ -621,7 +621,7 @@ class MaterialXNode {
 		let emissiveNode = null;
 
 		if ( inputs.emission ) emissiveNode = inputs.emission;
-		if ( inputs.emissionColor )  {
+		if ( inputs.emissionColor ) {
 
 			emissiveNode = emissiveNode ? mul( emissiveNode, inputs.emissionColor ) : emissiveNode;
 

+ 1 - 1
examples/jsm/nodes/lighting/AmbientLightNode.js

@@ -14,7 +14,7 @@ class AmbientLightNode extends AnalyticLightNode {
 
 	setup( { context } ) {
 
-		context.irradiance.addAssign(this.colorNode );
+		context.irradiance.addAssign( this.colorNode );
 
 	}
 

+ 1 - 1
examples/jsm/nodes/lighting/LightingContextNode.js

@@ -39,7 +39,7 @@ class LightingContextNode extends ContextNode {
 			ambientOcclusion: float( 1 ).temp( 'ambientOcclusion' ),
 			reflectedLight,
 			backdrop: backdropNode,
-			backdropAlpha : backdropAlphaNode
+			backdropAlpha: backdropAlphaNode
 		};
 
 		return context;

+ 2 - 2
examples/jsm/renderers/webgl/utils/WebGLTextureUtils.js

@@ -239,9 +239,9 @@ class WebGLTextureUtils {
 
 		const dstBuffer = new typedArrayType( elementCount );
 
-		gl.bindBuffer(  gl.PIXEL_PACK_BUFFER, buffer );
+		gl.bindBuffer( gl.PIXEL_PACK_BUFFER, buffer );
 		gl.getBufferSubData( gl.PIXEL_PACK_BUFFER, 0, dstBuffer );
-		gl.bindBuffer(  gl.PIXEL_PACK_BUFFER, null );
+		gl.bindBuffer( gl.PIXEL_PACK_BUFFER, null );
 
 		gl.deleteFramebuffer( fb );
 

+ 2 - 2
examples/jsm/renderers/webgl/utils/WebGLUtils.js

@@ -251,7 +251,7 @@ class WebGLUtils {
 
 				const res = gl.clientWaitSync( sync, gl.SYNC_FLUSH_COMMANDS_BIT, 0 );
 
-				if ( res === gl.WAIT_FAILED) {
+				if ( res === gl.WAIT_FAILED ) {
 
 					gl.deleteSync( sync );
 
@@ -260,7 +260,7 @@ class WebGLUtils {
 
 				}
 
-				if ( res === gl.TIMEOUT_EXPIRED) {
+				if ( res === gl.TIMEOUT_EXPIRED ) {
 
 					requestAnimationFrame( test );
 					return;

+ 1 - 1
examples/jsm/transpiler/AST.js

@@ -267,4 +267,4 @@ export class For {
 
 	}
 
-}
+}

+ 1 - 1
examples/jsm/transpiler/GLSLDecoder.js

@@ -938,4 +938,4 @@ class GLSLDecoder {
 
 }
 
-export default GLSLDecoder;
+export default GLSLDecoder;

+ 1 - 1
examples/jsm/transpiler/ShaderToyDecoder.js

@@ -46,4 +46,4 @@ class ShaderToyDecoder extends GLSLDecoder {
 
 }
 
-export default ShaderToyDecoder;
+export default ShaderToyDecoder;

+ 1 - 1
examples/jsm/transpiler/TSLEncoder.js

@@ -712,4 +712,4 @@ ${ this.tab }} );\n\n`;
 
 }
 
-export default TSLEncoder;
+export default TSLEncoder;

+ 2 - 0
examples/jsm/utils/SortUtils.js

@@ -13,8 +13,10 @@ const bins_buffer = new ArrayBuffer( ( ITERATIONS + 1 ) * BIN_SIZE * 4 );
 
 let c = 0;
 for ( let i = 0; i < ( ITERATIONS + 1 ); i ++ ) {
+
 	bins[ i ] = new Uint32Array( bins_buffer, c, BIN_SIZE );
 	c += BIN_SIZE * 4;
+
 }
 
 const defaultGet = ( el ) => el;