浏览代码

Dont lint webgl2 (#23767)

* lint: add WebGL2 as polyfill

* WebGL: remove compat comments in capabilities
Cody Bennett 3 年之前
父节点
当前提交
556457c601
共有 2 个文件被更改,包括 6 次插入2 次删除
  1. 1 2
      examples/jsm/capabilities/WebGL.js
  2. 5 0
      package.json

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

@@ -20,7 +20,6 @@ class WebGL {
 		try {
 
 			const canvas = document.createElement( 'canvas' );
-			// eslint-disable-next-line compat/compat
 			return !! ( window.WebGL2RenderingContext && canvas.getContext( 'webgl2' ) );
 
 		} catch ( e ) {
@@ -52,7 +51,7 @@ class WebGL {
 
 		const contexts = {
 			1: window.WebGLRenderingContext,
-			2: window.WebGL2RenderingContext // eslint-disable-line compat/compat
+			2: window.WebGL2RenderingContext
 		};
 
 		let message = 'Your $0 does not seem to support <a href="http://khronos.org/webgl/wiki/Getting_a_WebGL_Implementation" style="color:#000">$1</a>';

+ 5 - 0
package.json

@@ -53,6 +53,11 @@
       "html",
       "import"
     ],
+    "settings": {
+      "polyfills": [
+        "WebGL2RenderingContext"
+      ]
+    },
     "globals": {
       "__THREE_DEVTOOLS__": "readonly",
       "WebGL2ComputeRenderingContext": "readonly",