Bladeren bron

Cleanup eslint globals + update deprecated config (#22940)

gero3 3 jaren geleden
bovenliggende
commit
3a42fffb06
5 gewijzigde bestanden met toevoegingen van 12 en 14 verwijderingen
  1. 10 8
      package.json
  2. 0 2
      src/Three.js
  3. 1 1
      src/renderers/WebGLRenderer.js
  4. 0 2
      src/renderers/webgl/WebGLCapabilities.js
  5. 1 1
      src/scenes/Scene.js

+ 10 - 8
package.json

@@ -39,14 +39,16 @@
       "html"
       "html"
     ],
     ],
     "globals": {
     "globals": {
-      "potpack": true,
-      "fflate": true,
-      "ZSTDDecoder": true,
-      "bodymovin": true,
-      "OIMO": true,
-      "Stats": true,
-      "XRWebGLBinding": true,
-      "XRWebGLLayer": true
+      "__THREE_DEVTOOLS__": "readonly",
+      "WebGL2ComputeRenderingContext": "readonly",
+
+      "potpack": "readonly",
+      "fflate": "readonly",
+      "bodymovin": "readonly",
+      "OIMO": "readonly",
+      "Stats": "readonly",
+      "XRWebGLBinding": "readonly",
+      "XRWebGLLayer": "readonly"
     },
     },
     "rules": {
     "rules": {
       "quotes": [
       "quotes": [

+ 0 - 2
src/Three.js

@@ -155,11 +155,9 @@ export * from './Three.Legacy.js';
 
 
 if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
 if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
 
 
-	/* eslint-disable no-undef */
 	__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {
 	__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'register', { detail: {
 		revision: REVISION,
 		revision: REVISION,
 	} } ) );
 	} } ) );
-	/* eslint-enable no-undef */
 
 
 }
 }
 
 

+ 1 - 1
src/renderers/WebGLRenderer.js

@@ -2213,7 +2213,7 @@ function WebGLRenderer( parameters = {} ) {
 
 
 	if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
 	if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
 
 
-		__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) ); // eslint-disable-line no-undef
+		__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) );
 
 
 	}
 	}
 
 

+ 0 - 2
src/renderers/webgl/WebGLCapabilities.js

@@ -52,10 +52,8 @@ function WebGLCapabilities( gl, extensions, parameters ) {
 
 
 	}
 	}
 
 
-	/* eslint-disable no-undef */
 	const isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext ) ||
 	const isWebGL2 = ( typeof WebGL2RenderingContext !== 'undefined' && gl instanceof WebGL2RenderingContext ) ||
 		( typeof WebGL2ComputeRenderingContext !== 'undefined' && gl instanceof WebGL2ComputeRenderingContext );
 		( typeof WebGL2ComputeRenderingContext !== 'undefined' && gl instanceof WebGL2ComputeRenderingContext );
-	/* eslint-enable no-undef */
 
 
 	let precision = parameters.precision !== undefined ? parameters.precision : 'highp';
 	let precision = parameters.precision !== undefined ? parameters.precision : 'highp';
 	const maxPrecision = getMaxPrecision( precision );
 	const maxPrecision = getMaxPrecision( precision );

+ 1 - 1
src/scenes/Scene.js

@@ -18,7 +18,7 @@ class Scene extends Object3D {
 
 
 		if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
 		if ( typeof __THREE_DEVTOOLS__ !== 'undefined' ) {
 
 
-			__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) ); // eslint-disable-line no-undef
+			__THREE_DEVTOOLS__.dispatchEvent( new CustomEvent( 'observe', { detail: this } ) );
 
 
 		}
 		}