Skip to content

Commit

Permalink
Eslint: Avoid relying on unsafe == and != js behavior
Browse files Browse the repository at this point in the history
  • Loading branch information
Samuel Rigaud committed Dec 9, 2024
1 parent 1fc010c commit 8239157
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,9 @@
],
"no-duplicate-imports": [
"error"
],
"eqeqeq": [
"error"
]
}
}
4 changes: 2 additions & 2 deletions src/nodes/accessors/InstanceNode.js
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ class InstanceNode extends Node {

update( /*frame*/ ) {

if ( this.instanceMatrix.usage !== DynamicDrawUsage && this.buffer != null && this.instanceMatrix.version !== this.buffer.version ) {
if ( this.instanceMatrix.usage !== DynamicDrawUsage && this.buffer !== null && this.instanceMatrix.version !== this.buffer.version ) {

this.buffer.version = this.instanceMatrix.version;

}

if ( this.instanceColor && this.instanceColor.usage !== DynamicDrawUsage && this.bufferColor != null && this.instanceColor.version !== this.bufferColor.version ) {
if ( this.instanceColor && this.instanceColor.usage !== DynamicDrawUsage && this.bufferColor !== null && this.instanceColor.version !== this.bufferColor.version ) {

this.bufferColor.version = this.instanceColor.version;

Expand Down
2 changes: 1 addition & 1 deletion src/nodes/functions/PhysicalLightingModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ const viewportFrontSideTexture = /*@__PURE__*/ viewportMipTexture();

const getTransmissionSample = /*@__PURE__*/ Fn( ( [ fragCoord, roughness, ior ], { material } ) => {

const vTexture = material.side == BackSide ? viewportBackSideTexture : viewportFrontSideTexture;
const vTexture = material.side === BackSide ? viewportBackSideTexture : viewportFrontSideTexture;

const transmissionSample = vTexture.sample( fragCoord );
//const transmissionSample = viewportMipTexture( fragCoord );
Expand Down
2 changes: 1 addition & 1 deletion src/renderers/webgpu/utils/WebGPUAttributeUtils.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,7 @@ class WebGPUAttributeUtils {

let format;

if ( itemSize == 1 ) {
if ( itemSize === 1 ) {

format = typeArraysToVertexFormatPrefixForItemSize1.get( ArrayType );

Expand Down
2 changes: 1 addition & 1 deletion src/renderers/webxr/WebXRDepthSensing.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ class WebXRDepthSensing {
const texProps = renderer.properties.get( texture );
texProps.__webglTexture = depthData.texture;

if ( ( depthData.depthNear != renderState.depthNear ) || ( depthData.depthFar != renderState.depthFar ) ) {
if ( ( depthData.depthNear !== renderState.depthNear ) || ( depthData.depthFar !== renderState.depthFar ) ) {

this.depthNear = depthData.depthNear;
this.depthFar = depthData.depthFar;
Expand Down

0 comments on commit 8239157

Please sign in to comment.