Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion editor/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@

navigator.serviceWorker.register( 'sw.js' );

} catch ( error ) {
} catch ( error ) { // eslint-disable-line no-unused-vars

}

Expand Down
4 changes: 2 additions & 2 deletions editor/js/Script.js
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ function Script( editor ) {

jsonlint.parse( string );

} catch ( error ) {
} catch ( error ) { // eslint-disable-line no-unused-vars

// ignore failed error recovery

Expand Down Expand Up @@ -486,7 +486,7 @@ function Script( editor ) {

} );

signals.materialChanged.add( function ( object, slot ) {
signals.materialChanged.add( function ( object/*, slot */ ) {

if ( object !== currentObject ) return;

Expand Down
2 changes: 1 addition & 1 deletion editor/js/Selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ class Selector {

// Cycle through objects if the first one is already selected

let index = objects.indexOf( editor.selected );
const index = objects.indexOf( editor.selected );

if ( index !== - 1 && index < objects.length - 1 ) {

Expand Down
4 changes: 2 additions & 2 deletions editor/js/Sidebar.Material.js
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@ function SidebarMaterial( editor ) {
materialUserData.dom.classList.add( 'success' );
materialUserData.dom.classList.remove( 'fail' );

} catch ( error ) {
} catch ( error ) { // eslint-disable-line no-unused-vars

materialUserData.dom.classList.remove( 'success' );
materialUserData.dom.classList.add( 'fail' );
Expand Down Expand Up @@ -439,7 +439,7 @@ function SidebarMaterial( editor ) {
output = JSON.stringify( output, null, '\t' );
output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );

} catch ( e ) {
} catch ( error ) { // eslint-disable-line no-unused-vars

output = JSON.stringify( output );

Expand Down
4 changes: 2 additions & 2 deletions editor/js/Sidebar.Object.js
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ function SidebarObject( editor ) {
objectUserData.dom.classList.add( 'success' );
objectUserData.dom.classList.remove( 'fail' );

} catch ( error ) {
} catch ( error ) { // eslint-disable-line no-unused-vars

objectUserData.dom.classList.remove( 'success' );
objectUserData.dom.classList.add( 'fail' );
Expand Down Expand Up @@ -415,7 +415,7 @@ function SidebarObject( editor ) {
output = JSON.stringify( output, null, '\t' );
output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );

} catch ( e ) {
} catch ( error ) { // eslint-disable-line no-unused-vars

output = JSON.stringify( output );

Expand Down
4 changes: 2 additions & 2 deletions editor/sw.js
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ self.addEventListener( 'install', async function () {

await cache.add( asset );

} catch {
} catch ( error ) { // eslint-disable-line no-unused-vars

console.warn( '[SW] Couldn\'t cache:', asset );

Expand Down Expand Up @@ -284,7 +284,7 @@ async function networkFirst( request ) {

return response;

} catch {
} catch ( error ) { // eslint-disable-line no-unused-vars

const cachedResponse = await caches.match( request );

Expand Down
6 changes: 5 additions & 1 deletion eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@ export default [
'**/3rdparty/**',
'**/shapefile.js',
'**/vendor/**',
'**/fuse/**'
'**/fuse/**',
'**/template/static/**',
]
},

Expand Down Expand Up @@ -107,6 +108,9 @@ export default [
'getter-return': 'off',
'no-async-promise-executor': 'off',
'no-empty': 'off',
'no-fallthrough': 'off',
'no-prototype-builtins': 'off',
'no-loss-of-precision': 'off',

// 'jsdoc/check-types': 'error',
'jsdoc/require-returns': 'off',
Expand Down
4 changes: 2 additions & 2 deletions examples/jsm/capabilities/WebGL.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ class WebGL {
const canvas = document.createElement( 'canvas' );
return !! ( window.WebGL2RenderingContext && canvas.getContext( 'webgl2' ) );

} catch ( e ) {
} catch ( e ) { // eslint-disable-line no-unused-vars

return false;

Expand All @@ -42,7 +42,7 @@ class WebGL {
ctx.drawingBufferColorSpace = colorSpace;
return ctx.drawingBufferColorSpace === colorSpace; // deepscan-disable-line SAME_OPERAND_VALUE

} catch ( e ) {
} catch ( e ) { // eslint-disable-line no-unused-vars

return false;

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/helpers/ViewHelper.js
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ class ViewHelper extends Object3D {

result = typeof OffscreenCanvas !== 'undefined' && ( new OffscreenCanvas( 1, 1 ).getContext( '2d' ) ) !== null;

} catch ( err ) {
} catch ( err ) { // eslint-disable-line no-unused-vars

// Ignore any errors

Expand Down
9 changes: 5 additions & 4 deletions examples/jsm/loaders/3DMLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ import {
SpotLight,
Sprite,
SpriteMaterial,
TextureLoader
TextureLoader,
EquirectangularReflectionMapping
} from 'three';

import { EXRLoader } from '../loaders/EXRLoader.js';
Expand Down Expand Up @@ -507,7 +508,7 @@ class Rhino3dmLoader extends Loader {

new EXRLoader().load( renderEnvironment.image, function ( texture ) {

texture.mapping = THREE.EquirectangularReflectionMapping;
texture.mapping = EquirectangularReflectionMapping;
mat.envMap = texture;

} );
Expand Down Expand Up @@ -697,7 +698,7 @@ class Rhino3dmLoader extends Loader {

geometry = loader.parse( obj.geometry );

if ( geometry.attributes.hasOwnProperty( 'color' ) ) {
if ( geometry.hasAttribute( 'color' ) ) {

material = new PointsMaterial( { vertexColors: true, sizeAttenuation: false, size: 2 } );

Expand Down Expand Up @@ -740,7 +741,7 @@ class Rhino3dmLoader extends Loader {
}


if ( geometry.attributes.hasOwnProperty( 'color' ) ) {
if ( geometry.hasAttribute( 'color' ) ) {

mat.vertexColors = true;

Expand Down
2 changes: 0 additions & 2 deletions examples/jsm/loaders/FBXLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -1615,11 +1615,9 @@ class GeometryParser {

case 'Mesh':
return this.parseMeshGeometry( relationships, geoNode, deformers );
break;

case 'NurbsCurve':
return this.parseNurbsGeometry( geoNode );
break;

}

Expand Down
1 change: 0 additions & 1 deletion examples/jsm/loaders/HDRLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -424,7 +424,6 @@ class HDRLoader extends DataTextureLoader {
default:

throw new Error( 'THREE.HDRLoader: Unsupported type: ' + this.type );
break;

}

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/loaders/LDrawLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,7 @@ class LDrawParsedCache {
const text = await fileLoader.loadAsync( subobjectURL );
return text;

} catch ( _ ) {
} catch ( _ ) { // eslint-disable-line no-unused-vars

continue;

Expand Down
4 changes: 1 addition & 3 deletions examples/jsm/loaders/TDSLoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -684,11 +684,9 @@ class TDSLoader extends Loader {

case INT_PERCENTAGE:
return ( subChunk.readShort( ) / 100 );
break;

case FLOAT_PERCENTAGE:
return subChunk.readFloat( );
break;

default:
this.debugMessage( ' Unknown percentage chunk: ' + subChunk.hexId );
Expand Down Expand Up @@ -780,7 +778,7 @@ class Chunk {
this.position += next.size;
return next;

} catch ( e ) {
} catch ( e ) { // eslint-disable-line no-unused-vars
Copy link
Collaborator

@gkjohnson gkjohnson Dec 9, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One option is to change this setting so that unused variables are okay as caught errors (or optionally function arguments, too), for example. See the options for the setting.

The setting would look like so:

'no-unused-vars': [ 'error', {
	caughtErrors: 'none',
} ]


this.debugMessage( 'Unable to read chunk at ' + this.position );
return null;
Expand Down
2 changes: 0 additions & 2 deletions examples/jsm/loaders/TGALoader.js
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,6 @@ class TGALoader extends DataTextureLoader {

default:
throw new Error( 'THREE.TGALoader: Format not supported.' );
break;

}

Expand All @@ -415,7 +414,6 @@ class TGALoader extends DataTextureLoader {

default:
throw new Error( 'THREE.TGALoader: Format not supported.' );
break;

}

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/loaders/usd/USDCParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import {

class USDCParser {

parse( buffer ) {
parse( /* buffer */ ) {

// TODO

Expand Down
1 change: 0 additions & 1 deletion examples/jsm/misc/Volume.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,6 @@ class Volume {
case 'uint64' :
case 'uint64_t' :
throw new Error( 'Error in Volume constructor : this type is not supported in JavaScript' );
break;
case 'Float32' :
case 'float32' :
case 'float' :
Expand Down
1 change: 0 additions & 1 deletion examples/jsm/misc/VolumeSlice.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ class VolumeSlice {

index = value;
slice.geometryNeedsUpdate = true;
return index;

}
} );
Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/objects/MarchingCubes.js
Original file line number Diff line number Diff line change
Expand Up @@ -560,7 +560,7 @@ class MarchingCubes extends Mesh {
)
: new Color( colors );

} catch ( err ) {
} catch ( err ) { // eslint-disable-line no-unused-vars

ballColor = new Color( ballx, bally, ballz );

Expand Down
2 changes: 1 addition & 1 deletion examples/jsm/physics/AmmoPhysics.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ async function AmmoPhysics() {

}

const AmmoLib = await Ammo(); // eslint-disable-line no-undef
const AmmoLib = await Ammo();

const frameRate = 60;

Expand Down
2 changes: 0 additions & 2 deletions examples/svg_sandbox.html
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,6 @@

function render() {

const time = Date.now() * 0.0002;

group.rotation.x += 0.01;

controls.update();
Expand Down
24 changes: 12 additions & 12 deletions examples/webgl_gpgpu_water.html
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
let meshRay;
let gpuCompute;
let heightmapVariable;
let smoothShader;
// let smoothShader;
let readWaterLevelShader;
let readWaterLevelRenderTarget;
let readWaterLevelImage;
Expand Down Expand Up @@ -362,7 +362,7 @@
if ( error !== null ) console.error( error );

// Create compute shader to smooth the water surface and velocity
smoothShader = gpuCompute.createShaderMaterial( document.getElementById( 'smoothFragmentShader' ).textContent, { smoothTexture: { value: null } } );
//smoothShader = gpuCompute.createShaderMaterial( document.getElementById( 'smoothFragmentShader' ).textContent, { smoothTexture: { value: null } } );

// Create compute shader to read water level
readWaterLevelShader = gpuCompute.createShaderMaterial( document.getElementById( 'readWaterLevelFragmentShader' ).textContent, {
Expand Down Expand Up @@ -460,22 +460,22 @@

}

function smoothWater() {
// function smoothWater() {

const currentRenderTarget = gpuCompute.getCurrentRenderTarget( heightmapVariable );
const alternateRenderTarget = gpuCompute.getAlternateRenderTarget( heightmapVariable );
// const currentRenderTarget = gpuCompute.getCurrentRenderTarget( heightmapVariable );
// const alternateRenderTarget = gpuCompute.getAlternateRenderTarget( heightmapVariable );

for ( let i = 0; i < 10; i ++ ) {
// for ( let i = 0; i < 10; i ++ ) {

smoothShader.uniforms[ 'smoothTexture' ].value = currentRenderTarget.texture;
gpuCompute.doRenderTarget( smoothShader, alternateRenderTarget );
// smoothShader.uniforms[ 'smoothTexture' ].value = currentRenderTarget.texture;
// gpuCompute.doRenderTarget( smoothShader, alternateRenderTarget );

smoothShader.uniforms[ 'smoothTexture' ].value = alternateRenderTarget.texture;
gpuCompute.doRenderTarget( smoothShader, currentRenderTarget );
// smoothShader.uniforms[ 'smoothTexture' ].value = alternateRenderTarget.texture;
// gpuCompute.doRenderTarget( smoothShader, currentRenderTarget );

}
// }

}
// }

function createducks() {

Expand Down
3 changes: 1 addition & 2 deletions examples/webgl_multiple_views.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

let scene, renderer;

let mouseX = 0, mouseY = 0;
let mouseX = 0;

let windowWidth, windowHeight;

Expand Down Expand Up @@ -222,7 +222,6 @@
function onDocumentMouseMove( event ) {

mouseX = ( event.clientX - windowWidth / 2 );
mouseY = ( event.clientY - windowHeight / 2 );

}

Expand Down
4 changes: 1 addition & 3 deletions examples/webgpu_camera_logarithmicdepthbuffer.html
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
let zoompos = - 100, minzoomspeed = .015;
let zoomspeed = minzoomspeed;

let container, border;
let border;
const objects = {};

// Generate a number of text labels, from 1µm in size up to 100,000,000 light years
Expand Down Expand Up @@ -128,8 +128,6 @@

async function init() {

container = document.getElementById( 'container' );

const loader = new FontLoader();
const font = await loader.loadAsync( 'fonts/helvetiker_regular.typeface.json' );

Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_compute_reduce.html
Original file line number Diff line number Diff line change
Expand Up @@ -929,7 +929,7 @@ <h3 id="panel-title" style="flex: 0 0 auto;">Subgroup Reduction Explanation</h3>

const scene = new THREE.Scene();

const array = new Uint32Array( Array.from( { length: size }, ( _, i ) => {
const array = new Uint32Array( Array.from( { length: size }, () => {

return 1;

Expand Down
2 changes: 1 addition & 1 deletion examples/webgpu_instance_uniform.html
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<script type="module">

import * as THREE from 'three/webgpu';
import { nodeObject, uniform, cubeTexture } from 'three/tsl';
import { uniform, cubeTexture } from 'three/tsl';

import { OrbitControls } from 'three/addons/controls/OrbitControls.js';

Expand Down
Loading