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 #91771

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion modules/webxr/native/library_godot_webxr.js
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ const GodotWebXR = {
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.

115 changes: 115 additions & 0 deletions platform/web/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,115 @@
import globals from "globals";
import pluginJs from "@eslint/js";
import pluginReference from "eslint-plugin-html";

export default [
pluginJs.configs.recommended,
// pluginJs.configs.all,

{
rules: {
"indent": ["error", "tab"],
"curly": ["error", "all"],
"quote-props": ["error", "consistent"],
"no-self-assign": "off",
"no-unused-vars": ["error", { "args": "none", "caughtErrors": "none" }],
"no-console": "error",
"no-eval": "error",
"no-shadow": "error",
"strict": ["error", "safe"],
"no-alert": "error",
},
},

{
files: ["platform/web/js/engine/**/*.js"],
languageOptions: {
globals: {
...globals.browser,
"Features": true,
"Godot": true,
"InternalConfig": true,
"Preloader": true,
},
},
},

{
files: ["platform/web/js/jsdoc2rst/**/*.js"],
languageOptions: {
globals: globals.node,
},
},

{
files: [
"platform/web/js/libs/**/*.js",
"modules/**/*.js",
],
languageOptions: {
globals: {
...globals.browser,
"autoAddDeps": true,
"Browser": true,
"ERRNO_CODES": true,
"FS": true,
"GL": true,
"GodotConfig": true,
"GodotEventListeners": true,
"GodotFS": true,
"GodotOS": true,
"GodotRuntime": true,
"HEAP32": true,
"HEAP8": true,
"HEAPF32": true,
"HEAPU8": true,
"IDBFS": true,
"IDHandler": true,
"LibraryManager": true,
"mergeInto": true,
"XRWebGLLayer": true,
},
},
},

{
files: ["misc/dist/html/**/*.js"],
languageOptions: {
globals: {
...globals.browser,
"___GODOT_CACHE___": true,
"___GODOT_ENSURE_CROSSORIGIN_ISOLATION_HEADERS___": true,
"___GODOT_OPT_CACHE___": true,
"onClientMessage": true,
},
},
},

{
files: ["misc/dist/html/**/*.html"],
plugins: {
"eslint-plugin-html": pluginReference,
},
languageOptions: {
globals: {
...globals.browser,
"Engine": true,
"$GODOT_CONFIG": true,
"$GODOT_PROJECT_NAME": true,
"$GODOT_THREADS_ENABLED": true,
"___GODOT_THREADS_ENABLED___": true,
}
},
rules: {
"no-console": "off",
"no-alert": "off",
},
},

{
ignores: [
"platform/web/eslint.config.mjs",
"**/*.externs.js",
],
},
];
2 changes: 1 addition & 1 deletion platform/web/js/engine/features.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const Features = { // eslint-disable-line no-unused-vars
const Features = {
/**
* Check whether WebGL is available. Optionally, specify a particular version of WebGL to check for.
*
Expand Down
Loading
Loading