ソースを参照

Merge pull request #20517 from Mugen87/dev51

Examples: Resolve linter issues.
Mr.doob 4 年 前
コミット
7410f62e11

+ 1 - 1
examples/js/loaders/DRACOLoader.js

@@ -582,7 +582,7 @@ THREE.DRACOLoader.DRACOWorker = function () {
 
 	}
 
-	function getDracoDataType ( draco, attributeType ) {
+	function getDracoDataType( draco, attributeType ) {
 
 		switch ( attributeType ) {
 

+ 7 - 9
examples/js/loaders/VRMLLoader.js

@@ -1,12 +1,10 @@
 console.warn( "THREE.VRMLLoader: As part of the transition to ES6 Modules, the files in 'examples/js' were deprecated in May 2020 (r117) and will be deleted in December 2020 (r124). You can find more information about developing using ES6 Modules in https://threejs.org/docs/#manual/en/introduction/Installation." );
 
-/* global chevrotain */
-
 THREE.VRMLLoader = ( function () {
 
 	// dependency check
 
-	if ( typeof chevrotain === 'undefined' ) {
+	if ( typeof chevrotain === 'undefined' ) { // eslint-disable-line no-undef
 
 		throw Error( 'THREE.VRMLLoader: External library chevrotain.min.js required.' );
 
@@ -101,7 +99,7 @@ THREE.VRMLLoader = ( function () {
 
 			function createTokens() {
 
-				var createToken = chevrotain.createToken;
+				var createToken = chevrotain.createToken; // eslint-disable-line no-undef
 
 				// from http://gun.teipir.gr/VRML-amgem/spec/part1/concepts.html#SyntaxBasics
 
@@ -176,7 +174,7 @@ THREE.VRMLLoader = ( function () {
 				var Comment = createToken( {
 					name: 'Comment',
 					pattern: /#.*/,
-					group: chevrotain.Lexer.SKIPPED
+					group: chevrotain.Lexer.SKIPPED // eslint-disable-line no-undef
 				} );
 
 				// commas, blanks, tabs, newlines and carriage returns are whitespace characters wherever they appear outside of string fields
@@ -184,7 +182,7 @@ THREE.VRMLLoader = ( function () {
 				var WhiteSpace = createToken( {
 					name: 'WhiteSpace',
 					pattern: /[ ,\s]/,
-					group: chevrotain.Lexer.SKIPPED
+					group: chevrotain.Lexer.SKIPPED // eslint-disable-line no-undef
 				} );
 
 				var tokens = [
@@ -3179,7 +3177,7 @@ THREE.VRMLLoader = ( function () {
 
 	function VRMLLexer( tokens ) {
 
-		this.lexer = new chevrotain.Lexer( tokens );
+		this.lexer = new chevrotain.Lexer( tokens ); // eslint-disable-line no-undef
 
 	}
 
@@ -3207,7 +3205,7 @@ THREE.VRMLLoader = ( function () {
 
 	function VRMLParser( tokenVocabulary ) {
 
-		chevrotain.Parser.call( this, tokenVocabulary );
+		chevrotain.Parser.call( this, tokenVocabulary ); // eslint-disable-line no-undef
 
 		var $ = this;
 
@@ -3434,7 +3432,7 @@ THREE.VRMLLoader = ( function () {
 
 	}
 
-	VRMLParser.prototype = Object.create( chevrotain.Parser.prototype );
+	VRMLParser.prototype = Object.create( chevrotain.Parser.prototype ); // eslint-disable-line no-undef
 	VRMLParser.prototype.constructor = VRMLParser;
 
 	function Face( a, b, c ) {

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

@@ -774,7 +774,7 @@ Rhino3dmLoader.Rhino3dmWorker = function () {
 					/* Like Basis Loader */
 					RhinoModule = { wasmBinary, onRuntimeInitialized: resolve };
 
-					rhino3dm( RhinoModule );
+					rhino3dm( RhinoModule ); // eslint-disable-line no-undef
 
 				 } ).then( () => {
 

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

@@ -587,7 +587,7 @@ DRACOLoader.DRACOWorker = function () {
 
 	}
 
-	function getDracoDataType ( draco, attributeType ) {
+	function getDracoDataType( draco, attributeType ) {
 
 		switch ( attributeType ) {
 

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

@@ -107,7 +107,7 @@ class KTX2Loader extends CompressedTextureLoader {
 		// initialization to return a native Promise.
 		scope.basisModulePending = new Promise( function ( resolve ) {
 
-			MSC_TRANSCODER().then( function ( basisModule ) {
+			MSC_TRANSCODER().then( function ( basisModule ) { // eslint-disable-line no-undef
 
 				scope.basisModule = basisModule;
 

+ 7 - 9
examples/jsm/loaders/VRMLLoader.js

@@ -36,13 +36,11 @@ import {
 } from "../../../build/three.module.js";
 import { chevrotain } from "../libs/chevrotain.module.min.js";
 
-/* global chevrotain */
-
 var VRMLLoader = ( function () {
 
 	// dependency check
 
-	if ( typeof chevrotain === 'undefined' ) {
+	if ( typeof chevrotain === 'undefined' ) { // eslint-disable-line no-undef
 
 		throw Error( 'THREE.VRMLLoader: External library chevrotain.min.js required.' );
 
@@ -137,7 +135,7 @@ var VRMLLoader = ( function () {
 
 			function createTokens() {
 
-				var createToken = chevrotain.createToken;
+				var createToken = chevrotain.createToken; // eslint-disable-line no-undef
 
 				// from http://gun.teipir.gr/VRML-amgem/spec/part1/concepts.html#SyntaxBasics
 
@@ -212,7 +210,7 @@ var VRMLLoader = ( function () {
 				var Comment = createToken( {
 					name: 'Comment',
 					pattern: /#.*/,
-					group: chevrotain.Lexer.SKIPPED
+					group: chevrotain.Lexer.SKIPPED // eslint-disable-line no-undef
 				} );
 
 				// commas, blanks, tabs, newlines and carriage returns are whitespace characters wherever they appear outside of string fields
@@ -220,7 +218,7 @@ var VRMLLoader = ( function () {
 				var WhiteSpace = createToken( {
 					name: 'WhiteSpace',
 					pattern: /[ ,\s]/,
-					group: chevrotain.Lexer.SKIPPED
+					group: chevrotain.Lexer.SKIPPED // eslint-disable-line no-undef
 				} );
 
 				var tokens = [
@@ -3215,7 +3213,7 @@ var VRMLLoader = ( function () {
 
 	function VRMLLexer( tokens ) {
 
-		this.lexer = new chevrotain.Lexer( tokens );
+		this.lexer = new chevrotain.Lexer( tokens ); // eslint-disable-line no-undef
 
 	}
 
@@ -3243,7 +3241,7 @@ var VRMLLoader = ( function () {
 
 	function VRMLParser( tokenVocabulary ) {
 
-		chevrotain.Parser.call( this, tokenVocabulary );
+		chevrotain.Parser.call( this, tokenVocabulary ); // eslint-disable-line no-undef
 
 		var $ = this;
 
@@ -3470,7 +3468,7 @@ var VRMLLoader = ( function () {
 
 	}
 
-	VRMLParser.prototype = Object.create( chevrotain.Parser.prototype );
+	VRMLParser.prototype = Object.create( chevrotain.Parser.prototype ); // eslint-disable-line no-undef
 	VRMLParser.prototype.constructor = VRMLParser;
 
 	function Face( a, b, c ) {

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

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

+ 4 - 0
examples/jsm/postprocessing/Pass.js

@@ -34,6 +34,10 @@ Object.assign( Pass.prototype, {
 
 // Helper for passes that need to fill the viewport with a single quad.
 
+// Important: It's actually a hack to put FullScreenQuad into the Pass namespace. This is only
+// done to make examples/js code work. Normally, FullScreenQuad should be exported
+// from this module like Pass.
+
 Pass.FullScreenQuad = ( function () {
 
 	var camera = new OrthographicCamera( - 1, 1, 1, - 1, 0, 1 );

+ 8 - 10
examples/jsm/postprocessing/SAOPass.d.ts

@@ -26,16 +26,6 @@ interface SAOPassParams {
 	saoBlurDepthCutoff: number;
 }
 
-export namespace SAOPass {
-	enum OUTPUT {
-		Default,
-		Beauty,
-		SAO,
-		Depth,
-		Normal
-	}
-}
-
 export class SAOPass extends Pass {
 
 	constructor( scene: Scene, camera: Camera, depthTexture?: boolean, useNormals?: boolean, resolution?: Vector2 );
@@ -62,6 +52,14 @@ export class SAOPass extends Pass {
 	fsQuad: object;
 	params: SAOPassParams;
 
+	static OUTPUT: {
+		Beauty: number;
+		Default: number;
+		SAO: number;
+		Depth: number;
+		Normal: number;
+	};
+
 	renderPass( renderer: WebGLRenderer, passMaterial: Material, renderTarget: WebGLRenderTarget, clearColor?: Color | string | number, clearAlpha?: number ): void;
 	renderOverride( renderer: WebGLRenderer, overrideMaterial: Material, renderTarget: WebGLRenderTarget, clearColor?: Color | string | number, clearAlpha?: number ): void;
 

+ 1 - 1
utils/modularize.js

@@ -35,7 +35,7 @@ var files = [
 
 	{ path: 'exporters/ColladaExporter.js', dependencies: [], ignoreList: [] },
 	{ path: 'exporters/DRACOExporter.js', dependencies: [], ignoreList: [ 'Geometry' ] },
-	{ path: 'exporters/GLTFExporter.js', dependencies: [], ignoreList: [ 'AnimationClip', 'Camera', 'Geometry', 'Material', 'Mesh', 'Object3D', 'RGBFormat', 'Scenes', 'ShaderMaterial' ] },
+	{ path: 'exporters/GLTFExporter.js', dependencies: [], ignoreList: [ 'AnimationClip', 'Camera', 'Geometry', 'Material', 'Mesh', 'Object3D', 'RGBFormat', 'Scenes', 'ShaderMaterial', 'Matrix4' ] },
 	{ path: 'exporters/MMDExporter.js', dependencies: [ { name: 'MMDParser', path: 'libs/mmdparser.module.js' } ], ignoreList: [] },
 	{ path: 'exporters/OBJExporter.js', dependencies: [], ignoreList: [] },
 	{ path: 'exporters/PLYExporter.js', dependencies: [], ignoreList: [] },