瀏覽代碼

Global: Clean up. (#32519)

Michael Herzog 1 月之前
父節點
當前提交
5aea7c6768
共有 100 個文件被更改,包括 467 次插入482 次删除
  1. 1 1
      editor/index.html
  2. 2 2
      editor/js/Script.js
  3. 1 1
      editor/js/Selector.js
  4. 2 2
      editor/js/Sidebar.Material.js
  5. 2 2
      editor/js/Sidebar.Object.js
  6. 2 2
      editor/sw.js
  7. 5 1
      eslint.config.js
  8. 2 2
      examples/jsm/capabilities/WebGL.js
  9. 1 1
      examples/jsm/helpers/ViewHelper.js
  10. 5 4
      examples/jsm/loaders/3DMLoader.js
  11. 0 2
      examples/jsm/loaders/FBXLoader.js
  12. 0 1
      examples/jsm/loaders/HDRLoader.js
  13. 1 1
      examples/jsm/loaders/LDrawLoader.js
  14. 1 3
      examples/jsm/loaders/TDSLoader.js
  15. 0 2
      examples/jsm/loaders/TGALoader.js
  16. 1 1
      examples/jsm/loaders/usd/USDCParser.js
  17. 0 1
      examples/jsm/misc/Volume.js
  18. 0 1
      examples/jsm/misc/VolumeSlice.js
  19. 1 1
      examples/jsm/objects/MarchingCubes.js
  20. 1 1
      examples/jsm/physics/AmmoPhysics.js
  21. 0 2
      examples/svg_sandbox.html
  22. 12 12
      examples/webgl_gpgpu_water.html
  23. 1 2
      examples/webgl_multiple_views.html
  24. 1 3
      examples/webgpu_camera_logarithmicdepthbuffer.html
  25. 1 1
      examples/webgpu_compute_reduce.html
  26. 1 1
      examples/webgpu_instance_uniform.html
  27. 0 1
      examples/webgpu_video_frame.html
  28. 1 1
      examples/webxr_xr_haptics.html
  29. 1 1
      manual/examples/3dlut-base-cube-maker.html
  30. 2 2
      manual/examples/offscreencanvas-w-fallback.html
  31. 5 5
      manual/examples/offscreencanvas-w-orbitcontrols.html
  32. 2 2
      manual/examples/offscreencanvas-w-picking.html
  33. 2 2
      manual/examples/resources/editor-settings.js
  34. 3 3
      manual/examples/resources/editor.js
  35. 9 14
      manual/examples/resources/lessons-helper.js
  36. 4 4
      manual/examples/resources/lessons-worker-helper.js
  37. 1 1
      manual/examples/resources/webgl-debug-helper.js
  38. 1 1
      manual/examples/responsive-editor.html
  39. 1 1
      manual/examples/shared-cubes.js
  40. 1 1
      manual/examples/shared-orbitcontrols.js
  41. 1 1
      manual/examples/shared-picking.js
  42. 2 2
      manual/index.html
  43. 1 2
      manual/resources/lesson.js
  44. 113 94
      manual/resources/moon-orbit.html
  45. 229 162
      manual/resources/tools/geo-picking/make-geo-picking-texture-ogc.html
  46. 0 3
      manual/resources/tools/geo-picking/make-geo-picking-texture-ogc.js
  47. 0 1
      package.json
  48. 15 13
      playground/fonts/tabler-icons/tabler-icons.html
  49. 3 4
      test/e2e/deterministic-injection.js
  50. 24 7
      test/e2e/puppeteer.js
  51. 0 2
      test/unit/addons/curves/NURBSCurve.tests.js
  52. 0 2
      test/unit/addons/exporters/USDZExporter.tests.js
  53. 0 2
      test/unit/src/animation/AnimationAction.tests.js
  54. 0 2
      test/unit/src/animation/AnimationClip.tests.js
  55. 0 2
      test/unit/src/animation/AnimationMixer.tests.js
  56. 2 4
      test/unit/src/animation/AnimationObjectGroup.tests.js
  57. 0 2
      test/unit/src/animation/AnimationUtils.tests.js
  58. 0 2
      test/unit/src/animation/KeyframeTrack.tests.js
  59. 0 2
      test/unit/src/animation/PropertyBinding.tests.js
  60. 0 2
      test/unit/src/animation/PropertyMixer.tests.js
  61. 0 2
      test/unit/src/animation/tracks/BooleanKeyframeTrack.tests.js
  62. 0 2
      test/unit/src/animation/tracks/ColorKeyframeTrack.tests.js
  63. 0 2
      test/unit/src/animation/tracks/NumberKeyframeTrack.tests.js
  64. 0 2
      test/unit/src/animation/tracks/QuaternionKeyframeTrack.tests.js
  65. 0 2
      test/unit/src/animation/tracks/StringKeyframeTrack.tests.js
  66. 0 2
      test/unit/src/animation/tracks/VectorKeyframeTrack.tests.js
  67. 0 2
      test/unit/src/audio/Audio.tests.js
  68. 0 2
      test/unit/src/audio/AudioAnalyser.tests.js
  69. 0 2
      test/unit/src/audio/AudioContext.tests.js
  70. 0 2
      test/unit/src/audio/AudioListener.tests.js
  71. 0 2
      test/unit/src/audio/PositionalAudio.tests.js
  72. 0 2
      test/unit/src/cameras/ArrayCamera.tests.js
  73. 0 2
      test/unit/src/cameras/Camera.tests.js
  74. 0 2
      test/unit/src/cameras/CubeCamera.tests.js
  75. 0 2
      test/unit/src/cameras/OrthographicCamera.tests.js
  76. 0 2
      test/unit/src/cameras/PerspectiveCamera.tests.js
  77. 0 2
      test/unit/src/cameras/StereoCamera.tests.js
  78. 0 2
      test/unit/src/constants.tests.js
  79. 0 1
      test/unit/src/core/BufferAttribute.tests.js
  80. 0 2
      test/unit/src/core/BufferGeometry.tests.js
  81. 0 2
      test/unit/src/core/Clock.tests.js
  82. 0 2
      test/unit/src/core/EventDispatcher.tests.js
  83. 0 2
      test/unit/src/core/GLBufferAttribute.tests.js
  84. 0 2
      test/unit/src/core/InstancedBufferAttribute.tests.js
  85. 0 2
      test/unit/src/core/InstancedBufferGeometry.tests.js
  86. 0 2
      test/unit/src/core/InstancedInterleavedBuffer.tests.js
  87. 0 2
      test/unit/src/core/InterleavedBuffer.tests.js
  88. 0 2
      test/unit/src/core/InterleavedBufferAttribute.tests.js
  89. 0 2
      test/unit/src/core/Layers.tests.js
  90. 0 2
      test/unit/src/core/Object3D.tests.js
  91. 0 2
      test/unit/src/core/Raycaster.tests.js
  92. 0 2
      test/unit/src/core/RenderTarget.tests.js
  93. 0 2
      test/unit/src/core/RenderTarget3D.tests.js
  94. 0 2
      test/unit/src/core/Uniform.tests.js
  95. 0 2
      test/unit/src/core/UniformsGroup.tests.js
  96. 0 2
      test/unit/src/extras/DataUtils.tests.js
  97. 0 2
      test/unit/src/extras/Earcut.tests.js
  98. 0 2
      test/unit/src/extras/ImageUtils.tests.js
  99. 0 2
      test/unit/src/extras/PMREMGenerator.tests.js
  100. 0 2
      test/unit/src/extras/ShapeUtils.tests.js

+ 1 - 1
editor/index.html

@@ -245,7 +245,7 @@
 
 					navigator.serviceWorker.register( 'sw.js' );
 
-				} catch ( error ) {
+				} catch ( error ) { // eslint-disable-line no-unused-vars
 
 				}
 

