Files
web/xo.config.js
Austin Gilmour 1c621a53f8 fix: replace ES2024 regex v flag with u for WebKit compatibility (#3757)
WebKit-based browsers (Safari, DuckDuckGo on macOS) don't yet support
the ES2024 Unicode Sets `v` regex flag, causing a SyntaxError that
prevents all dashboard JavaScript from executing — stats show `---` and
charts spin indefinitely.

None of the affected patterns use v-exclusive features (set notation
`[A--B]`, `[A&&B]`), so downgrading to `u` is fully equivalent and
restores broad compatibility without any functional change.

Also updates xo.config.js to enforce `requireFlag: "u"` so the linter
stays consistent with the codebase.

Affected files (16 occurrences across 8 files):
- scripts/js/utils.js
- scripts/js/index.js
- scripts/js/footer.js
- scripts/js/groups-domains.js
- scripts/js/settings-teleporter.js
- scripts/js/gravity.js
- scripts/js/groups.js
- scripts/js/groups-clients.js
- scripts/js/groups-lists.js
- scripts/js/settings-dns-records.js
- scripts/js/network.js
- scripts/js/taillog.js

Signed-off-by: Austin Gilmour <gilmoursa@gmail.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-16 07:58:15 -04:00

69 lines
2.0 KiB
JavaScript

"use strict";
const globals = require("globals");
const { defineConfig } = require("eslint/config");
const compatPlugin = require("eslint-plugin-compat");
module.exports = defineConfig([
{
extends: [compatPlugin.configs["flat/recommended"]],
languageOptions: {
sourceType: "script",
globals: {
...globals.browser,
...globals.jquery,
},
},
prettier: true,
space: 2,
ignores: ["**/vendor/**"],
rules: {
"@stylistic/spaced-comment": "off",
camelcase: [
"error",
{
properties: "never",
},
],
"capitalized-comments": "off",
"new-cap": [
"error",
{
properties: false,
},
],
"no-alert": "off",
"no-console": "error",
// This should be removed later
"no-implicit-globals": "off",
"no-negated-condition": "off",
"promise/prefer-await-to-then": "off",
"prefer-arrow-callback": "error",
"prefer-destructuring": [
// This should be enabled later
"off",
{
object: true,
array: false,
},
],
// This should be reverted to "error" later
strict: ["error", "global"],
// Require u flag instead of v: WebKit (Safari, DuckDuckGo) does not yet
// support the ES2024 v (Unicode Sets) flag, causing a SyntaxError that
// prevents all JS from executing. None of our regexes use v-exclusive
// features, so u is fully equivalent and broadly compatible.
"require-unicode-regexp": ["error", { requireFlag: "u" }],
"unicorn/no-anonymous-default-export": "off",
"unicorn/no-document-cookie": "off",
"unicorn/no-negated-condition": "off",
"unicorn/prefer-module": "off",
"unicorn/prefer-query-selector": "off",
"unicorn/prefer-string-slice": "off",
"unicorn/prefer-string-raw": "off",
"unicorn/prevent-abbreviations": "off",
"unicorn/switch-case-braces": "off",
},
},
]);