Skip to content

Commit

Permalink
Merge pull request #20863 from gkjohnson/lint-fix-jsm
Browse files Browse the repository at this point in the history
Linting: Run lint fix on js and jsm files
  • Loading branch information
mrdoob committed Dec 10, 2020
2 parents b5d8988 + 9f07baf commit 2e26acf
Show file tree
Hide file tree
Showing 85 changed files with 633 additions and 633 deletions.
2 changes: 1 addition & 1 deletion examples/js/exporters/GLTFExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1700,7 +1700,7 @@ THREE.GLTFExporter.prototype = {
joints.push( nodeMap.get( skeleton.bones[ i ] ) );

temporaryBoneInverse.copy( skeleton.boneInverses[ i ] );

temporaryBoneInverse.multiply( object.bindMatrix ).toArray( inverseBindMatrices, i * 16 );

}
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/exporters/GLTFExporter.js
Original file line number Diff line number Diff line change
Expand Up @@ -1724,7 +1724,7 @@ GLTFExporter.prototype = {
joints.push( nodeMap.get( skeleton.bones[ i ] ) );

temporaryBoneInverse.copy( skeleton.boneInverses[ i ] );

temporaryBoneInverse.multiply( object.bindMatrix ).toArray( inverseBindMatrices, i * 16 );

}
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/loaders/3DMLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ Rhino3dmLoader.prototype = Object.assign( Object.create( Loader.prototype ), {

} else if ( geometry.isLinearLight ) {

console.warn( `THREE.3DMLoader: No conversion exists for linear lights.` );
console.warn( 'THREE.3DMLoader: No conversion exists for linear lights.' );

return;

Expand Down
16 changes: 8 additions & 8 deletions examples/jsm/loaders/NodeMaterialLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ var NodeMaterialLoaderUtils = {

recursive = recursive !== undefined ? recursive : true;

if ( typeof uuid === "object" ) uuid = uuid.uuid;
if ( typeof uuid === 'object' ) uuid = uuid.uuid;

if ( typeof object === "object" ) {
if ( typeof object === 'object' ) {

var keys = Object.keys( object );

Expand Down Expand Up @@ -116,7 +116,7 @@ Object.assign( NodeMaterialLoader.prototype, {

if ( ! object ) {

console.warn( "Node \"" + uuid + "\" not found." );
console.warn( 'Node "' + uuid + '" not found.' );

}

Expand All @@ -128,12 +128,12 @@ Object.assign( NodeMaterialLoader.prototype, {

switch ( typeof json ) {

case "boolean":
case "number":
case 'boolean':
case 'number':

return json;

case "string":
case 'string':

if ( /^\w{8}-\w{4}-\w{4}-\w{4}-\w{12}$/i.test( json ) || this.library[ json ] ) {

Expand All @@ -157,7 +157,7 @@ Object.assign( NodeMaterialLoader.prototype, {

for ( var prop in json ) {

if ( prop === "uuid" ) continue;
if ( prop === 'uuid' ) continue;

json[ prop ] = this.resolve( json[ prop ] );

Expand All @@ -179,7 +179,7 @@ Object.assign( NodeMaterialLoader.prototype, {

node = json.nodes[ uuid ];

object = new Nodes[ node.nodeType + "Node" ]();
object = new Nodes[ node.nodeType + 'Node' ]();

if ( node.name ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/loaders/OBJLoader2.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ OBJLoader2.prototype = Object.assign( Object.create( Loader.prototype ), {
this.setCallbackOnMeshAlter( onMeshAlter );
const fileLoaderOnLoad = function ( content ) {

scope.parser.callbacks.onLoad( scope.parse( content ), "OBJLoader2#load: Parsing completed" );
scope.parser.callbacks.onLoad( scope.parse( content ), 'OBJLoader2#load: Parsing completed' );

};

Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/loaders/OBJLoader2Parallel.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ OBJLoader2Parallel.prototype = Object.assign( Object.create( OBJLoader2.prototyp

if ( jsmWorkerUrl === undefined || jsmWorkerUrl === null ) {

throw "The url to the jsm worker is not valid. Aborting...";
throw 'The url to the jsm worker is not valid. Aborting...';

}

Expand Down Expand Up @@ -165,7 +165,7 @@ OBJLoader2Parallel.prototype = Object.assign( Object.create( OBJLoader2.prototyp

if ( this.parser.callbacks.onLoad === this.parser._onLoad ) {

throw "No callback other than the default callback was provided! Aborting!";
throw 'No callback other than the default callback was provided! Aborting!';

}

Expand Down
20 changes: 10 additions & 10 deletions examples/jsm/loaders/lwo/IFFParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ IFFParser.prototype = {

if ( topForm !== 'FORM' ) {

console.warn( "LWOLoader: Top-level FORM missing." );
console.warn( 'LWOLoader: Top-level FORM missing.' );
return;

}
Expand Down Expand Up @@ -577,7 +577,7 @@ IFFParser.prototype = {

var texture = {
index: this.reader.getUint32(),
fileName: ""
fileName: ''
};

// seach STIL block
Expand Down Expand Up @@ -1137,27 +1137,27 @@ Debugger.prototype = {
switch ( this.node ) {

case 0:
nodeType = "FORM";
nodeType = 'FORM';
break;

case 1:
nodeType = "CHK";
nodeType = 'CHK';
break;

case 2:
nodeType = "S-CHK";
nodeType = 'S-CHK';
break;

}

console.log(
"| ".repeat( this.depth ) +
'| '.repeat( this.depth ) +
nodeType,
this.nodeID,
`( ${this.offset} ) -> ( ${this.dataOffset + this.length} )`,
( ( this.node == 0 ) ? " {" : "" ),
( ( this.skipped ) ? "SKIPPED" : "" ),
( ( this.node == 0 && this.skipped ) ? "}" : "" )
( ( this.node == 0 ) ? ' {' : '' ),
( ( this.skipped ) ? 'SKIPPED' : '' ),
( ( this.node == 0 && this.skipped ) ? '}' : '' )
);

if ( this.node == 0 && ! this.skipped ) {
Expand All @@ -1180,7 +1180,7 @@ Debugger.prototype = {
if ( this.offset >= this.formList[ i ] ) {

this.depth -= 1;
console.log( "| ".repeat( this.depth ) + "}" );
console.log( '| '.repeat( this.depth ) + '}' );
this.formList.splice( - 1, 1 );

}
Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/loaders/obj2/OBJLoader2Parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ OBJLoader2Parser.prototype = {

_onLoad: function ( object3d, message ) {

console.log( "You reached parser default onLoad callback: " + message );
console.log( 'You reached parser default onLoad callback: ' + message );

},

Expand Down Expand Up @@ -629,7 +629,7 @@ OBJLoader2Parser.prototype = {
let smoothingGroupInt = parseInt( smoothingGroup );
if ( isNaN( smoothingGroupInt ) ) {

smoothingGroupInt = smoothingGroup === "off" ? 0 : 1;
smoothingGroupInt = smoothingGroup === 'off' ? 0 : 1;

}

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/loaders/obj2/shared/MaterialHandler.js
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ MaterialHandler.prototype = {
if ( materialCloneInstructions !== undefined && materialCloneInstructions !== null ) {

let materialNameOrg = materialCloneInstructions.materialNameOrg;
materialNameOrg = ( materialNameOrg !== undefined && materialNameOrg !== null ) ? materialNameOrg : "";
materialNameOrg = ( materialNameOrg !== undefined && materialNameOrg !== null ) ? materialNameOrg : '';
const materialOrg = this.materials[ materialNameOrg ];
if ( materialOrg ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/loaders/obj2/utils/CodeSerializer.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const CodeSerializer = {
} else if ( typeof objectPart === 'object' ) {

console.log( 'Omitting object "' + funcInstructions.getName() + '" and replace it with empty object.' );
funcInstructions.setCode( "{}" );
funcInstructions.setCode( '{}' );

} else {

Expand Down
12 changes: 6 additions & 6 deletions examples/jsm/loaders/obj2/worker/main/WorkerExecutionSupport.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,9 +119,9 @@ CodeBuilderInstructions.prototype = {
const WorkerExecutionSupport = function () {

// check worker support first
if ( window.Worker === undefined ) throw "This browser does not support web workers!";
if ( window.Blob === undefined ) throw "This browser does not support Blob!";
if ( typeof window.URL.createObjectURL !== 'function' ) throw "This browser does not support Object creation from URL!";
if ( window.Worker === undefined ) throw 'This browser does not support web workers!';
if ( window.Blob === undefined ) throw 'This browser does not support Blob!';
if ( typeof window.URL.createObjectURL !== 'function' ) throw 'This browser does not support Object creation from URL!';

this._reset();

Expand Down Expand Up @@ -296,7 +296,7 @@ WorkerExecutionSupport.prototype = {

try {

const worker = new Worker( codeBuilderInstructions.jsmWorkerUrl.href, { type: "module" } );
const worker = new Worker( codeBuilderInstructions.jsmWorkerUrl.href, { type: 'module' } );
this._configureWorkerCommunication( worker, true, codeBuilderInstructions.defaultGeometryType, timeLabel );

} catch ( e ) {
Expand All @@ -305,7 +305,7 @@ WorkerExecutionSupport.prototype = {
// Chrome throws this exception, but Firefox currently does not complain, but can't execute the worker afterwards
if ( e instanceof TypeError || e instanceof SyntaxError ) {

console.error( "Modules are not supported in workers." );
console.error( 'Modules are not supported in workers.' );

}

Expand Down Expand Up @@ -426,7 +426,7 @@ WorkerExecutionSupport.prototype = {
_receiveWorkerMessage: function ( event ) {

// fast-fail in case of error
if ( event.type === "error" ) {
if ( event.type === 'error' ) {

console.error( event );
return;
Expand Down
20 changes: 10 additions & 10 deletions examples/jsm/nodes/accessors/CameraNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,22 @@ function CameraNode( scope, camera ) {
CameraNode.Nodes = ( function () {

var depthColor = new FunctionNode( [
"float depthColor( float mNear, float mFar ) {",
'float depthColor( float mNear, float mFar ) {',

" #ifdef USE_LOGDEPTHBUF_EXT",
' #ifdef USE_LOGDEPTHBUF_EXT',

" float depth = gl_FragDepthEXT / gl_FragCoord.w;",
' float depth = gl_FragDepthEXT / gl_FragCoord.w;',

" #else",
' #else',

" float depth = gl_FragCoord.z / gl_FragCoord.w;",
' float depth = gl_FragCoord.z / gl_FragCoord.w;',

" #endif",
' #endif',

" return 1.0 - smoothstep( mNear, mFar, depth );",
' return 1.0 - smoothstep( mNear, mFar, depth );',

"}"
].join( "\n" ) );
'}'
].join( '\n' ) );

return {
depthColor: depthColor
Expand All @@ -44,7 +44,7 @@ CameraNode.TO_VERTEX = 'toVertex';

CameraNode.prototype = Object.create( TempNode.prototype );
CameraNode.prototype.constructor = CameraNode;
CameraNode.prototype.nodeType = "Camera";
CameraNode.prototype.nodeType = 'Camera';

CameraNode.prototype.setCamera = function ( camera ) {

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/nodes/accessors/ColorsNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ function ColorsNode( index ) {

ColorsNode.prototype = Object.create( TempNode.prototype );
ColorsNode.prototype.constructor = ColorsNode;
ColorsNode.prototype.nodeType = "Colors";
ColorsNode.prototype.nodeType = 'Colors';

ColorsNode.prototype.generate = function ( builder, output ) {

Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/nodes/accessors/LightNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LightNode.TOTAL = 'total';

LightNode.prototype = Object.create( TempNode.prototype );
LightNode.prototype.constructor = LightNode;
LightNode.prototype.nodeType = "Light";
LightNode.prototype.nodeType = 'Light';

LightNode.prototype.generate = function ( builder, output ) {

Expand All @@ -22,7 +22,7 @@ LightNode.prototype.generate = function ( builder, output ) {

} else {

console.warn( "THREE.LightNode is only compatible in \"light\" channel." );
console.warn( 'THREE.LightNode is only compatible in "light" channel.' );

return builder.format( 'vec3( 0.0 )', this.type, output );

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/nodes/accessors/NormalNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ NormalNode.VIEW = 'view';

NormalNode.prototype = Object.create( TempNode.prototype );
NormalNode.prototype.constructor = NormalNode;
NormalNode.prototype.nodeType = "Normal";
NormalNode.prototype.nodeType = 'Normal';

NormalNode.prototype.getShared = function () {

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/nodes/accessors/PositionNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ PositionNode.PROJECTION = 'projection';

PositionNode.prototype = Object.create( TempNode.prototype );
PositionNode.prototype.constructor = PositionNode;
PositionNode.prototype.nodeType = "Position";
PositionNode.prototype.nodeType = 'Position';

PositionNode.prototype.getType = function ( ) {

Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/nodes/accessors/ReflectNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ReflectNode.VECTOR = 'vector';

ReflectNode.prototype = Object.create( TempNode.prototype );
ReflectNode.prototype.constructor = ReflectNode;
ReflectNode.prototype.nodeType = "Reflect";
ReflectNode.prototype.nodeType = 'Reflect';

ReflectNode.prototype.getUnique = function ( builder ) {

Expand Down Expand Up @@ -128,7 +128,7 @@ ReflectNode.prototype.generate = function ( builder, output ) {

} else {

console.warn( "THREE.ReflectNode is not compatible with " + builder.shader + " shader." );
console.warn( 'THREE.ReflectNode is not compatible with ' + builder.shader + ' shader.' );

return builder.format( 'vec3( 0.0 )', this.type, output );

Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/nodes/accessors/ResolutionNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ function ResolutionNode() {

ResolutionNode.prototype = Object.create( Vector2Node.prototype );
ResolutionNode.prototype.constructor = ResolutionNode;
ResolutionNode.prototype.nodeType = "Resolution";
ResolutionNode.prototype.nodeType = 'Resolution';

ResolutionNode.prototype.updateFrame = function ( frame ) {

Expand All @@ -27,7 +27,7 @@ ResolutionNode.prototype.updateFrame = function ( frame ) {

} else {

console.warn( "ResolutionNode need a renderer in NodeFrame" );
console.warn( 'ResolutionNode need a renderer in NodeFrame' );

}

Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/nodes/accessors/ScreenUVNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function ScreenUVNode( resolution ) {

ScreenUVNode.prototype = Object.create( TempNode.prototype );
ScreenUVNode.prototype.constructor = ScreenUVNode;
ScreenUVNode.prototype.nodeType = "ScreenUV";
ScreenUVNode.prototype.nodeType = 'ScreenUV';

ScreenUVNode.prototype.generate = function ( builder, output ) {

Expand All @@ -23,7 +23,7 @@ ScreenUVNode.prototype.generate = function ( builder, output ) {

} else {

console.warn( "THREE.ScreenUVNode is not compatible with " + builder.shader + " shader." );
console.warn( 'THREE.ScreenUVNode is not compatible with ' + builder.shader + ' shader.' );

result = 'vec2( 0.0 )';

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/nodes/accessors/UVNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ function UVNode( index ) {

UVNode.prototype = Object.create( TempNode.prototype );
UVNode.prototype.constructor = UVNode;
UVNode.prototype.nodeType = "UV";
UVNode.prototype.nodeType = 'UV';

UVNode.prototype.generate = function ( builder, output ) {

Expand Down

0 comments on commit 2e26acf

Please sign in to comment.