+ 2 - 2
editor/js/Script.js

@@ -212,7 +212,7 @@ function Script( editor ) {
 
 						jsonlint.parse( string );
 
-					} catch ( error ) {
+					} catch ( error ) { // eslint-disable-line no-unused-vars
 
 						// ignore failed error recovery
 
@@ -486,7 +486,7 @@ function Script( editor ) {
 
 	} );
 
-	signals.materialChanged.add( function ( object, slot ) {
+	signals.materialChanged.add( function ( object/*, slot */ ) {
 
 		if ( object !== currentObject ) return;
 

+ 1 - 1
editor/js/Selector.js

@@ -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 ) {
 

+ 2 - 2
editor/js/Sidebar.Material.js

@@ -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' );
@@ -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 );
 

+ 2 - 2
editor/js/Sidebar.Object.js

@@ -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' );
@@ -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 );
 

+ 2 - 2
editor/sw.js

@@ -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 );
 
@@ -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 );
 

+ 5 - 1
eslint.config.js

@@ -20,7 +20,8 @@ export default [
 			'**/3rdparty/**',
 			'**/shapefile.js',
 			'**/vendor/**',
-			'**/fuse/**'
+			'**/fuse/**',
+			'**/template/static/**',
 		]
 	},
 
@@ -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',

+ 2 - 2
examples/jsm/capabilities/WebGL.js

@@ -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;
 
@@ -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;
 

+ 1 - 1
examples/jsm/helpers/ViewHelper.js

@@ -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
 

+ 5 - 4
examples/jsm/loaders/3DMLoader.js

@@ -23,7 +23,8 @@ import {
 	SpotLight,
 	Sprite,
 	SpriteMaterial,
-	TextureLoader
+	TextureLoader,
+	EquirectangularReflectionMapping
 } from 'three';
 
 import { EXRLoader } from '../loaders/EXRLoader.js';
@@ -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;
 
 			} );
@@ -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 } );
 
@@ -740,7 +741,7 @@ class Rhino3dmLoader extends Loader {
 				}
 
 
