Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Web] Update to eslint 9 #91863

Merged
merged 1 commit into from
May 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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
- eslint@8.46.0
- eslint-config-airbnb-base@15.0.0
- eslint-plugin-import@2.28.0
- eslint-plugin-html@7.1.0
- '@html-eslint/eslint-plugin@0.19.1'
- '@html-eslint/parser@0.19.1'
- 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.