Skip to content

Commit

Permalink
Merge pull request #91863 from patwork/upgrade-to-eslint-9
Browse files Browse the repository at this point in the history
[Web] Update to eslint 9
  • Loading branch information
akien-mga committed May 23, 2024
2 parents 8e2141e + 1a89ae7 commit f2f6727
Show file tree
Hide file tree
Showing 16 changed files with 903 additions and 1,590 deletions.
47 changes: 16 additions & 31 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,37 +74,6 @@ repos:
# files: ^(doc/classes|.*/doc_classes)/.*\.xml$
# args: [--schema, doc/class.xsd]

- repo: https://github.com/pre-commit/mirrors-eslint
rev: v8.46.0
hooks:
- id: eslint
name: eslint-engine
files: ^(platform/web/js/engine/|js/jsdoc2rst/).*\.js$
args: [--fix, --no-eslintrc, --config, platform/web/.eslintrc.engine.js]
additional_dependencies: &eslint-deps
- [email protected]
- [email protected]
- [email protected]
- [email protected]
- '@html-eslint/[email protected]'
- '@html-eslint/[email protected]'
- id: eslint
name: eslint-libs
files: ^(platform/web/js/libs/|modules/).*\.js$
args: [--fix, --no-eslintrc, --config, platform/web/.eslintrc.libs.js]
additional_dependencies: *eslint-deps
- id: eslint
name: eslint-sw
files: ^misc/dist/html/service-worker\.js$
args: [--fix, --no-eslintrc, --config, platform/web/.eslintrc.sw.js]
additional_dependencies: *eslint-deps
- id: eslint
name: eslint-html
files: ^misc/dist/html/.*\.html$
types: [html]
args: [--fix, --no-eslintrc, --config, platform/web/.eslintrc.html.js]
additional_dependencies: *eslint-deps

- repo: local
hooks:
- id: make-rst
Expand All @@ -120,6 +89,22 @@ repos:
entry: python3 doc/tools/doc_status.py
files: ^(doc/classes|.*/doc_classes)/.*\.xml$

- id: eslint
name: eslint
language: node
entry: eslint
files: ^(platform/web/js/|modules/|misc/dist/html/).*\.(js|html)$
args: [--fix, --no-warn-ignored, --no-config-lookup, --config, platform/web/eslint.config.cjs]
additional_dependencies:
- '@eslint/js@^9.3.0'
- '@html-eslint/eslint-plugin@^0.24.1'
- '@html-eslint/parser@^0.24.1'
- '@stylistic/eslint-plugin@^2.1.0'
- 'eslint@^9.3.0'
- 'eslint-plugin-html@^8.1.1'
- 'globals@^15.3.0'
- 'espree@^10.0.1'

- id: jsdoc
name: jsdoc
language: node
Expand Down
2 changes: 0 additions & 2 deletions misc/dist/html/service-worker.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,6 @@ self.addEventListener('message', (event) => {
caches.delete(CACHE_NAME);
} else if (msg === 'update') {
self.skipWaiting().then(() => self.clients.claim()).then(() => self.clients.matchAll()).then((all) => all.forEach((c) => c.navigate(c.url)));
} else {
onClientMessage(event);
}
});
});
11 changes: 6 additions & 5 deletions modules/webxr/native/library_godot_webxr.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,8 @@ const GodotWebXR = {
GodotWebXR.orig_requestAnimationFrame = Browser.requestAnimationFrame;
}
Browser.requestAnimationFrame = enable
? GodotWebXR.requestAnimationFrame : GodotWebXR.orig_requestAnimationFrame;
? GodotWebXR.requestAnimationFrame
: GodotWebXR.orig_requestAnimationFrame;
},
pauseResumeMainLoop: () => {
// Once both GodotWebXR.session and GodotWebXR.space are set or
Expand All @@ -76,9 +77,9 @@ const GodotWebXR = {
// gets picked up automatically, however, in the Oculus Browser
// on the Quest, we need to pause and resume the main loop.
Browser.mainLoop.pause();
runtimeKeepalivePush(); // eslint-disable-line no-undef
runtimeKeepalivePush();
window.setTimeout(function () {
runtimeKeepalivePop(); // eslint-disable-line no-undef
runtimeKeepalivePop();
Browser.mainLoop.resume();
}, 0);
},
Expand Down Expand Up @@ -287,12 +288,12 @@ const GodotWebXR = {
// Store onsimpleevent so we can use it later.
GodotWebXR.onsimpleevent = onsimpleevent;

const gl_context_handle = _emscripten_webgl_get_current_context(); // eslint-disable-line no-undef
const gl_context_handle = _emscripten_webgl_get_current_context();
const gl = GL.getContext(gl_context_handle).GLctx;
GodotWebXR.gl = gl;

gl.makeXRCompatible().then(function () {
GodotWebXR.gl_binding = new XRWebGLBinding(session, gl); // eslint-disable-line no-undef
GodotWebXR.gl_binding = new XRWebGLBinding(session, gl);

// This will trigger the layer to get created.
GodotWebXR.getLayer();
Expand Down
11 changes: 0 additions & 11 deletions platform/web/.eslintrc.engine.js

This file was deleted.

21 changes: 0 additions & 21 deletions platform/web/.eslintrc.html.js

This file was deleted.

51 changes: 0 additions & 51 deletions platform/web/.eslintrc.js

This file was deleted.

26 changes: 0 additions & 26 deletions platform/web/.eslintrc.libs.js

This file was deleted.

14 changes: 0 additions & 14 deletions platform/web/.eslintrc.sw.js

This file was deleted.

Loading

0 comments on commit f2f6727

Please sign in to comment.