-				if ( geometry.attributes.hasOwnProperty( 'color' ) ) {
+				if ( geometry.hasAttribute( 'color' ) ) {
 
 					mat.vertexColors = true;
 

+ 0 - 2
examples/jsm/loaders/FBXLoader.js

@@ -1615,11 +1615,9 @@ class GeometryParser {
 
 			case 'Mesh':
 				return this.parseMeshGeometry( relationships, geoNode, deformers );
-				break;
 
 			case 'NurbsCurve':
 				return this.parseNurbsGeometry( geoNode );
-				break;
 
 		}
 

+ 0 - 1
examples/jsm/loaders/HDRLoader.js

@@ -424,7 +424,6 @@ class HDRLoader extends DataTextureLoader {
 			default:
 
 				throw new Error( 'THREE.HDRLoader: Unsupported type: ' + this.type );
-				break;
 
 		}
 

+ 1 - 1
examples/jsm/loaders/LDrawLoader.js

@@ -636,7 +636,7 @@ class LDrawParsedCache {
 				const text = await fileLoader.loadAsync( subobjectURL );
 				return text;
 
-			} catch ( _ ) {
+			} catch ( _ ) { // eslint-disable-line no-unused-vars
 
 				continue;
 

+ 1 - 3
examples/jsm/loaders/TDSLoader.js

@@ -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 );
@@ -780,7 +778,7 @@ class Chunk {
 			this.position += next.size;
 			return next;
 
-		}	catch ( e ) {
+		}	catch ( e ) { // eslint-disable-line no-unused-vars
 
 			this.debugMessage( 'Unable to read chunk at ' + this.position );
 			return null;

+ 0 - 2
examples/jsm/loaders/TGALoader.js

@@ -389,7 +389,6 @@ class TGALoader extends DataTextureLoader {
 
 					default:
 						throw new Error( 'THREE.TGALoader: Format not supported.' );
-						break;
 
 				}
 
@@ -415,7 +414,6 @@ class TGALoader extends DataTextureLoader {
 
 					default:
 						throw new Error( 'THREE.TGALoader: Format not supported.' );
-						break;
 
 				}
 

+ 1 - 1
examples/jsm/loaders/usd/USDCParser.js

@@ -4,7 +4,7 @@ import {
 
 class USDCParser {
 
-	parse( buffer ) {
+	parse( /* buffer */ ) {
 
 		// TODO
 

+ 0 - 1
examples/jsm/misc/Volume.js

@@ -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' :

+ 0 - 1
examples/jsm/misc/VolumeSlice.js

@@ -54,7 +54,6 @@ class VolumeSlice {
 
 				index = value;
 				slice.geometryNeedsUpdate = true;
-				return index;
 
 			}
 		} );

+ 1 - 1
examples/jsm/objects/MarchingCubes.js

@@ -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 );
 

+ 1 - 1
examples/jsm/physics/AmmoPhysics.js

@@ -23,7 +23,7 @@ async function AmmoPhysics() {
 
 	}
 
-	const AmmoLib = await Ammo(); // eslint-disable-line no-undef
+	const AmmoLib = await Ammo();
 
 	const frameRate = 60;
 

+ 0 - 2
examples/svg_sandbox.html

@@ -253,8 +253,6 @@
 
 			function render() {
 
-				const time = Date.now() * 0.0002;
-
 				group.rotation.x += 0.01;
 
 				controls.update();

+ 12 - 12
examples/webgl_gpgpu_water.html

@@ -174,7 +174,7 @@
 			let meshRay;
 			let gpuCompute;
 			let heightmapVariable;
-			let smoothShader;
+			// let smoothShader;
 			let readWaterLevelShader;
 			let readWaterLevelRenderTarget;
 			let readWaterLevelImage;
@@ -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, {
@@ -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() {
 

+ 1 - 2
examples/webgl_multiple_views.html

@@ -30,7 +30,7 @@
 
 			let scene, renderer;
 
-			let mouseX = 0, mouseY = 0;
+			let mouseX = 0;
 
 			let windowWidth, windowHeight;
 
@@ -222,7 +222,6 @@
 			function onDocumentMouseMove( event ) {
 
 				mouseX = ( event.clientX - windowWidth / 2 );
-				mouseY = ( event.clientY - windowHeight / 2 );
 
 			}
 

+ 1 - 3
examples/webgpu_camera_logarithmicdepthbuffer.html

@@ -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
@@ -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' );
 

+ 1 - 1
examples/webgpu_compute_reduce.html

@@ -929,7 +929,7 @@
 
 				const scene = new THREE.Scene();
 
-				const array = new Uint32Array( Array.from( { length: size }, ( _, i ) => {
+				const array = new Uint32Array( Array.from( { length: size }, () => {
 
 					return 1;
 

+ 1 - 1
examples/webgpu_instance_uniform.html

@@ -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';
 

+ 0 - 1
examples/webgpu_video_frame.html

@@ -54,7 +54,6 @@
 				const videoTexture = new THREE.VideoFrameTexture();
 				videoTexture.colorSpace = THREE.SRGBColorSpace;
 
-				// eslint-disable-next-line compat/compat
 				const decoder = new VideoDecoder( {
 					output( frame ) {
 

+ 1 - 1
examples/webxr_xr_haptics.html

@@ -168,7 +168,7 @@
 
 			}
 
-			function controllerDisconnected( event ) {
+			function controllerDisconnected() {
 
 				const audio = this.userData.audio;
 				audio.source.stop();

+ 1 - 1
manual/examples/3dlut-base-cube-maker.html

@@ -72,7 +72,7 @@ function handleSizeChange( event ) {
 
 		}
 
-	} catch ( e ) {
+	} catch ( e ) { // eslint-disable-line no-unused-vars
 
 		elem.style.background = 'red';
 

+ 2 - 2
manual/examples/offscreencanvas-w-fallback.html

@@ -42,7 +42,7 @@ function startWorker( canvas ) {
 	window.addEventListener( 'resize', sendSize );
 	sendSize();
 
-	console.log( 'using OffscreenCanvas' ); /* eslint-disable-line no-console */
+	console.log( 'using OffscreenCanvas' );
 
 }
 
@@ -60,7 +60,7 @@ function startMainPage( canvas ) {
 	window.addEventListener( 'resize', sendSize );
 	sendSize();
 
-	console.log( 'using regular canvas' ); /* eslint-disable-line no-console */
+	console.log( 'using regular canvas' );
 
 }
 

+ 5 - 5
manual/examples/offscreencanvas-w-orbitcontrols.html

@@ -85,11 +85,11 @@ function makeSendPropertiesHandler( properties ) {
 }
 
 function touchEventHandler( event, sendFn ) {
-	
-	// preventDefault() fixes mousemove, mouseup and mousedown 
+
+	// preventDefault() fixes mousemove, mouseup and mousedown
 	// firing at touch events when doing a simple touchup touchdown
 	// Happens only at offscreen canvas
-	event.preventDefault(); 
+	event.preventDefault();
 	const touches = [];
 	const data = { type: event.type, touches };
 	for ( let i = 0; i < event.touches.length; ++ i ) {
@@ -206,14 +206,14 @@ function startWorker( canvas ) {
 		canvas: offscreen,
 		canvasId: proxy.id,
 	}, [ offscreen ] );
-	console.log( 'using OffscreenCanvas' ); /* eslint-disable-line no-console */
+	console.log( 'using OffscreenCanvas' );
 
 }
 
 function startMainPage( canvas ) {
 
 	init( { canvas, inputElement: canvas } );
-	console.log( 'using regular canvas' ); /* eslint-disable-line no-console */
+	console.log( 'using regular canvas' );
 
 }
 

+ 2 - 2
manual/examples/offscreencanvas-w-picking.html

@@ -54,7 +54,7 @@ function startWorker( canvas ) {
 	window.addEventListener( 'resize', sendSize );
 	sendSize();
 
-	console.log( 'using OffscreenCanvas' ); /* eslint-disable-line no-console */
+	console.log( 'using OffscreenCanvas' );
 
 }
 
@@ -79,7 +79,7 @@ function startMainPage( canvas ) {
 	window.addEventListener( 'resize', sendSize );
 	sendSize();
 
-	console.log( 'using regular canvas' ); /* eslint-disable-line no-console */
+	console.log( 'using regular canvas' );
 
 }
 

+ 2 - 2
manual/examples/resources/editor-settings.js

@@ -1,7 +1,7 @@
 
-( function () { // eslint-disable-line strict
+( function () {
 
-	'use strict'; // eslint-disable-line strict
+	'use strict';
 
 	function dirname( path ) {
 

+ 3 - 3
manual/examples/resources/editor.js

@@ -1,8 +1,8 @@
-( function () { // eslint-disable-line strict
+( function () {
 
-	'use strict'; // eslint-disable-line strict
+	'use strict';
 
-	/* global monaco, require, lessonEditorSettings */
+	/* global monaco, lessonEditorSettings */
 
 	const {
 		fixSourceLinks,

+ 9 - 14
manual/examples/resources/lessons-helper.js

@@ -56,10 +56,11 @@
 	const topWindow = this;
 
 	/**
-   * Check if the page is embedded.
-   * @param {Window?) w window to check
-   * @return {boolean} True of we are in an iframe
-   */
+	 * Check if the page is embedded.
+	 *
+	 * @param {Window?} w - window to check.
+	 * @return {boolean} True of we are in an iframe
+	 */
 	function isInIFrame( w ) {
 
 		w = w || topWindow;
@@ -75,17 +76,13 @@
 
 				document.getElementsByTagName( 'html' )[ 0 ].className = 'iframe';
 
-			} catch ( e ) {
-        // eslint-disable-line
-			}
+			} catch ( e ) { } // eslint-disable-line no-unused-vars
 
 			try {
 
 				document.body.className = 'iframe';
 
-			} catch ( e ) {
-        // eslint-disable-line
-			}
+			} catch ( e ) { } // eslint-disable-line no-unused-vars
 
 		}
 
@@ -371,9 +368,7 @@
 					// });
 					return matcher( lines[ lineNdx ] );
 
-				} catch ( e ) {
-					// do nothing
-				}
+				} catch ( e ) {} // eslint-disable-line no-unused-vars
 
 			}
 
@@ -388,7 +383,7 @@
 		function log( data ) {
 
 			const { logType, msg } = data;
-			console[ logType ]( '[Worker]', msg ); /* eslint-disable-line no-console */
+			console[ logType ]( '[Worker]', msg );
 
 		}
 

+ 4 - 4
manual/examples/resources/lessons-worker-helper.js

@@ -132,7 +132,7 @@
 	const isWebGLRE = /^(webgl|webgl2|experimental-webgl)$/i;
 	function installWebGLLessonSetup() {
 
-		OffscreenCanvas.prototype.getContext = ( function ( oldFn ) { // eslint-disable-line compat/compat
+		OffscreenCanvas.prototype.getContext = ( function ( oldFn ) {
 
 			return function () {
 
@@ -153,7 +153,7 @@
 
 			};
 
-		}( OffscreenCanvas.prototype.getContext ) ); // eslint-disable-line compat/compat
+		}( OffscreenCanvas.prototype.getContext ) );
 
 	}
 
@@ -172,7 +172,7 @@
 		} = self.webglDebugHelper;
 
 		// capture GL errors
-		OffscreenCanvas.prototype.getContext = ( function ( oldFn ) { // eslint-disable-line compat/compat
+		OffscreenCanvas.prototype.getContext = ( function ( oldFn ) {
 
 			return function () {
 
@@ -220,7 +220,7 @@
 
 			};
 
-		}( OffscreenCanvas.prototype.getContext ) ); // eslint-disable-line compat/compat
+		}( OffscreenCanvas.prototype.getContext ) );
 
 	}
 

+ 1 - 1
manual/examples/resources/webgl-debug-helper.js

@@ -526,7 +526,7 @@
 
 		const errorFunc = options.errorFunc || function ( err, functionName, args ) {
 
-			console.error( `WebGL error ${glEnumToString( err )} in ${functionName}(${glFunctionArgsToString( functionName, args )})` ); /* eslint-disable-line no-console */
+			console.error( `WebGL error ${glEnumToString( err )} in ${functionName}(${glFunctionArgsToString( functionName, args )})` );
 
 		};
 

+ 1 - 1
manual/examples/responsive-editor.html

@@ -63,7 +63,7 @@
 
 // This code is only related to handling the split.
 // Our three.js code has not changed
-Split( [ '#view', '#controls' ], { // eslint-disable-line new-cap
+Split( [ '#view', '#controls' ], {
 	sizes: [ 75, 25 ],
 	minSize: 100,
 	elementStyle: ( dimension, size, gutterSize ) => {

+ 1 - 1
manual/examples/shared-cubes.js

@@ -5,7 +5,7 @@ export const state = {
 	height: 150, // canvas default
 };
 
-export function init( data ) { /* eslint-disable-line no-unused-vars */
+export function init( data ) {
 
 	const { canvas } = data;
 	const renderer = new THREE.WebGLRenderer( { antialias: true, canvas } );

+ 1 - 1
manual/examples/shared-orbitcontrols.js

@@ -1,7 +1,7 @@
 import * as THREE from 'https://cdn.skypack.dev/three@0.136.0/build/three.module.js';
 import { OrbitControls } from 'https://cdn.skypack.dev/three@0.136.0/examples/jsm/controls/OrbitControls.js';
 
-export function init( data ) { /* eslint-disable-line no-unused-vars */
+export function init( data ) {
 
 	const { canvas, inputElement } = data;
 	const renderer = new THREE.WebGLRenderer( { antialias: true, canvas } );

+ 1 - 1
manual/examples/shared-picking.js

@@ -7,7 +7,7 @@ export const state = {
 
 export const pickPosition = { x: 0, y: 0 };
 
-export function init( data ) { // eslint-disable-line no-unused-vars
+export function init( data ) {
 
 	const { canvas } = data;
 	const renderer = new THREE.WebGLRenderer( { antialias: true, canvas } );

+ 2 - 2
manual/index.html

@@ -432,7 +432,7 @@
 
 		// Routing
 
-		function setUrl( href ) { // eslint-disable-line no-undef
+		function setUrl( href ) {
 
 			// yea I know this is hacky.
 			const re = /^(\/(?:manual\/|docs\/#?))(.*?)$/;
@@ -475,7 +475,7 @@
 
 		}
 
-		function setTitle( title ) { // eslint-disable-line no-undef
+		function setTitle( title ) {
 
 			document.title = `${title} - three.js manual`;
 

+ 1 - 2
manual/resources/lesson.js

@@ -1,6 +1,5 @@
 // Licensed under a BSD license. See license.html for license
-/* eslint-disable strict */
-'use strict';  // eslint-disable-line
+'use strict';
 
 ( function () {
 

+ 113 - 94
manual/resources/moon-orbit.html

@@ -44,107 +44,126 @@ p {
 
 function main() {
 
-  const root = {
-    name: 'sun',
-    translation: [0, 0],
-    color: 'yellow',
-    radius: 30,
-    speed: 1,
-    children: [
-      {
-        name: 'earth',
-        translation: [-5, 1],
-        color: 'blue',
-        radius: 10,
-        speed: 2,
-        children: [
-          {
-            name: 'moon',
-            translation: [-1, 1],
-            color: 'gray',
-            drawOrbit: true,
-            radius: 5,
-            speed: 36.13,
-            children: [
-            ],
-          },
-        ],
-      },
-    ],
-  };
-
-  const canvas = document.getElementById('c');
-  const ctx = wrapCanvasRenderingContext2D(canvas.getContext('2d'));
-  const orbitCtx = document.getElementById('orbit').getContext('2d');
-
-  const spread = 16;
-  function updateTranslation(node) {
-    node.translation[0] *= spread;
-    node.translation[1] *= spread;
-    node.rotation = 0;
-    node.children.forEach(updateTranslation);
-  }
-  updateTranslation(root);
+	const root = {
+		name: 'sun',
+		translation: [ 0, 0 ],
+		color: 'yellow',
+		radius: 30,
+		speed: 1,
+		children: [
+			{
+				name: 'earth',
+				translation: [ - 5, 1 ],
+				color: 'blue',
+				radius: 10,
+				speed: 2,
+				children: [
+					{
+						name: 'moon',
+						translation: [ - 1, 1 ],
+						color: 'gray',
+						drawOrbit: true,
+						radius: 5,
+						speed: 36.13,
+						children: [
+						],
+					},
+				],
+			},
+		],
+	};
 
-  let clock = 0;
-  const maxHistory = 400;
-  let curHistory = 0;
-  const history = [];
+	const canvas = document.getElementById( 'c' );
+	const ctx = wrapCanvasRenderingContext2D( canvas.getContext( '2d' ) );
+	const orbitCtx = document.getElementById( 'orbit' ).getContext( '2d' );
 
-  function drawTrail(ctx, pos, radius) {
-    ctx.beginPath();
-    ctx.arc(pos[0], pos[1], radius, 0, Math.PI * 2, false);
-    ctx.fill();
-  }
+	const spread = 16;
+	function updateTranslation( node ) {
 
-  function drawNode(node) {
-    ctx.save();
-    ctx.rotate(node.speed * clock);
-    ctx.translate(node.translation[0], node.translation[1]);
-    ctx.fillStyle = node.color;
-    ctx.strokeStyle = 'black';
-    ctx.beginPath();
-    ctx.arc(0, 0, node.radius, 0, Math.PI * 2, false);
-    ctx.fill();
-    ctx.stroke();
-    if (node.drawOrbit) {
-      const mat = ctx.currentTransform;
-      const point = [mat.e, mat.f];
-      const old = history[curHistory];
-      if (old) {
-        orbitCtx.save();
-        orbitCtx.globalCompositeOperation = 'destination-out';
-        orbitCtx.fillStyle = 'rgba(255,255,255,1)';
-        drawTrail(orbitCtx, old, 2);
-        orbitCtx.restore();
-      }
-      history[curHistory] = point;
-      curHistory = (curHistory + 1) % maxHistory;
-      orbitCtx.fillStyle = 'rgba(255, 0, 0, 1)';
-      drawTrail(orbitCtx, point, 1);
-    }
-    node.children.forEach(drawNode);
-    ctx.restore();
-  }
+		node.translation[ 0 ] *= spread;
+		node.translation[ 1 ] *= spread;
+		node.rotation = 0;
+		node.children.forEach( updateTranslation );
 
-  function drawScene() {
-    threejsUtils.resizeCanvasToDisplaySize(ctx.canvas);
-    threejsUtils.resizeCanvasToDisplaySize(orbitCtx.canvas);
-    ctx.clearRect(0, 0, ctx.canvas.width, ctx.canvas.height);
-    ctx.save();
-    ctx.translate(ctx.canvas.width / 2, ctx.canvas.height / 2);
-    drawNode(root);
-    ctx.restore();
-  }
+	}
 
-  function render() {
-    clock += 1 / 60 * 0.25;
+	updateTranslation( root );
 
-    drawScene();
+	let clock = 0;
+	const maxHistory = 400;
+	let curHistory = 0;
+	const history = [];
+
+	function drawTrail( ctx, pos, radius ) {
+
+		ctx.beginPath();
+		ctx.arc( pos[ 0 ], pos[ 1 ], radius, 0, Math.PI * 2, false );
+		ctx.fill();
+
+	}
+
+	function drawNode( node ) {
+
+		ctx.save();
+		ctx.rotate( node.speed * clock );
+		ctx.translate( node.translation[ 0 ], node.translation[ 1 ] );
+		ctx.fillStyle = node.color;
+		ctx.strokeStyle = 'black';
+		ctx.beginPath();
+		ctx.arc( 0, 0, node.radius, 0, Math.PI * 2, false );
+		ctx.fill();
+		ctx.stroke();
+		if ( node.drawOrbit ) {
+
+			const mat = ctx.currentTransform;
+			const point = [ mat.e, mat.f ];
+			const old = history[ curHistory ];
+			if ( old ) {
+
+				orbitCtx.save();
+				orbitCtx.globalCompositeOperation = 'destination-out';
+				orbitCtx.fillStyle = 'rgba(255,255,255,1)';
+				drawTrail( orbitCtx, old, 2 );
+				orbitCtx.restore();
+
+			}
+
+			history[ curHistory ] = point;
+			curHistory = ( curHistory + 1 ) % maxHistory;
+			orbitCtx.fillStyle = 'rgba(255, 0, 0, 1)';
+			drawTrail( orbitCtx, point, 1 );
+
+		}
+
+		node.children.forEach( drawNode );
+		ctx.restore();
+
+	}
+
+	function drawScene() {
+
+		threejsUtils.resizeCanvasToDisplaySize( ctx.canvas );
+		threejsUtils.resizeCanvasToDisplaySize( orbitCtx.canvas );
+		ctx.clearRect( 0, 0, ctx.canvas.width, ctx.canvas.height );
+		ctx.save();
+		ctx.translate( ctx.canvas.width / 2, ctx.canvas.height / 2 );
+		drawNode( root );
+		ctx.restore();
+
+	}
+
+	function render() {
+
+		clock += 1 / 60 * 0.25;
+
+		drawScene();
+
+		requestAnimationFrame( render, canvas );
+
+	}
+
+	requestAnimationFrame( render, canvas );
 
-    requestAnimationFrame(render, canvas);
-  }
-  requestAnimationFrame(render, canvas);
 }
 
 main();

+ 229 - 162
manual/resources/tools/geo-picking/make-geo-picking-texture-ogc.html

@@ -2,185 +2,252 @@
 <script src="ogc-parser.js"></script>
 <script>
 /* global ogcParser */
-function wait(ms = 0) {
-  return new Promise((resolve) => {
-    setTimeout(resolve, ms);
-  });
+function wait( ms = 0 ) {
+
+	return new Promise( ( resolve ) => {
+
+		setTimeout( resolve, ms );
+
+	} );
+
 }
 
 // # need to draw to 2nd canvas, then shave off non perfect pixels
 
 async function main() {
-  const ctx = document.querySelector('canvas').getContext('2d');
-  ctx.canvas.width = 2048;
-  ctx.canvas.height = 2048;
-  ctx.fillStyle = '#444';
-  ctx.fillRect(0, 0, ctx.canvas.width, ctx.canvas.height);
-  ctx.translate(ctx.canvas.width / 2, ctx.canvas.height / 2);
-  ctx.scale(ctx.canvas.width / 360, ctx.canvas.height / -180);
-
-  function setColor(color) {
-    ctx.fillStyle = color;
-    ctx.strokeStyle = color;
-  }
-
-  const handlers = {
-    point,
-    lineString,
-    polygon,
-    multiPoint,
-    multiLineString,
-    multiPolygon,
-  };
-
-  function point(d) {
-    ctx.fillRect(...d.point, 1, 1);
-  }
-
-  function setPathFromPoints(points, backward = false) {
-    if (backward) {
-      const numPoints = points.length / 2;
-      const lastPoint = numPoints - 1;
-      ctx.moveTo(...points.slice(lastPoint * 2, lastPoint * 2 + 2));
-      for (let i = lastPoint - 1; i >= 0; i -= 2) {
-        ctx.lineTo(...points.slice(i * 2, i * 2 + 2));
-      }
-    } else {
-      ctx.moveTo(...points.slice(0, 2));
-      for (let i = 2; i < points.length; i += 2) {
-        ctx.lineTo(...points.slice(i, i + 2));
-      }
-    }
-  }
-
-  function stroke(ctx) {
-    ctx.save();
-    ctx.setTransform(1, 0, 0, 1, 0, 0);
-    ctx.stroke();
-    ctx.restore();
-  }
-
-  function lineString(d) {
-    ctx.beginPath();
-    setPathFromPoints(d.points);
-    stroke(ctx);
-  }
-
-  function polygon(d) {
-    ctx.beginPath();
-    d.rings.forEach((ring, ndx) => {
-      setPathFromPoints(ring, ndx !== 0);
-      ctx.closePath();
-    });
-    ctx.fill();
-    stroke(ctx);
-  }
-
-  function multiPoint(d) {
-    for (let i = 0; i < d.points.length; i += 2) {
-      ctx.fillRect(...d.points.slice(i, i + 2));
-    }
-  }
-
-  function multiLineString(d) {
-    d.lineStrings.forEach((lineString) => {
-      ctx.beginPath();
-      setPathFromPoints(lineString);
-      stroke(ctx);
-    });
-  }
-
-  function multiPolygon(d) {
-    d.polygons.forEach((polygon) => {
-      ctx.beginPath();
-      polygon.forEach((ring, ndx) => {
-        setPathFromPoints(ring, ndx !== 0);
-      });
-      ctx.fill();
-      stroke(ctx);
-    });
-  }
-
-  const colors = {};
-
-  const req = await fetch('level1.json');
-  const areas = await req.json();
-  const min = [Number.MAX_VALUE, Number.MAX_VALUE];
-  const max = [Number.MIN_VALUE, Number.MIN_VALUE];
-  console.log('num areas:', areas.length);
-  for (let ndx = 0; ndx < areas.length; ++ndx) {
-    const area = areas[ndx];
-    try {
-      const buf = new Uint8Array(base64ToUint8Array(area.geom));
-      area.geom = ogcParser.parse(buf);
-    } catch (e) {
-      console.log('ERROR:', e);
-      console.log(JSON.stringify(area, null, 2));
-      throw e;
-    }
-
-    if (!colors[area.NAME_0]) {
-      colors[area.NAME_0] = rgb(r(), r(), r());
-    }
-
-    const color = colors[area.NAME_0];
-
-    console.log(ndx, area.NAME_0);
-
-    area.geom.primitives.forEach((primitive) => {
-      const fn = handlers[primitive.type];
-      setColor(color);
-      fn(primitive);
-    });
-
-    min[0] = Math.min(min[0], area.geom.envelope[0]);
-    min[0] = Math.min(min[0], area.geom.envelope[1]);
-    min[1] = Math.min(min[1], area.geom.envelope[2]);
-    min[1] = Math.min(min[1], area.geom.envelope[3]);
-
-    max[0] = Math.max(max[0], area.geom.envelope[0]);
-    max[0] = Math.max(max[0], area.geom.envelope[1]);
-    max[1] = Math.max(max[1], area.geom.envelope[2]);
-    max[1] = Math.max(max[1], area.geom.envelope[3]);
-
-    if (ndx % 100 === 99) {
-      await wait();
-    }
-  }
-
-  console.log('min', min);
-  console.log('max', max);
+
+	const ctx = document.querySelector( 'canvas' ).getContext( '2d' );
+	ctx.canvas.width = 2048;
+	ctx.canvas.height = 2048;
+	ctx.fillStyle = '#444';
+	ctx.fillRect( 0, 0, ctx.canvas.width, ctx.canvas.height );
+	ctx.translate( ctx.canvas.width / 2, ctx.canvas.height / 2 );
+	ctx.scale( ctx.canvas.width / 360, ctx.canvas.height / - 180 );
+
+	function setColor( color ) {
+
+		ctx.fillStyle = color;
+		ctx.strokeStyle = color;
+
+	}
+
+	const handlers = {
+		point,
+		lineString,
+		polygon,
+		multiPoint,
+		multiLineString,
+		multiPolygon,
+	};
+
+	function point( d ) {
+
+		ctx.fillRect( ...d.point, 1, 1 );
+
+	}
+
+	function setPathFromPoints( points, backward = false ) {
+
+		if ( backward ) {
+
+			const numPoints = points.length / 2;
+			const lastPoint = numPoints - 1;
+			ctx.moveTo( ...points.slice( lastPoint * 2, lastPoint * 2 + 2 ) );
+			for ( let i = lastPoint - 1; i >= 0; i -= 2 ) {
+
+				ctx.lineTo( ...points.slice( i * 2, i * 2 + 2 ) );
+
+			}
+
+		} else {
+
+			ctx.moveTo( ...points.slice( 0, 2 ) );
+			for ( let i = 2; i < points.length; i += 2 ) {
+
+				ctx.lineTo( ...points.slice( i, i + 2 ) );
+
+			}
+
+		}
+
+	}
+
+	function stroke( ctx ) {
+
+		ctx.save();
+		ctx.setTransform( 1, 0, 0, 1, 0, 0 );
+		ctx.stroke();
+		ctx.restore();
+
+	}
+
+	function lineString( d ) {
+
+		ctx.beginPath();
+		setPathFromPoints( d.points );
+		stroke( ctx );
+
+	}
+
+	function polygon( d ) {
+
+		ctx.beginPath();
+		d.rings.forEach( ( ring, ndx ) => {
+
+			setPathFromPoints( ring, ndx !== 0 );
+			ctx.closePath();
+
+		} );
+		ctx.fill();
+		stroke( ctx );
+
+	}
+
+	function multiPoint( d ) {
+
+		for ( let i = 0; i < d.points.length; i += 2 ) {
+
+			ctx.fillRect( ...d.points.slice( i, i + 2 ) );
+
+		}
+
+	}
+
+	function multiLineString( d ) {
+
+		d.lineStrings.forEach( ( lineString ) => {
+
+			ctx.beginPath();
+			setPathFromPoints( lineString );
+			stroke( ctx );
+
+		} );
+
+	}
+
+	function multiPolygon( d ) {
+
+		d.polygons.forEach( ( polygon ) => {
+
+			ctx.beginPath();
+			polygon.forEach( ( ring, ndx ) => {
+
+				setPathFromPoints( ring, ndx !== 0 );
+
+			} );
+			ctx.fill();
+			stroke( ctx );
+
+		} );
+
+	}
+
+	const colors = {};
+
+	const req = await fetch( 'level1.json' );
+	const areas = await req.json();
+	const min = [ Number.MAX_VALUE, Number.MAX_VALUE ];
+	const max = [ Number.MIN_VALUE, Number.MIN_VALUE ];
+	console.log( 'num areas:', areas.length );
+	for ( let ndx = 0; ndx < areas.length; ++ ndx ) {
+
+		const area = areas[ ndx ];
+		try {
+
+			const buf = new Uint8Array( base64ToUint8Array( area.geom ) );
+			area.geom = ogcParser.parse( buf );
+
+		} catch ( e ) {
+
+			console.log( 'ERROR:', e );
+			console.log( JSON.stringify( area, null, 2 ) );
+			throw e;
+
+		}
+
+		if ( ! colors[ area.NAME_0 ] ) {
+
+			colors[ area.NAME_0 ] = rgb( r(), r(), r() );
+
+		}
+
+		const color = colors[ area.NAME_0 ];
+
+		console.log( ndx, area.NAME_0 );
+
+		area.geom.primitives.forEach( ( primitive ) => {
+
+			const fn = handlers[ primitive.type ];
+			setColor( color );
+			fn( primitive );
+
+		} );
+
+		min[ 0 ] = Math.min( min[ 0 ], area.geom.envelope[ 0 ] );
+		min[ 0 ] = Math.min( min[ 0 ], area.geom.envelope[ 1 ] );
+		min[ 1 ] = Math.min( min[ 1 ], area.geom.envelope[ 2 ] );
+		min[ 1 ] = Math.min( min[ 1 ], area.geom.envelope[ 3 ] );
+
+		max[ 0 ] = Math.max( max[ 0 ], area.geom.envelope[ 0 ] );
+		max[ 0 ] = Math.max( max[ 0 ], area.geom.envelope[ 1 ] );
+		max[ 1 ] = Math.max( max[ 1 ], area.geom.envelope[ 2 ] );
+		max[ 1 ] = Math.max( max[ 1 ], area.geom.envelope[ 3 ] );
+
+		if ( ndx % 100 === 99 ) {
+
+			await wait();
+
+		}
+
+	}
+
+	console.log( 'min', min );
+	console.log( 'max', max );
+
 }
 
-function r(min, max) {
-  if (min === undefined) {
-    min = 0;
-    max = 1;
-  } else if (max === undefined){
-    max = min;
-    min = 0;
-  }
-  return min + Math.random() * (max - min);
+function r( min, max ) {
+
+	if ( min === undefined ) {
+
+		min = 0;
+		max = 1;
+
+	} else if ( max === undefined ) {
+
+		max = min;
+		min = 0;
+
+	}
+
+	return min + Math.random() * ( max - min );
+
 }
 
-function rgb(r, g, b) {
-  return `rgb(${r * 255 | 0},${g * 255 | 0},${b * 255 | 0})`;
+function rgb( r, g, b ) {
+
+	return `rgb(${r * 255 | 0},${g * 255 | 0},${b * 255 | 0})`;
+
 }
 
 // function hsl(h, s, l) {
 //   return `hsl(${h * 360 | 0},${s * 100 | 0}%,${l * 100 | 0}%)`;
 // }
 
-function base64ToUint8Array(base64) {
-  const raw = window.atob(base64);
-  const rawLength = raw.length;
-  const array = new Uint8Array(new ArrayBuffer(rawLength));
+function base64ToUint8Array( base64 ) {
+
+	const raw = window.atob( base64 );
+	const rawLength = raw.length;
+	const array = new Uint8Array( new ArrayBuffer( rawLength ) );
+
+	for ( let i = 0; i < rawLength; ++ i ) {
+
+		array[ i ] = raw.charCodeAt( i );
+
+	}
 
-  for(let i = 0; i < rawLength; ++i) {
-    array[i] = raw.charCodeAt(i);
-  }
+	return array;
 
-  return array;
 }
 
 main();

+ 0 - 3
manual/resources/tools/geo-picking/make-geo-picking-texture-ogc.js

@@ -1,7 +1,4 @@
-/* global require */
-/* global process */
 /* global parseGeom */
-/* global Buffer */
 const fs = require( 'fs' );
 const path = require( 'path' );
 require( './ogc-parser' );

+ 0 - 1
package.json

@@ -55,7 +55,6 @@
     "lint-core": "eslint src",
     "lint-addons": "eslint examples/jsm",
     "lint-examples": "eslint examples",
-    "lint-docs": "eslint docs",
     "lint-editor": "eslint editor",
     "lint-playground": "eslint playground",
     "lint-manual": "eslint manual",

+ 15 - 13
playground/fonts/tabler-icons/tabler-icons.html

@@ -36365,22 +36365,24 @@
 </div>
 
 <script type="text/javascript">
-  const input = document.querySelector('div.search-bar input')
-  const iconContainer = document.querySelector('div.box div.tabler-icons')
-  let icons = []
+  const input = document.querySelector( 'div.search-bar input' );
+  const iconContainer = document.querySelector( 'div.box div.tabler-icons' );
+  const icons = [];
 
-  document.querySelectorAll('div.tabler-icon').forEach(icon => icons.push({
-    el: icon,
-    name: icon.querySelector('strong').innerHTML
-  }))
+  document.querySelectorAll( 'div.tabler-icon' ).forEach( icon => icons.push( {
+  	el: icon,
+  	name: icon.querySelector( 'strong' ).innerHTML
+  } ) );
 
-  input.addEventListener('input', search)
+  input.addEventListener( 'input', search );
+
+  function search( evt ) {
+
+  	const searchValue = evt.target.value;
+  	const iconsToShow = searchValue.length ? icons.filter( icon => icon.name.includes( searchValue ) ) : icons;
+  	iconContainer.innerHTML = '';
+  	iconsToShow.forEach( icon => iconContainer.appendChild( icon.el ) );
 
-  function search(evt) {
-    let searchValue = evt.target.value
-    let iconsToShow = searchValue.length ? icons.filter(icon => icon.name.includes(searchValue)) : icons
-    iconContainer.innerHTML = ''
-    iconsToShow.forEach(icon => iconContainer.appendChild(icon.el))
   }
 </script>
 

+ 3 - 4
test/e2e/deterministic-injection.js

@@ -16,7 +16,6 @@
 
 	window.performance._now = performance.now;
 
-	let frameId = 0;
 	const now = () => 0; // frameId * 16;
 	window.Date.now = now;
 	window.Date.prototype.getTime = now;
@@ -29,7 +28,7 @@
 
 	window.requestAnimationFrame = function ( cb ) {
 
-		if ( window._renderFinished === true ) return
+		if ( window._renderFinished === true ) return;
 
 		if ( window._renderStarted === false ) {
 
@@ -63,11 +62,11 @@
 
 			this.load();
 			play.call( this );
-			RAF( renew );
+			RAF( renew ); // eslint-disable-line no-undef
 
 		}
 
-		RAF( renew );
+		RAF( renew ); // eslint-disable-line no-undef
 
 	};
 

+ 24 - 7
test/e2e/puppeteer.js

@@ -131,7 +131,7 @@ process.on( 'SIGINT', async () => {
 
 			await browser.close();
 
-		} catch {}
+		} catch ( e ) {} // eslint-disable-line no-unused-vars
 
 	}
 
@@ -144,8 +144,17 @@ async function main() {
 
 	/* Create output directory */
 
-	try { await fs.rm( 'test/e2e/output-screenshots', { recursive: true, force: true } ); } catch {}
-	try { await fs.mkdir( 'test/e2e/output-screenshots' ); } catch {}
+	try {
+
+		await fs.rm( 'test/e2e/output-screenshots', { recursive: true, force: true } );
+
+	} catch ( e ) {} // eslint-disable-line no-unused-vars
+
+	try {
+
+		await fs.mkdir( 'test/e2e/output-screenshots' );
+
+	} catch ( e ) {} // eslint-disable-line no-unused-vars
 
 	/* Find files */
 
@@ -306,11 +315,19 @@ async function preparePage( page, injection, builds, errorMessages ) {
 		}
 
 		const args = await Promise.all( msg.args().map( async arg => {
+
 			try {
+
 				return await arg.executionContext().evaluate( arg => arg instanceof Error ? arg.message : arg, arg );
-			} catch ( e ) { // Execution context might have been already destroyed
+
+			} catch ( e ) { // eslint-disable-line no-unused-vars
+
+				// Execution context might have been already destroyed
+
 				return arg;
+
 			}
+
 		} ) );
 
 		let text = args.join( ' ' ); // https://github.com/puppeteer/puppeteer/issues/3397#issuecomment-434970058
@@ -360,7 +377,7 @@ async function preparePage( page, injection, builds, errorMessages ) {
 
 			}
 
-		} catch {}
+		} catch ( e ) {} // eslint-disable-line no-unused-vars
 
 	} );
 
@@ -494,7 +511,7 @@ async function makeAttempt( page, failedScreenshots, cleanPage, isMakeScreenshot
 
 				expected = ( await Jimp.read( `examples/screenshots/${ file }.jpg`, { quality: jpgQuality } ) );
 
-			} catch {
+			} catch ( e ) { // eslint-disable-line no-unused-vars
 
 				await screenshot.write( `test/e2e/output-screenshots/${ file }-actual.jpg` );
 				throw new Error( `Screenshot does not exist: ${ file }` );
@@ -513,7 +530,7 @@ async function makeAttempt( page, failedScreenshots, cleanPage, isMakeScreenshot
 					alpha: 0.2
 				} );
 
-			} catch {
+			} catch ( e ) { // eslint-disable-line no-unused-vars
 
 				await screenshot.write( `test/e2e/output-screenshots/${ file }-actual.jpg` );
 				await expected.write( `test/e2e/output-screenshots/${ file }-expected.jpg` );

+ 0 - 2
test/unit/addons/curves/NURBSCurve.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { NURBSCurve } from '../../../../examples/jsm/curves/NURBSCurve.js';
 import { MathUtils } from '../../../../src/math/MathUtils.js';
 import { Vector4 } from '../../../../src/math/Vector4.js';

+ 0 - 2
test/unit/addons/exporters/USDZExporter.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { USDZExporter } from '../../../../examples/jsm/exporters/USDZExporter.js';
 import { USDLoader } from '../../../../examples/jsm/loaders/USDLoader.js';
 import {

+ 0 - 2
test/unit/src/animation/AnimationAction.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { AnimationAction } from '../../../../src/animation/AnimationAction.js';
 
 import { AnimationMixer } from '../../../../src/animation/AnimationMixer.js';

+ 0 - 2
test/unit/src/animation/AnimationClip.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { AnimationClip } from '../../../../src/animation/AnimationClip.js';
 
 export default QUnit.module( 'Animation', () => {

+ 0 - 2
test/unit/src/animation/AnimationMixer.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { AnimationMixer } from '../../../../src/animation/AnimationMixer.js';
 
 import { EventDispatcher } from '../../../../src/core/EventDispatcher.js';

+ 2 - 4
test/unit/src/animation/AnimationObjectGroup.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { AnimationObjectGroup } from '../../../../src/animation/AnimationObjectGroup.js';
 
 import { Object3D } from '../../../../src/core/Object3D.js';
@@ -50,14 +48,14 @@ export default QUnit.module( 'Animation', () => {
 
 				var rootNodes = [], pathsOk = true, nodesOk = true;
 
-				for ( var i = group.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {
+				for ( let i = group.nCachedObjects_, n = bindings.length; i !== n; ++ i ) {
 
 					if ( bindings[ i ].path !== path ) pathsOk = false;
 					rootNodes.push( bindings[ i ].rootNode );
 
 				}
 
-				for ( var i = 0, n = roots.length; i !== n; ++ i ) {
+				for ( let i = 0, n = roots.length; i !== n; ++ i ) {
 
 					if ( rootNodes.indexOf( roots[ i ] ) === - 1 ) nodesOk = false;
 

+ 0 - 2
test/unit/src/animation/AnimationUtils.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 // import * as AnimationUtils from '../../../../src/animation/AnimationUtils.js';
 
 export default QUnit.module( 'Animation', () => {

+ 0 - 2
test/unit/src/animation/KeyframeTrack.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { NumberKeyframeTrack } from '../../../../src/animation/tracks/NumberKeyframeTrack.js';
 
 import { KeyframeTrack } from '../../../../src/animation/KeyframeTrack.js';

+ 0 - 2
test/unit/src/animation/PropertyBinding.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { PropertyBinding } from '../../../../src/animation/PropertyBinding.js';
 
 import { BoxGeometry } from '../../../../src/geometries/BoxGeometry.js';

+ 0 - 2
test/unit/src/animation/PropertyMixer.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 // import { PropertyMixer } from '../../../../src/animation/PropertyMixer.js';
 
 export default QUnit.module( 'Animation', () => {

+ 0 - 2
test/unit/src/animation/tracks/BooleanKeyframeTrack.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { BooleanKeyframeTrack } from '../../../../../src/animation/tracks/BooleanKeyframeTrack.js';
 
 import { KeyframeTrack } from '../../../../../src/animation/KeyframeTrack.js';

+ 0 - 2
test/unit/src/animation/tracks/ColorKeyframeTrack.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { ColorKeyframeTrack } from '../../../../../src/animation/tracks/ColorKeyframeTrack.js';
 
 import { KeyframeTrack } from '../../../../../src/animation/KeyframeTrack.js';

+ 0 - 2
test/unit/src/animation/tracks/NumberKeyframeTrack.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { NumberKeyframeTrack } from '../../../../../src/animation/tracks/NumberKeyframeTrack.js';
 
 import { KeyframeTrack } from '../../../../../src/animation/KeyframeTrack.js';

+ 0 - 2
test/unit/src/animation/tracks/QuaternionKeyframeTrack.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { QuaternionKeyframeTrack } from '../../../../../src/animation/tracks/QuaternionKeyframeTrack.js';
 
 import { KeyframeTrack } from '../../../../../src/animation/KeyframeTrack.js';

+ 0 - 2
test/unit/src/animation/tracks/StringKeyframeTrack.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { StringKeyframeTrack } from '../../../../../src/animation/tracks/StringKeyframeTrack.js';
 
 import { KeyframeTrack } from '../../../../../src/animation/KeyframeTrack.js';

+ 0 - 2
test/unit/src/animation/tracks/VectorKeyframeTrack.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { VectorKeyframeTrack } from '../../../../../src/animation/tracks/VectorKeyframeTrack.js';
 
 import { KeyframeTrack } from '../../../../../src/animation/KeyframeTrack.js';

+ 0 - 2
test/unit/src/audio/Audio.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { Audio } from '../../../../src/audio/Audio.js';
 
 import { Object3D } from '../../../../src/core/Object3D.js';

+ 0 - 2
test/unit/src/audio/AudioAnalyser.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 // import { AudioAnalyser } from '../../../../src/audio/AudioAnalyser.js';
 
 export default QUnit.module( 'Audios', () => {

+ 0 - 2
test/unit/src/audio/AudioContext.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { AudioContext } from '../../../../src/audio/AudioContext.js';
 
 export default QUnit.module( 'Audios', () => {

+ 0 - 2
test/unit/src/audio/AudioListener.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { AudioListener } from '../../../../src/audio/AudioListener.js';
 
 import { Object3D } from '../../../../src/core/Object3D.js';

+ 0 - 2
test/unit/src/audio/PositionalAudio.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { PositionalAudio } from '../../../../src/audio/PositionalAudio.js';
 
 import { Audio } from '../../../../src/audio/Audio.js';

+ 0 - 2
test/unit/src/cameras/ArrayCamera.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { ArrayCamera } from '../../../../src/cameras/ArrayCamera.js';
 
 import { PerspectiveCamera } from '../../../../src/cameras/PerspectiveCamera.js';

+ 0 - 2
test/unit/src/cameras/Camera.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { Camera } from '../../../../src/cameras/Camera.js';
 
 import { Vector3 } from '../../../../src/math/Vector3.js';

+ 0 - 2
test/unit/src/cameras/CubeCamera.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { CubeCamera } from '../../../../src/cameras/CubeCamera.js';
 
 import { Object3D } from '../../../../src/core/Object3D.js';

+ 0 - 2
test/unit/src/cameras/OrthographicCamera.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { OrthographicCamera } from '../../../../src/cameras/OrthographicCamera.js';
 
 import { Camera } from '../../../../src/cameras/Camera.js';

+ 0 - 2
test/unit/src/cameras/PerspectiveCamera.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { PerspectiveCamera } from '../../../../src/cameras/PerspectiveCamera.js';
 
 import { Matrix4 } from '../../../../src/math/Matrix4.js';

+ 0 - 2
test/unit/src/cameras/StereoCamera.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { StereoCamera } from '../../../../src/cameras/StereoCamera.js';
 
 export default QUnit.module( 'Cameras', () => {

+ 0 - 2
test/unit/src/constants.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import * as Constants from '../../../src/constants.js';
 
 export default QUnit.module( 'Constants', () => {

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

@@ -1,4 +1,3 @@
-/* global QUnit */
 import {
 	BufferAttribute,
 	Int8BufferAttribute,

+ 0 - 2
test/unit/src/core/BufferGeometry.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { BufferGeometry } from '../../../../src/core/BufferGeometry.js';
 
 import {

+ 0 - 2
test/unit/src/core/Clock.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { Clock } from '../../../../src/core/Clock.js';
 
 export default QUnit.module( 'Core', () => {

+ 0 - 2
test/unit/src/core/EventDispatcher.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { EventDispatcher } from '../../../../src/core/EventDispatcher.js';
 
 export default QUnit.module( 'Core', () => {

+ 0 - 2
test/unit/src/core/GLBufferAttribute.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { GLBufferAttribute } from '../../../../src/core/GLBufferAttribute.js';
 
 export default QUnit.module( 'Core', () => {

+ 0 - 2
test/unit/src/core/InstancedBufferAttribute.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { InstancedBufferAttribute } from '../../../../src/core/InstancedBufferAttribute.js';
 
 import { BufferAttribute } from '../../../../src/core/BufferAttribute.js';

+ 0 - 2
test/unit/src/core/InstancedBufferGeometry.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { InstancedBufferGeometry } from '../../../../src/core/InstancedBufferGeometry.js';
 
 import { BufferGeometry } from '../../../../src/core/BufferGeometry.js';

+ 0 - 2
test/unit/src/core/InstancedInterleavedBuffer.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { InstancedInterleavedBuffer } from '../../../../src/core/InstancedInterleavedBuffer.js';
 
 import { InterleavedBuffer } from '../../../../src/core/InterleavedBuffer.js';

+ 0 - 2
test/unit/src/core/InterleavedBuffer.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { InterleavedBuffer } from '../../../../src/core/InterleavedBuffer.js';
 
 import { DynamicDrawUsage } from '../../../../src/constants.js';

+ 0 - 2
test/unit/src/core/InterleavedBufferAttribute.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { InterleavedBufferAttribute } from '../../../../src/core/InterleavedBufferAttribute.js';
 
 import { InterleavedBuffer } from '../../../../src/core/InterleavedBuffer.js';

+ 0 - 2
test/unit/src/core/Layers.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { Layers } from '../../../../src/core/Layers.js';
 
 export default QUnit.module( 'Core', () => {

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

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { Object3D } from '../../../../src/core/Object3D.js';
 
 import { Vector3 } from '../../../../src/math/Vector3.js';

+ 0 - 2
test/unit/src/core/Raycaster.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { Raycaster } from '../../../../src/core/Raycaster.js';
 import { Vector3 } from '../../../../src/math/Vector3.js';
 import { Mesh } from '../../../../src/objects/Mesh.js';

+ 0 - 2
test/unit/src/core/RenderTarget.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { NearestFilter } from '../../../../src/constants.js';
 import { RenderTarget } from '../../../../src/core/RenderTarget.js';
 

+ 0 - 2
test/unit/src/core/RenderTarget3D.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { RenderTarget3D } from '../../../../src/core/RenderTarget3D.js';
 
 import { EventDispatcher } from '../../../../src/core/EventDispatcher.js';

+ 0 - 2
test/unit/src/core/Uniform.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { Uniform } from '../../../../src/core/Uniform.js';
 import { Vector3 } from '../../../../src/math/Vector3.js';
 import {

+ 0 - 2
test/unit/src/core/UniformsGroup.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import { UniformsGroup } from '../../../../src/core/UniformsGroup.js';
 
 import { EventDispatcher } from '../../../../src/core/EventDispatcher.js';

+ 0 - 2
test/unit/src/extras/DataUtils.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 import * as DataUtils from '../../../../src/extras/DataUtils.js';
 
 import { CONSOLE_LEVEL } from '../../utils/console-wrapper.js';

+ 0 - 2
test/unit/src/extras/Earcut.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 // import { Earcut } from '../../../../src/extras/Earcut.js';
 
 export default QUnit.module( 'Extras', () => {

+ 0 - 2
test/unit/src/extras/ImageUtils.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 // import { ImageUtils } from '../../../../src/extras/ImageUtils.js';
 
 export default QUnit.module( 'Extras', () => {

+ 0 - 2
test/unit/src/extras/PMREMGenerator.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 // import { PMREMGenerator } from '../../../../src/extras/PMREMGenerator.js';
 
 export default QUnit.module( 'Extras', () => {

+ 0 - 2
test/unit/src/extras/ShapeUtils.tests.js

@@ -1,5 +1,3 @@
-/* global QUnit */
-
 // import { ShapeUtils } from '../../../../src/extras/ShapeUtils.js';
 
 export default QUnit.module( 'Extras', () => {

Some files were not shown because too many files changed in this diff

粤ICP备19079148号