Skip to content

Commit 31b62a3

Browse files
committed
Addons: auto-fix linting problems (mrdoob#27457)
Brings 93 problems (60 errors, 33 warnings) down to 37 problems (4 errors, 33 warnings).
1 parent f5f1420 commit 31b62a3

File tree

17 files changed

+53
-48
lines changed

17 files changed

+53
-48
lines changed

examples/jsm/controls/OrbitControls.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -373,14 +373,14 @@ class OrbitControls extends EventDispatcher {
373373
}
374374

375375
} else if ( scope.object.isOrthographicCamera ) {
376-
376+
377377
zoomChanged = scale !== 1;
378378

379379
if ( zoomChanged ) {
380380

381381
scope.object.zoom = Math.max( scope.minZoom, Math.min( scope.maxZoom, scope.object.zoom / scale ) );
382382
scope.object.updateProjectionMatrix();
383-
383+
384384
}
385385

386386
}

examples/jsm/exporters/USDZExporter.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
import {
2-
NoColorSpace,
3-
DoubleSide,
2+
NoColorSpace,
3+
DoubleSide,
44
} from 'three';
55

66
import {
7-
strToU8,
8-
zipSync,
7+
strToU8,
8+
zipSync,
99
} from '../libs/fflate.module.js';
1010

1111
import { decompress } from './../utils/TextureUtils.js';

