Browse Source

Eslint: fix errors (#30383)

Co-authored-by: Samuel Rigaud <srigaud@duodisplay.com>
Samuel Rigaud 1 year ago
parent
commit
176ea06512

+ 4 - 4
editor/js/Strings.js

@@ -3,8 +3,8 @@ function Strings( config ) {
 	const language = config.getKey( 'language' );
 
 	const values = {
-fa: {
-'prompt/file/open': 'تمام داده های ذخیره نشده پاک خواهند شد آیا مطمئنید؟',
+		fa: {
+			'prompt/file/open': 'تمام داده های ذخیره نشده پاک خواهند شد آیا مطمئنید؟',
 			'prompt/file/failedToOpenProject': 'خطایی در باز کردن پروژه پیش آمده',
 			'prompt/file/export/noMeshSelected': 'هیچ Mesh ای انتخاب نکردید',
 			'prompt/file/export/noObjectSelected': 'هیچ آبجکتی انتخاب نکردید!',
@@ -176,7 +176,7 @@ fa: {
 			'sidebar/geometry/buffer_geometry/attributes': 'صفات',
 			'sidebar/geometry/buffer_geometry/index': 'شاخص',
 			'sidebar/geometry/buffer_geometry/morphAttributes': 'صفات شکل (مورف)',
-			'sidebar/geometry/buffer_geometry/morphRelative':  'صفات نسبی (رلتیو)',
+			'sidebar/geometry/buffer_geometry/morphRelative': 'صفات نسبی (رلتیو)',
 
 			'sidebar/geometry/capsule_geometry/radius': 'شعاع',
 			'sidebar/geometry/capsule_geometry/length': 'طول',
@@ -239,7 +239,7 @@ fa: {
 
 			'sidebar/geometry/sphere_geometry/radius': 'شعاع',
 			'sidebar/geometry/sphere_geometry/widthsegments': 'بخش عرض',
-			'sidebar/geometry/sphere_geometry/heightsegments':  'بخش ارتفاع',
+			'sidebar/geometry/sphere_geometry/heightsegments': 'بخش ارتفاع',
 			'sidebar/geometry/sphere_geometry/phistart': 'شروع فی',
 			'sidebar/geometry/sphere_geometry/philength': ' طول فی',
 			'sidebar/geometry/sphere_geometry/thetastart': 'شروع تتا',

+ 1 - 1
examples/jsm/capabilities/WebGPU.js

@@ -1,4 +1,4 @@
-let isAvailable = ( typeof navigator !== 'undefined'  && navigator.gpu !== undefined );
+let isAvailable = ( typeof navigator !== 'undefined' && navigator.gpu !== undefined );
 
 if ( typeof window !== 'undefined' && isAvailable ) {
 

+ 7 - 7
examples/jsm/physics/JoltPhysics.js

@@ -39,7 +39,7 @@ const NUM_OBJECT_LAYERS = 2;
 
 function setupCollisionFiltering( settings ) {
 
-	let objectFilter = new Jolt.ObjectLayerPairFilterTable( NUM_OBJECT_LAYERS );
+	const objectFilter = new Jolt.ObjectLayerPairFilterTable( NUM_OBJECT_LAYERS );
 	objectFilter.EnableCollision( LAYER_NON_MOVING, LAYER_MOVING );
 	objectFilter.EnableCollision( LAYER_MOVING, LAYER_MOVING );
 
@@ -47,7 +47,7 @@ function setupCollisionFiltering( settings ) {
 	const BP_LAYER_MOVING = new Jolt.BroadPhaseLayer( 1 );
 	const NUM_BROAD_PHASE_LAYERS = 2;
 
-	let bpInterface = new Jolt.BroadPhaseLayerInterfaceTable( NUM_OBJECT_LAYERS, NUM_BROAD_PHASE_LAYERS );
+	const bpInterface = new Jolt.BroadPhaseLayerInterfaceTable( NUM_OBJECT_LAYERS, NUM_BROAD_PHASE_LAYERS );
 	bpInterface.MapObjectToBroadPhaseLayer( LAYER_NON_MOVING, BP_LAYER_NON_MOVING );
 	bpInterface.MapObjectToBroadPhaseLayer( LAYER_MOVING, BP_LAYER_MOVING );
 
@@ -55,7 +55,7 @@ function setupCollisionFiltering( settings ) {
 	settings.mBroadPhaseLayerInterface = bpInterface;
 	settings.mObjectVsBroadPhaseLayerFilter = new Jolt.ObjectVsBroadPhaseLayerFilterTable( settings.mBroadPhaseLayerInterface, NUM_BROAD_PHASE_LAYERS, settings.mObjectLayerPairFilter, NUM_OBJECT_LAYERS );
 
-};
+}
 
 async function JoltPhysics() {
 
@@ -111,8 +111,8 @@ async function JoltPhysics() {
 		if ( shape === null ) return;
 
 		const body = mesh.isInstancedMesh
-							? createInstancedBody( mesh, mass, restitution, shape )
-							: createBody( mesh.position, mesh.quaternion, mass, restitution, shape );
+			? createInstancedBody( mesh, mass, restitution, shape )
+			: createBody( mesh.position, mesh.quaternion, mass, restitution, shape );
 
 		if ( mass > 0 ) {
 
@@ -175,8 +175,8 @@ async function JoltPhysics() {
 
 			const physics = mesh.userData.physics;
 
-			let shape = body.GetShape();
-			let body2 = createBody( position, { x: 0, y: 0, z: 0, w: 1 }, physics.mass, physics.restitution, shape );
+			const shape = body.GetShape();
+			const body2 = createBody( position, { x: 0, y: 0, z: 0, w: 1 }, physics.mass, physics.restitution, shape );
 
 			bodies[ index ] = body2;
 

+ 4 - 4
examples/jsm/physics/RapierPhysics.js

@@ -43,8 +43,8 @@ function getShape( geometry ) {
 
 		// if the buffer is non-indexed, generate an index buffer
 		const indices = geometry.getIndex() === null
-							? Uint32Array.from( Array( parseInt( vertices.length / 3 ) ).keys() )
-							: geometry.getIndex().array;
+			? Uint32Array.from( Array( parseInt( vertices.length / 3 ) ).keys() )
+			: geometry.getIndex().array;
 
 		return RAPIER.ColliderDesc.trimesh( vertices, indices );
 
@@ -105,8 +105,8 @@ async function RapierPhysics() {
 		shape.setRestitution( restitution );
 
 		const body = mesh.isInstancedMesh
-							? createInstancedBody( mesh, mass, shape )
-							: createBody( mesh.position, mesh.quaternion, mass, shape );
+			? createInstancedBody( mesh, mass, shape )
+			: createBody( mesh.position, mesh.quaternion, mass, shape );
 
 		if ( mass > 0 ) {
 

+ 2 - 2
examples/webgpu_animation_retargeting.html

@@ -85,7 +85,7 @@
 
 			const coloredVignette = screenUV.distance( .5 ).mix( hue( color( 0x0175ad ), time.mul( .1 ) ), hue( color( 0x02274f ), time.mul( .5 ) ) );
 			const lightSpeedEffect = lightSpeed( normalWorld ).clamp();
-			const lightSpeedSky = normalWorld.y.remapClamp( -.1, 1 ).mix( 0, lightSpeedEffect );
+			const lightSpeedSky = normalWorld.y.remapClamp( - .1, 1 ).mix( 0, lightSpeedEffect );
 			const composedBackground = blendDodge( coloredVignette, lightSpeedSky );
 
 			scene.backgroundNode = composedBackground;
@@ -164,7 +164,7 @@
 
 			function getSource( sourceModel ) {
 
-				const clip = sourceModel.animations[ 0 ]
+				const clip = sourceModel.animations[ 0 ];
 
 				const helper = new THREE.SkeletonHelper( sourceModel.scene );
 				helpers.add( helper );

+ 1 - 1
examples/webgpu_animation_retargeting_readyplayer.html

@@ -137,7 +137,7 @@
 
 			function getSource( sourceModel ) {
 
-				const clip = sourceModel.animations[ 0 ]
+				const clip = sourceModel.animations[ 0 ];
 
 				const helper = new THREE.SkeletonHelper( sourceModel );
 				const skeleton = new THREE.Skeleton( helper.bones );

+ 1 - 1
examples/webxr_vr_layers.html

@@ -307,7 +307,7 @@
 				// Init layers once in immersive mode and video is ready.
 				const useLayers = session &&
 					session.enabledFeatures !== undefined &&
-					session.enabledFeatures.includes('layers') &&
+					session.enabledFeatures.includes( 'layers' ) &&
 					XRMediaBinding !== undefined;
 
 				if ( ! useLayers ) {

+ 1 - 1
test/e2e/puppeteer.js

@@ -115,7 +115,7 @@ const exceptionList = [
 	'webgpu_compute_audio',
 	'webgpu_compute_texture',
 	'webgpu_compute_texture_pingpong',
-	"webgpu_compute_water",
+	'webgpu_compute_water',
 	'webgpu_materials',
 	'webgpu_sandbox',
 	'webgpu_video_panorama',

+ 1 - 0
test/unit/src/core/Object3D.tests.js

@@ -1317,6 +1317,7 @@ export default QUnit.module( 'Core', () => {
 
 		QUnit.test( 'clone', ( assert ) => {
 
+			/* eslint-disable prefer-const*/
 			let a;
 			const b = new Object3D();
 

粤ICP备19079148号