examples/jsm/helpers/TextureHelper.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ function createSliceGeometry( texture, width, height, depth ) {
216216
const w = sliceCount === 1
217217
? 1
218218
: texture.isDataArrayTexture || texture.isCompressedArrayTexture
219-
? i
220-
: i / ( sliceCount - 1 );
219+
? i
220+
: i / ( sliceCount - 1 );
221221

222222
uvw.setXYZ( j, u, v, w );
223223

@@ -234,4 +234,4 @@ function createSliceGeometry( texture, width, height, depth ) {
234234

235235
}
236236

237-
export { TextureHelper };
237+
export { TextureHelper };

examples/jsm/loaders/3DMLoader.js

Lines changed: 25 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ class Rhino3dmLoader extends Loader {
235235

236236
//console.log(material)
237237

238-
let mat = new MeshPhysicalMaterial( {
238+
const mat = new MeshPhysicalMaterial( {
239239

240240
color: new Color( material.diffuseColor.r / 255.0, material.diffuseColor.g / 255.0, material.diffuseColor.b / 255.0 ),
241241
emissive: new Color( material.emissionColor.r, material.emissionColor.g, material.emissionColor.b ),
@@ -310,7 +310,7 @@ class Rhino3dmLoader extends Loader {
310310
mat.envMap = map;
311311

312312
break;
313-
313+
314314
case 'Opacity':
315315

316316
mat.transmissionMap = map;
@@ -330,7 +330,7 @@ class Rhino3dmLoader extends Loader {
330330
mat.transparent = true;
331331

332332
break;
333-
333+
334334
case 'PBR_AmbientOcclusion':
335335

336336
mat.aoMap = map;
@@ -461,7 +461,7 @@ class Rhino3dmLoader extends Loader {
461461
object.userData.settings[ 'renderSettings' ] = data.renderSettings;
462462
object.userData[ 'objectType' ] = 'File3dm';
463463
object.userData[ 'materials' ] = null;
464-
464+
465465
object.name = this.url;
466466

467467
let objects = data.objects;
@@ -490,7 +490,8 @@ class Rhino3dmLoader extends Loader {
490490

491491
let matId;
492492

493-
switch( attributes.materialSource.name ) {
493+
switch ( attributes.materialSource.name ) {
494+
494495
case 'ObjectMaterialSource_MaterialFromLayer':
495496
//check layer index
496497
if ( attributes.layerIndex >= 0 ) {
@@ -1129,7 +1130,7 @@ function Rhino3dmWorker() {
11291130

11301131
const _material = doc.materials().get( i );
11311132

1132-
let material = extractProperties( _material );
1133+
const material = extractProperties( _material );
11331134

11341135
const textures = [];
11351136

@@ -1232,42 +1233,42 @@ function Rhino3dmWorker() {
12321233
// Handle Render Environments for Material Environment
12331234

12341235
// get the id of the active render environment skylight, which we'll use for environment texture
1235-
const reflectionId = doc.settings().renderSettings().renderEnvironments.reflectionId
1236+
const reflectionId = doc.settings().renderSettings().renderEnvironments.reflectionId;
12361237

1237-
const rc = doc.renderContent()
1238+
const rc = doc.renderContent();
12381239

1239-
let renderEnvironment = null
1240+
let renderEnvironment = null;
12401241

1241-
for( let i = 0; i < rc.count; i++ ) {
1242+
for ( let i = 0; i < rc.count; i ++ ) {
12421243

1243-
const content = rc.get(i)
1244+
const content = rc.get( i );
12441245

1245-
switch( content.kind ) {
1246+
switch ( content.kind ) {
12461247

12471248
case 'environment':
12481249

1249-
const id = content.id
1250+
const id = content.id;
12501251

12511252
// there could be multiple render environments in a 3dm file
12521253
if ( id !== reflectionId ) break;
12531254

1254-
const renderTexture = content.findChild( 'texture' )
1255-
const fileName = renderTexture.fileName
1255+
const renderTexture = content.findChild( 'texture' );
1256+
const fileName = renderTexture.fileName;
12561257

12571258
for ( let j = 0; j < doc.embeddedFiles().count; j ++ ) {
12581259

1259-
const _fileName = doc.embeddedFiles().get( j ).fileName
1260+
const _fileName = doc.embeddedFiles().get( j ).fileName;
12601261

12611262
if ( fileName === _fileName ) {
12621263

1263-
const background = doc.getEmbeddedFileAsBase64( fileName )
1264-
const backgroundImage = 'data:image/png;base64,' + background
1264+
const background = doc.getEmbeddedFileAsBase64( fileName );
1265+
const backgroundImage = 'data:image/png;base64,' + background;
12651266
renderEnvironment = { type: 'renderEnvironment', image: backgroundImage, name: fileName };
12661267

12671268
}
12681269

12691270
}
1270-
1271+
12711272
break;
12721273

12731274
}
@@ -1307,7 +1308,7 @@ function Rhino3dmWorker() {
13071308
renderEnvironments: extractProperties( doc.settings().renderSettings().renderEnvironments ),
13081309
postEffects: extractProperties( doc.settings().renderSettings().postEffects ),
13091310

1310-
}
1311+
};
13111312

13121313
doc.delete();
13131314

@@ -1317,7 +1318,7 @@ function Rhino3dmWorker() {
13171318

13181319
function extractTextures( m, tTypes, d ) {
13191320

1320-
const textures = []
1321+
const textures = [];
13211322

13221323
for ( let i = 0; i < tTypes.length; i ++ ) {
13231324

@@ -1584,13 +1585,13 @@ function Rhino3dmWorker() {
15841585
if ( _attributes.decals().count > 0 ) {
15851586

15861587
self.postMessage( { type: 'warning', id: taskID, data: {
1587-
message: `THREE.3DMLoader: No conversion exists for the decals associated with this object.`,
1588+
message: 'THREE.3DMLoader: No conversion exists for the decals associated with this object.',
15881589
type: 'no conversion',
15891590
guid: _attributes.id
15901591
}
1591-
1592+
15921593
} );
1593-
1594+
15941595
}
15951596

15961597
attributes.drawColor = _attributes.drawColor( doc );

examples/jsm/loaders/DDSLoader.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,6 +221,7 @@ class DDSLoader extends CompressedTextureLoader {
221221
}
222222

223223
}
224+
224225
break;
225226

226227
default:

examples/jsm/loaders/KTX2Loader.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -865,8 +865,8 @@ async function createRawTexture( container ) {
865865
if ( UNCOMPRESSED_FORMATS.has( FORMAT_MAP[ vkFormat ] ) ) {
866866

867867
texture = container.pixelDepth === 0
868-
? new DataTexture( mipmaps[ 0 ].data, container.pixelWidth, container.pixelHeight )
869-
: new Data3DTexture( mipmaps[ 0 ].data, container.pixelWidth, container.pixelHeight, container.pixelDepth );
868+
? new DataTexture( mipmaps[ 0 ].data, container.pixelWidth, container.pixelHeight )
869+
: new Data3DTexture( mipmaps[ 0 ].data, container.pixelWidth, container.pixelHeight, container.pixelDepth );
870870

871871
} else {
872872

examples/jsm/loaders/LUTImageLoader.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,10 @@ import {
1212
export class LUTImageLoader extends Loader {
1313

1414
constructor( flipVertical = false ) {
15-
//The NeutralLUT.png has green at the bottom for Unreal ang green at the top for Unity URP Color Lookup
15+
16+
//The NeutralLUT.png has green at the bottom for Unreal ang green at the top for Unity URP Color Lookup
1617
//post-processing. If you're using lut image strips from a Unity pipeline then pass true to the constructor
17-
18+
1819
super();
1920

2021
this.flip = flipVertical;

examples/jsm/loaders/MaterialXLoader.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -647,7 +647,7 @@ class MaterialXNode {
647647
let emissiveNode = null;
648648

649649
if ( inputs.emission ) emissiveNode = inputs.emission;
650-
if ( inputs.emissionColor ) {
650+
if ( inputs.emissionColor ) {
651651

652652
emissiveNode = emissiveNode ? mul( emissiveNode, inputs.emissionColor ) : emissiveNode;
653653

examples/jsm/nodes/lighting/AmbientLightNode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ class AmbientLightNode extends AnalyticLightNode {
1414

1515
setup( { context } ) {
1616

17-
context.irradiance.addAssign(this.colorNode );
17+
context.irradiance.addAssign( this.colorNode );
1818

1919
}
2020

examples/jsm/nodes/lighting/LightingContextNode.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class LightingContextNode extends ContextNode {
3939
ambientOcclusion: float( 1 ).temp( 'ambientOcclusion' ),
4040
reflectedLight,
4141
backdrop: backdropNode,
42-
backdropAlpha : backdropAlphaNode
42+
backdropAlpha: backdropAlphaNode
4343
};
4444

4545
return context;

0 commit comments

Comments
 (0)