Open source, privacy-first web analytics. Lightweight, cookie-free Google Analytics alternative. Self-hosted or cloud.
TypeScript analyticsanalytics-dashboardclickhouseelixirgoogle-analyticsmarketingopen-source-analyticsphoenixplausible-analyticspostgresqlprivacyprivacy-friendlyself-hostedsimple-analyticsstatisticstailwindcssweb-analyticswebsite-analyticswebsite-statswebsite-tracking
Script v2: Adds linter and prettier, satisfies linter (#5691)
Artur Pata757cf9507036
diff --git a/.github/workflows/node.yml b/.github/workflows/node.ymlindex 9626e3d3ec..ab0485ca51 100644--- a/.github/workflows/node.yml+++ b/.github/workflows/node.yml@@ -31,4 +31,6 @@ jobs:- run: npm run lint --prefix ./assets- run: npm run check-format --prefix ./assets- run: npm run test --prefix ./assets+ - run: npm run lint --prefix ./tracker+ # - run: npm run check-format --prefix ./tracker- run: npm run deploy --prefix ./trackerdiff --git a/tracker/.eslintrc.json b/tracker/.eslintrc.jsondeleted file mode 100644index 56b2758529..0000000000--- a/tracker/.eslintrc.json+++ /dev/null@@ -1,35 +0,0 @@-{- "parserOptions": { "ecmaVersion": "latest" },- "env": { "node": true, "es6": true },- "extends": ["eslint:recommended", "plugin:playwright/playwright-test"],- "globals": {- "window": "readonly",- "document": "readonly"- },- "rules": {- "max-len": [0, {"code": 120}],- "max-classes-per-file": [0],- "no-unused-expressions": [1, { "allowShortCircuit": true }],- "no-unused-vars": [2, { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }],- "no-prototype-builtins": [0],- "playwright/no-conditional-in-test": [0],- "playwright/no-wait-for-timeout": "off",- "playwright/expect-expect": [- "error",- {- "assertFunctionNames": [- "expect",- "expectPlausibleInAction"- ]- }- ]- },- "overrides": [- {- "files": ["*.spec.js"],- "rules": {- "semi": ["warn", "never"]- }- }- ]-}diff --git a/tracker/.prettierignore b/tracker/.prettierignorenew file mode 100644index 0000000000..39b9daca06--- /dev/null+++ b/tracker/.prettierignore@@ -0,0 +1,3 @@+src/p.js+src/plausible.js+node_modules/diff --git a/tracker/.prettierrc.json b/tracker/.prettierrc.jsonnew file mode 100644index 0000000000..81c51f9894--- /dev/null+++ b/tracker/.prettierrc.json@@ -0,0 +1,5 @@+{+ "singleQuote": true,+ "trailingComma": "none",+ "semi": false+}diff --git a/tracker/compiler/index.js b/tracker/compiler/index.jsindex ca4262019b..708b1ad135 100644--- a/tracker/compiler/index.js+++ b/tracker/compiler/index.js@@ -12,7 +12,7 @@ import json from '@rollup/plugin-json'const __dirname = path.dirname(fileURLToPath(import.meta.url))-const DEFAULT_GLOBALS = {+export const DEFAULT_GLOBALS = {COMPILE_PLAUSIBLE_WEB: false,COMPILE_PLAUSIBLE_NPM: false,COMPILE_PLAUSIBLE_LEGACY_VARIANT: false,diff --git a/tracker/eslint.config.mjs b/tracker/eslint.config.mjsnew file mode 100644index 0000000000..7756e86e13--- /dev/null+++ b/tracker/eslint.config.mjs@@ -0,0 +1,100 @@+import globals from 'globals'+import { globalIgnores } from 'eslint/config'+import eslint from '@eslint/js'+import pluginPlaywright from 'eslint-plugin-playwright'+import prettierEslintInteroperabilityConfig from 'eslint-config-prettier/flat'+import tseslint from 'typescript-eslint'+import { DEFAULT_GLOBALS } from './compiler/index.js'++const DEFAULT_BOOLEAN_SETTINGS = Object.fromEntries(+ Object.entries(DEFAULT_GLOBALS).map(([global]) => [global, 'readonly'])+)++export default tseslint.config([+ globalIgnores(['./npm_package/plausible.js']),+ // shared config for all files+ eslint.configs.recommended,+ tseslint.configs.recommended,+ {+ rules: {+ '@typescript-eslint/no-unused-vars': [+ 'error',+ {+ argsIgnorePattern: '^_',+ varsIgnorePattern: '^_',+ caughtErrorsIgnorePattern: '^_'+ }+ ],+ '@typescript-eslint/no-unused-expressions': [+ 'error',+ {+ allowShortCircuit: true+ }+ ]+ }+ },+ // config for build scripts+ {+ files: [+ 'compile.js',+ 'compiler/**/*.js',+ 'playwright.config.js',+ 'eslint.config.mjs',+ 'playwright.config.ts',+ 'test/support/server.js'+ ],+ languageOptions: { ecmaVersion: 'latest', globals: globals.node }+ },+ // config for tracker script+ {+ files: ['src/**/*.js'],+ languageOptions: {+ ecmaVersion: 5, // must work also in older browsers+ globals: {+ ...globals.browser,+ ...DEFAULT_BOOLEAN_SETTINGS,+ plausible: 'writeable'+ },+ sourceType: 'commonjs'+ }+ },+ // config for installation support scripts+ {+ files: ['installation_support/**/*.js'],+ languageOptions: {+ ecmaVersion: 'latest', // must work only in modern browsers+ globals: {+ ...globals.browser,+ plausible: 'readable'+ }+ }+ },+ // config for tests of tracker scripts and installation support scripts+ {+ files: ['test/**/*.js', 'test/**/*.ts'],+ ...pluginPlaywright.configs['flat/recommended'],+ languageOptions: {+ ecmaVersion: 'latest',+ globals: {+ // available in test runner:+ ...globals.node,+ // available within the Page under test:+ ...globals.browser,+ plausible: 'readable'+ }+ },+ rules: {+ ...pluginPlaywright.configs['flat/recommended'].rules,+ 'playwright/expect-expect': [+ 'error',+ {+ assertFunctionNames: ['expectPlausibleInAction']+ }+ ],+ 'playwright/no-wait-for-timeout': 'off', // justification: it's necessary for engagement and scroll depth tests+ 'playwright/no-conditional-in-test': 'off', // justification: it's necessary for generated tests+ 'playwright/no-skipped-test': 'off' // justification: test skips are intentional, usually for flakiness on specific browsers+ }+ },+ prettierEslintInteroperabilityConfig+])diff --git a/tracker/installation_support/autoconsent-to-cookies.js b/tracker/installation_support/autoconsent-to-cookies.jsindex d70c8f0ce7..57677e1960 100644--- a/tracker/installation_support/autoconsent-to-cookies.js+++ b/tracker/installation_support/autoconsent-to-cookies.js@@ -71,7 +71,7 @@ export function initializeCookieConsentEngine({)return { handled: null, engineLifecycle: engine.state.lifecycle }- } catch (e) {+ } catch (_error) {return {handled: false,error: { message: 'Error initializing cookie consent engine' }diff --git a/tracker/installation_support/verifier-v2.js b/tracker/installation_support/verifier-v2.jsindex 118a5db416..4a31d6a209 100644--- a/tracker/installation_support/verifier-v2.js+++ b/tracker/installation_support/verifier-v2.js@@ -96,7 +96,9 @@ function getNormalizedPlausibleEventBody(fetchOptions) {version = body?.v || body?.version}return name && domain ? { name, domain, version } : null- } catch (e) {}+ } catch (_error) {+ // ignore error+ }}function startRecordingEventFetchCalls() {@@ -160,7 +162,10 @@ function getPlausibleVariant() {}async function testPlausibleFunction({ timeoutMs, debug }) {- return new Promise(async (_resolve) => {+ // async executor is not a problem in this case, because it's only used for `await delay()` calls+ // not for controlling promise resolution+ // eslint-disable-next-line no-async-promise-executor+ return new Promise(async (resolvePromise) => {let plausibleIsOnWindow = isPlausibleOnWindow()let plausibleIsInitialized = isPlausibleInitialized()let plausibleVersion = getPlausibleVersion()@@ -175,7 +180,7 @@ async function testPlausibleFunction({ timeoutMs, debug }) {const resolve = (overrides) => {resolved = true- _resolve({+ resolvePromise({plausibleIsInitialized,plausibleIsOnWindow,plausibleVersion,diff --git a/tracker/npm_package/CHANGELOG.md b/tracker/npm_package/CHANGELOG.mdindex 2255cd0523..eb68b19839 100644--- a/tracker/npm_package/CHANGELOG.md+++ b/tracker/npm_package/CHANGELOG.md@@ -7,6 +7,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0## Unreleased+- Remove redeclared variables from the tracker.+## [0.4.1] - 2025-09-01- Minor update: Allow setting `lib` option for other tools integrating with Plausible.diff --git a/tracker/package-lock.json b/tracker/package-lock.jsonindex 53a9538a59..e0dab29857 100644--- a/tracker/package-lock.json+++ b/tracker/package-lock.json@@ -16,12 +16,18 @@"threads": "^1.7.0"},"devDependencies": {+ "@eslint/js": "^9.34.0","@playwright/test": "^1.52.0","@types/node": "^22.13.4",- "eslint": "^9.20.1",+ "eslint": "^9.34.0",+ "eslint-config-prettier": "^10.1.8","eslint-plugin-playwright": "^2.2.2","express": "^4.21.2",- "markdown-table": "^3.0.4"+ "globals": "^16.3.0",+ "markdown-table": "^3.0.4",+ "prettier": "^3.3.3",+ "typescript": "^5.9.2",+ "typescript-eslint": "^8.41.0"}},"node_modules/@aashutoshrathi/word-wrap": {@@ -45,16 +51,20 @@}},"node_modules/@eslint-community/eslint-utils": {- "version": "4.4.0",- "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz",- "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==",+ "version": "4.7.0",+ "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.7.0.tgz",+ "integrity": "sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==","dev": true,+ "license": "MIT","dependencies": {- "eslint-visitor-keys": "^3.3.0"+ "eslint-visitor-keys": "^3.4.3"},"engines": {"node": "^12.22.0 || ^14.17.0 || >=16.0.0"},+ "funding": {+ "url": "https://opencollective.com/eslint"+ },"peerDependencies": {"eslint": "^6.0.0 || ^7.0.0 || >=8.0.0"}@@ -69,10 +79,11 @@}},"node_modules/@eslint/config-array": {- "version": "0.19.2",- "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.19.2.tgz",- "integrity": "sha512-GNKqxfHG2ySmJOBSHg7LxeUx4xpuCoFjacmlCoYWEbaPXLwvfIjixRI12xCQZeULksQb23uiA8F40w5TojpV7w==",+ "version": "0.21.0",+ "resolved": "https://registry.npmjs.org/@eslint/config-array/-/config-array-0.21.0.tgz",+ "integrity": "sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==","dev": true,+ "license": "Apache-2.0","dependencies": {"@eslint/object-schema": "^2.1.6","debug": "^4.3.1",@@ -82,11 +93,22 @@"node": "^18.18.0 || ^20.9.0 || >=21.1.0"}},+ "node_modules/@eslint/config-helpers": {+ "version": "0.3.1",+ "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.3.1.tgz",+ "integrity": "sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ }+ },"node_modules/@eslint/core": {- "version": "0.11.0",- "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.11.0.tgz",- "integrity": "sha512-DWUB2pksgNEb6Bz2fggIy1wh6fGgZP4Xyy/Mt0QZPiloKKXerbqq9D3SBQTlCRYOrcRPu4vuz+CGjwdfqxnoWA==",+ "version": "0.15.2",+ "resolved": "https://registry.npmjs.org/@eslint/core/-/core-0.15.2.tgz",+ "integrity": "sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==","dev": true,+ "license": "Apache-2.0","dependencies": {"@types/json-schema": "^7.0.15"},@@ -95,10 +117,11 @@}},"node_modules/@eslint/eslintrc": {- "version": "3.2.0",- "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.2.0.tgz",- "integrity": "sha512-grOjVNN8P3hjJn/eIETF1wwd12DdnwFDoyceUJLYYdkpbwq3nLi+4fqrTAONx7XDALqlL220wC/RHSC/QTI/0w==",+ "version": "3.3.1",+ "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-3.3.1.tgz",+ "integrity": "sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==","dev": true,+ "license": "MIT","dependencies": {"ajv": "^6.12.4","debug": "^4.3.2",@@ -122,6 +145,7 @@"resolved": "https://registry.npmjs.org/globals/-/globals-14.0.0.tgz","integrity": "sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==","dev": true,+ "license": "MIT","engines": {"node": ">=18"},@@ -130,12 +154,16 @@}},"node_modules/@eslint/js": {- "version": "9.20.0",- "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.20.0.tgz",- "integrity": "sha512-iZA07H9io9Wn836aVTytRaNqh00Sad+EamwOVJT12GTLw1VGMFV/4JaME+JjLtr9fiGaoWgYnS54wrfWsSs4oQ==",+ "version": "9.34.0",+ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-9.34.0.tgz",+ "integrity": "sha512-EoyvqQnBNsV1CWaEJ559rxXL4c8V92gxirbawSmVUOWXlsRxxQXl6LmCpdUblgxgSkDIqKnhzba2SjRTI/A5Rw==","dev": true,+ "license": "MIT","engines": {"node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "url": "https://eslint.org/donate"}},"node_modules/@eslint/object-schema": {@@ -143,17 +171,19 @@"resolved": "https://registry.npmjs.org/@eslint/object-schema/-/object-schema-2.1.6.tgz","integrity": "sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==","dev": true,+ "license": "Apache-2.0","engines": {"node": "^18.18.0 || ^20.9.0 || >=21.1.0"}},"node_modules/@eslint/plugin-kit": {- "version": "0.2.6",- "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.2.6.tgz",- "integrity": "sha512-+0TjwR1eAUdZtvv/ir1mGX+v0tUoR3VEPB8Up0LLJC+whRW0GgBBtpbOkg/a/U4Dxa6l5a3l9AJ1aWIQVyoWJA==",+ "version": "0.3.5",+ "resolved": "https://registry.npmjs.org/@eslint/plugin-kit/-/plugin-kit-0.3.5.tgz",+ "integrity": "sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==","dev": true,+ "license": "Apache-2.0","dependencies": {- "@eslint/core": "^0.11.0",+ "@eslint/core": "^0.15.2","levn": "^0.4.1"},"engines": {@@ -260,6 +290,44 @@"url": "https://github.com/sponsors/nzakas"}},+ "node_modules/@nodelib/fs.scandir": {+ "version": "2.1.5",+ "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",+ "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@nodelib/fs.stat": "2.0.5",+ "run-parallel": "^1.1.9"+ },+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/@nodelib/fs.stat": {+ "version": "2.0.5",+ "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz",+ "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 8"+ }+ },+ "node_modules/@nodelib/fs.walk": {+ "version": "1.2.8",+ "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz",+ "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@nodelib/fs.scandir": "2.1.5",+ "fastq": "^1.6.0"+ },+ "engines": {+ "node": ">= 8"+ }+ },"node_modules/@playwright/test": {"version": "1.52.0","resolved": "https://registry.npmjs.org/@playwright/test/-/test-1.52.0.tgz",@@ -844,7 +912,8 @@"version": "7.0.15","resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz","integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",- "dev": true+ "dev": true,+ "license": "MIT"},"node_modules/@types/node": {"version": "22.13.4",@@ -855,6 +924,277 @@"undici-types": "~6.20.0"}},+ "node_modules/@typescript-eslint/eslint-plugin": {+ "version": "8.41.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-8.41.0.tgz",+ "integrity": "sha512-8fz6oa6wEKZrhXWro/S3n2eRJqlRcIa6SlDh59FXJ5Wp5XRZ8B9ixpJDcjadHq47hMx0u+HW6SNa6LjJQ6NLtw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@eslint-community/regexpp": "^4.10.0",+ "@typescript-eslint/scope-manager": "8.41.0",+ "@typescript-eslint/type-utils": "8.41.0",+ "@typescript-eslint/utils": "8.41.0",+ "@typescript-eslint/visitor-keys": "8.41.0",+ "graphemer": "^1.4.0",+ "ignore": "^7.0.0",+ "natural-compare": "^1.4.0",+ "ts-api-utils": "^2.1.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "@typescript-eslint/parser": "^8.41.0",+ "eslint": "^8.57.0 || ^9.0.0",+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/eslint-plugin/node_modules/ignore": {+ "version": "7.0.5",+ "resolved": "https://registry.npmjs.org/ignore/-/ignore-7.0.5.tgz",+ "integrity": "sha512-Hs59xBNfUIunMFgWAbGX5cq6893IbWg4KnrjbYwX3tx0ztorVgTDA6B2sxf8ejHJ4wz8BqGUMYlnzNBer5NvGg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 4"+ }+ },+ "node_modules/@typescript-eslint/parser": {+ "version": "8.41.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-8.41.0.tgz",+ "integrity": "sha512-gTtSdWX9xiMPA/7MV9STjJOOYtWwIJIYxkQxnSV1U3xcE+mnJSH3f6zI0RYP+ew66WSlZ5ed+h0VCxsvdC1jJg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/scope-manager": "8.41.0",+ "@typescript-eslint/types": "8.41.0",+ "@typescript-eslint/typescript-estree": "8.41.0",+ "@typescript-eslint/visitor-keys": "8.41.0",+ "debug": "^4.3.4"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "eslint": "^8.57.0 || ^9.0.0",+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/project-service": {+ "version": "8.41.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/project-service/-/project-service-8.41.0.tgz",+ "integrity": "sha512-b8V9SdGBQzQdjJ/IO3eDifGpDBJfvrNTp2QD9P2BeqWTGrRibgfgIlBSw6z3b6R7dPzg752tOs4u/7yCLxksSQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/tsconfig-utils": "^8.41.0",+ "@typescript-eslint/types": "^8.41.0",+ "debug": "^4.3.4"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/scope-manager": {+ "version": "8.41.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.41.0.tgz",+ "integrity": "sha512-n6m05bXn/Cd6DZDGyrpXrELCPVaTnLdPToyhBoFkLIMznRUQUEQdSp96s/pcWSQdqOhrgR1mzJ+yItK7T+WPMQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/types": "8.41.0",+ "@typescript-eslint/visitor-keys": "8.41.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ }+ },+ "node_modules/@typescript-eslint/tsconfig-utils": {+ "version": "8.41.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.41.0.tgz",+ "integrity": "sha512-TDhxYFPUYRFxFhuU5hTIJk+auzM/wKvWgoNYOPcOf6i4ReYlOoYN8q1dV5kOTjNQNJgzWN3TUUQMtlLOcUgdUw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/type-utils": {+ "version": "8.41.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-8.41.0.tgz",+ "integrity": "sha512-63qt1h91vg3KsjVVonFJWjgSK7pZHSQFKH6uwqxAH9bBrsyRhO6ONoKyXxyVBzG1lJnFAJcKAcxLS54N1ee1OQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/types": "8.41.0",+ "@typescript-eslint/typescript-estree": "8.41.0",+ "@typescript-eslint/utils": "8.41.0",+ "debug": "^4.3.4",+ "ts-api-utils": "^2.1.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "eslint": "^8.57.0 || ^9.0.0",+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/types": {+ "version": "8.41.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.41.0.tgz",+ "integrity": "sha512-9EwxsWdVqh42afLbHP90n2VdHaWU/oWgbH2P0CfcNfdKL7CuKpwMQGjwev56vWu9cSKU7FWSu6r9zck6CVfnag==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ }+ },+ "node_modules/@typescript-eslint/typescript-estree": {+ "version": "8.41.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-8.41.0.tgz",+ "integrity": "sha512-D43UwUYJmGhuwHfY7MtNKRZMmfd8+p/eNSfFe6tH5mbVDto+VQCayeAt35rOx3Cs6wxD16DQtIKw/YXxt5E0UQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/project-service": "8.41.0",+ "@typescript-eslint/tsconfig-utils": "8.41.0",+ "@typescript-eslint/types": "8.41.0",+ "@typescript-eslint/visitor-keys": "8.41.0",+ "debug": "^4.3.4",+ "fast-glob": "^3.3.2",+ "is-glob": "^4.0.3",+ "minimatch": "^9.0.4",+ "semver": "^7.6.0",+ "ts-api-utils": "^2.1.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/typescript-estree/node_modules/brace-expansion": {+ "version": "2.0.2",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.2.tgz",+ "integrity": "sha512-Jt0vHyM+jmUBqojB7E1NIYadt0vI0Qxjxd2TErW94wDz+E2LAm5vKMXXwg6ZZBTHPuUlDgQHKXvjGBdfcF1ZDQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "balanced-match": "^1.0.0"+ }+ },+ "node_modules/@typescript-eslint/typescript-estree/node_modules/minimatch": {+ "version": "9.0.5",+ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz",+ "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "brace-expansion": "^2.0.1"+ },+ "engines": {+ "node": ">=16 || 14 >=14.17"+ },+ "funding": {+ "url": "https://github.com/sponsors/isaacs"+ }+ },+ "node_modules/@typescript-eslint/utils": {+ "version": "8.41.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-8.41.0.tgz",+ "integrity": "sha512-udbCVstxZ5jiPIXrdH+BZWnPatjlYwJuJkDA4Tbo3WyYLh8NvB+h/bKeSZHDOFKfphsZYJQqaFtLeXEqurQn1A==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@eslint-community/eslint-utils": "^4.7.0",+ "@typescript-eslint/scope-manager": "8.41.0",+ "@typescript-eslint/types": "8.41.0",+ "@typescript-eslint/typescript-estree": "8.41.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "eslint": "^8.57.0 || ^9.0.0",+ "typescript": ">=4.8.4 <6.0.0"+ }+ },+ "node_modules/@typescript-eslint/visitor-keys": {+ "version": "8.41.0",+ "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.41.0.tgz",+ "integrity": "sha512-+GeGMebMCy0elMNg67LRNoVnUFPIm37iu5CmHESVx56/9Jsfdpsvbv605DQ81Pi/x11IdKUsS5nzgTYbCQU9fg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/types": "8.41.0",+ "eslint-visitor-keys": "^4.2.1"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ }+ },+ "node_modules/@typescript-eslint/visitor-keys/node_modules/eslint-visitor-keys": {+ "version": "4.2.1",+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",+ "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==",+ "dev": true,+ "license": "Apache-2.0",+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "url": "https://opencollective.com/eslint"+ }+ },"node_modules/accepts": {"version": "1.3.8","resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz",@@ -886,6 +1226,7 @@"resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz","integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==","dev": true,+ "license": "MIT","peerDependencies": {"acorn": "^6.0.0 || ^7.0.0 || ^8.0.0"}@@ -895,6 +1236,7 @@"resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz","integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==","dev": true,+ "license": "MIT","dependencies": {"fast-deep-equal": "^3.1.1","fast-json-stable-stringify": "^2.0.0",@@ -934,7 +1276,8 @@"version": "2.0.1","resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz","integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",- "dev": true+ "dev": true,+ "license": "Python-2.0"},"node_modules/array-flatten": {"version": "1.1.1",@@ -946,7 +1289,8 @@"version": "1.0.2","resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz","integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==",- "dev": true+ "dev": true,+ "license": "MIT"},"node_modules/body-parser": {"version": "1.20.3",@@ -988,15 +1332,29 @@"dev": true},"node_modules/brace-expansion": {- "version": "1.1.11",- "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz",- "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==",+ "version": "1.1.12",+ "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.12.tgz",+ "integrity": "sha512-9T9UjW3r0UW5c1Q7GTwllptXwhvYmEzFhzMfZ9H7FQWt+uZePjZPjBP/W1ZEyZ1twGWom5/56TF4lPcqjnDHcg==","dev": true,+ "license": "MIT","dependencies": {"balanced-match": "^1.0.0","concat-map": "0.0.1"}},+ "node_modules/braces": {+ "version": "3.0.3",+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",+ "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "fill-range": "^7.1.1"+ },+ "engines": {+ "node": ">=8"+ }+ },"node_modules/bytes": {"version": "3.1.2","resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz",@@ -1108,7 +1466,8 @@"version": "0.0.1","resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz","integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==",- "dev": true+ "dev": true,+ "license": "MIT"},"node_modules/content-disposition": {"version": "0.5.4",@@ -1285,21 +1644,23 @@}},"node_modules/eslint": {- "version": "9.20.1",- "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.20.1.tgz",- "integrity": "sha512-m1mM33o6dBUjxl2qb6wv6nGNwCAsns1eKtaQ4l/NPHeTvhiUPbtdfMyktxN4B3fgHIgsYh1VT3V9txblpQHq+g==",+ "version": "9.34.0",+ "resolved": "https://registry.npmjs.org/eslint/-/eslint-9.34.0.tgz",+ "integrity": "sha512-RNCHRX5EwdrESy3Jc9o8ie8Bog+PeYvvSR8sDGoZxNFTvZ4dlxUB3WzQ3bQMztFrSRODGrLLj8g6OFuGY/aiQg==","dev": true,+ "license": "MIT","dependencies": {"@eslint-community/eslint-utils": "^4.2.0","@eslint-community/regexpp": "^4.12.1",- "@eslint/config-array": "^0.19.0",- "@eslint/core": "^0.11.0",- "@eslint/eslintrc": "^3.2.0",- "@eslint/js": "9.20.0",- "@eslint/plugin-kit": "^0.2.5",+ "@eslint/config-array": "^0.21.0",+ "@eslint/config-helpers": "^0.3.1",+ "@eslint/core": "^0.15.2",+ "@eslint/eslintrc": "^3.3.1",+ "@eslint/js": "9.34.0",+ "@eslint/plugin-kit": "^0.3.5","@humanfs/node": "^0.16.6","@humanwhocodes/module-importer": "^1.0.1",- "@humanwhocodes/retry": "^0.4.1",+ "@humanwhocodes/retry": "^0.4.2","@types/estree": "^1.0.6","@types/json-schema": "^7.0.15","ajv": "^6.12.4",@@ -1307,9 +1668,9 @@"cross-spawn": "^7.0.6","debug": "^4.3.2","escape-string-regexp": "^4.0.0",- "eslint-scope": "^8.2.0",- "eslint-visitor-keys": "^4.2.0",- "espree": "^10.3.0",+ "eslint-scope": "^8.4.0",+ "eslint-visitor-keys": "^4.2.1",+ "espree": "^10.4.0","esquery": "^1.5.0","esutils": "^2.0.2","fast-deep-equal": "^3.1.3",@@ -1343,6 +1704,22 @@}}},+ "node_modules/eslint-config-prettier": {+ "version": "10.1.8",+ "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-10.1.8.tgz",+ "integrity": "sha512-82GZUjRS0p/jganf6q1rEO25VSoHH0hKPCTrgillPjdI/3bgBhAE1QzHrHTizjpRvy6pGAvKjDJtk2pF9NDq8w==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "eslint-config-prettier": "bin/cli.js"+ },+ "funding": {+ "url": "https://opencollective.com/eslint-config-prettier"+ },+ "peerDependencies": {+ "eslint": ">=7.0.0"+ }+ },"node_modules/eslint-plugin-playwright": {"version": "2.2.2","resolved": "https://registry.npmjs.org/eslint-plugin-playwright/-/eslint-plugin-playwright-2.2.2.tgz",@@ -1359,11 +1736,28 @@"eslint": ">=8.40.0"}},+ "node_modules/eslint-plugin-playwright/node_modules/globals": {+ "version": "13.24.0",+ "resolved": "https://registry.npmjs.org/globals/-/globals-13.24.0.tgz",+ "integrity": "sha512-AhO5QUcj8llrbG09iWhPU2B204J1xnPeL8kQmVorSsy+Sjj1sk8gIyh6cUocGmH4L0UuhAJy+hJMRA4mgA4mFQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "type-fest": "^0.20.2"+ },+ "engines": {+ "node": ">=8"+ },+ "funding": {+ "url": "https://github.com/sponsors/sindresorhus"+ }+ },"node_modules/eslint-scope": {- "version": "8.2.0",- "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.2.0.tgz",- "integrity": "sha512-PHlWUfG6lvPc3yvP5A4PNyBL1W8fkDUccmI21JUu/+GKZBoH/W5u6usENXUrWFRsyoW5ACUjFGgAFQp5gUlb/A==",+ "version": "8.4.0",+ "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz",+ "integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==","dev": true,+ "license": "BSD-2-Clause","dependencies": {"esrecurse": "^4.3.0","estraverse": "^5.2.0"@@ -1388,10 +1782,11 @@}},"node_modules/eslint/node_modules/eslint-visitor-keys": {- "version": "4.2.0",- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz",- "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==",+ "version": "4.2.1",+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",+ "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==","dev": true,+ "license": "Apache-2.0","engines": {"node": "^18.18.0 || ^20.9.0 || >=21.1.0"},@@ -1410,14 +1805,15 @@}},"node_modules/espree": {- "version": "10.3.0",- "resolved": "https://registry.npmjs.org/espree/-/espree-10.3.0.tgz",- "integrity": "sha512-0QYC8b24HWY8zjRnDTL6RiHfDbAWn63qb4LMj1Z4b076A4une81+z03Kg7l7mn/48PUTqoLptSXez8oknU8Clg==",+ "version": "10.4.0",+ "resolved": "https://registry.npmjs.org/espree/-/espree-10.4.0.tgz",+ "integrity": "sha512-j6PAQ2uUr79PZhBjP5C5fhl8e39FmRnOjsD5lGnWrFU8i2G776tBK7+nP8KuQUTTyAZUwfQqXAgrVH5MbH9CYQ==","dev": true,+ "license": "BSD-2-Clause","dependencies": {- "acorn": "^8.14.0",+ "acorn": "^8.15.0","acorn-jsx": "^5.3.2",- "eslint-visitor-keys": "^4.2.0"+ "eslint-visitor-keys": "^4.2.1"},"engines": {"node": "^18.18.0 || ^20.9.0 || >=21.1.0"@@ -1427,10 +1823,11 @@}},"node_modules/espree/node_modules/eslint-visitor-keys": {- "version": "4.2.0",- "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.0.tgz",- "integrity": "sha512-UyLnSehNt62FFhSwjZlHmeokpRK59rcz29j+F1/aDgbkbRTk7wIc9XzdoasMUbRNKDM0qQt/+BJ4BrpFeABemw==",+ "version": "4.2.1",+ "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-4.2.1.tgz",+ "integrity": "sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==","dev": true,+ "license": "Apache-2.0","engines": {"node": "^18.18.0 || ^20.9.0 || >=21.1.0"},@@ -1455,6 +1852,7 @@"resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz","integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==","dev": true,+ "license": "BSD-2-Clause","dependencies": {"estraverse": "^5.2.0"},@@ -1560,13 +1958,45 @@"version": "3.1.3","resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz","integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==",- "dev": true+ "dev": true,+ "license": "MIT"+ },+ "node_modules/fast-glob": {+ "version": "3.3.3",+ "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.3.tgz",+ "integrity": "sha512-7MptL8U0cqcFdzIzwOTHoilX9x5BrNqye7Z/LuC7kCMRio1EMSyqRK3BEAUD7sXRq4iT4AzTVuZdhgQ2TCvYLg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@nodelib/fs.stat": "^2.0.2",+ "@nodelib/fs.walk": "^1.2.3",+ "glob-parent": "^5.1.2",+ "merge2": "^1.3.0",+ "micromatch": "^4.0.8"+ },+ "engines": {+ "node": ">=8.6.0"+ }+ },+ "node_modules/fast-glob/node_modules/glob-parent": {+ "version": "5.1.2",+ "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz",+ "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "is-glob": "^4.0.1"+ },+ "engines": {+ "node": ">= 6"+ }},"node_modules/fast-json-stable-stringify": {"version": "2.1.0","resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz","integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==",- "dev": true+ "dev": true,+ "license": "MIT"},"node_modules/fast-levenshtein": {"version": "2.0.6",@@ -1574,6 +2004,16 @@"integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==","dev": true},+ "node_modules/fastq": {+ "version": "1.19.1",+ "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz",+ "integrity": "sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==",+ "dev": true,+ "license": "ISC",+ "dependencies": {+ "reusify": "^1.0.4"+ }+ },"node_modules/file-entry-cache": {"version": "8.0.0","resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-8.0.0.tgz",@@ -1586,6 +2026,19 @@"node": ">=16.0.0"}},+ "node_modules/fill-range": {+ "version": "7.1.1",+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",+ "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "to-regex-range": "^5.0.1"+ },+ "engines": {+ "node": ">=8"+ }+ },"node_modules/finalhandler": {"version": "1.3.1","resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.3.1.tgz",@@ -1753,15 +2206,13 @@}},"node_modules/globals": {- "version": "13.23.0",- "resolved": "https://registry.npmjs.org/globals/-/globals-13.23.0.tgz",- "integrity": "sha512-XAmF0RjlrjY23MA51q3HltdlGxUpXPvg0GioKiD9X6HD28iMjo2dKC8Vqwm7lne4GNr78+RHTfliktR6ZH09wA==",+ "version": "16.3.0",+ "resolved": "https://registry.npmjs.org/globals/-/globals-16.3.0.tgz",+ "integrity": "sha512-bqWEnJ1Nt3neqx2q5SFfGS8r/ahumIakg3HcwtNlrVlwXIeNumWn/c7Pn/wKzGhf6SaW6H6uWXLqC30STCMchQ==","dev": true,- "dependencies": {- "type-fest": "^0.20.2"- },+ "license": "MIT","engines": {- "node": ">=8"+ "node": ">=18"},"funding": {"url": "https://github.com/sponsors/sindresorhus"@@ -1779,6 +2230,13 @@"url": "https://github.com/sponsors/ljharb"}},+ "node_modules/graphemer": {+ "version": "1.4.0",+ "resolved": "https://registry.npmjs.org/graphemer/-/graphemer-1.4.0.tgz",+ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==",+ "dev": true,+ "license": "MIT"+ },"node_modules/has-flag": {"version": "4.0.0","resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz",@@ -1845,6 +2303,7 @@"resolved": "https://registry.npmjs.org/ignore/-/ignore-5.3.2.tgz","integrity": "sha512-hsBTNUqQTDwkWtcdYI2i06Y/nUBEsNEDJKjWdigLvegy8kDuJAS8uRlpkkcQpyEXL0Z/pjDy5HBmMjRCJ2gq+g==","dev": true,+ "license": "MIT","engines": {"node": ">= 4"}@@ -1854,6 +2313,7 @@"resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.1.tgz","integrity": "sha512-TR3KfrTZTYLPB6jUjfx6MF9WcWrHL9su5TObK4ZkYgBdWKPOFoSoQIdEuTuR82pmtxH2spWG9h6etwfr1pLBqQ==","dev": true,+ "license": "MIT","dependencies": {"parent-module": "^1.0.0","resolve-from": "^4.0.0"@@ -1919,6 +2379,16 @@"node": ">=0.10.0"}},+ "node_modules/is-number": {+ "version": "7.0.0",+ "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz",+ "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=0.12.0"+ }+ },"node_modules/is-observable": {"version": "2.1.0","resolved": "https://registry.npmjs.org/is-observable/-/is-observable-2.1.0.tgz",@@ -1942,6 +2412,7 @@"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz","integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==","dev": true,+ "license": "MIT","dependencies": {"argparse": "^2.0.1"},@@ -1959,7 +2430,8 @@"version": "0.4.1","resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz","integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==",- "dev": true+ "dev": true,+ "license": "MIT"},"node_modules/json-stable-stringify-without-jsonify": {"version": "1.0.1",@@ -2048,6 +2520,16 @@"url": "https://github.com/sponsors/sindresorhus"}},+ "node_modules/merge2": {+ "version": "1.4.1",+ "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz",+ "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">= 8"+ }+ },"node_modules/methods": {"version": "1.1.2","resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz",@@ -2057,6 +2539,33 @@"node": ">= 0.6"}},+ "node_modules/micromatch": {+ "version": "4.0.8",+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",+ "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "braces": "^3.0.3",+ "picomatch": "^2.3.1"+ },+ "engines": {+ "node": ">=8.6"+ }+ },+ "node_modules/micromatch/node_modules/picomatch": {+ "version": "2.3.1",+ "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz",+ "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=8.6"+ },+ "funding": {+ "url": "https://github.com/sponsors/jonschlinkert"+ }+ },"node_modules/mime": {"version": "1.6.0","resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz",@@ -2095,6 +2604,7 @@"resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz","integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==","dev": true,+ "license": "ISC","dependencies": {"brace-expansion": "^1.1.7"},@@ -2218,6 +2728,7 @@"resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz","integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==","dev": true,+ "license": "MIT","dependencies": {"callsites": "^3.0.0"},@@ -2326,6 +2837,22 @@"node": ">= 0.8.0"}},+ "node_modules/prettier": {+ "version": "3.6.2",+ "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.6.2.tgz",+ "integrity": "sha512-I7AIg5boAr5R0FFtJ6rCfD+LFsWHp81dolrFD8S79U9tb8Az2nGrJncnMSnys+bpQJfRUzqs9hnA81OAA3hCuQ==",+ "dev": true,+ "license": "MIT",+ "bin": {+ "prettier": "bin/prettier.cjs"+ },+ "engines": {+ "node": ">=14"+ },+ "funding": {+ "url": "https://github.com/prettier/prettier?sponsor=1"+ }+ },"node_modules/proxy-addr": {"version": "2.0.7","resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz",@@ -2344,6 +2871,7 @@"resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz","integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==","dev": true,+ "license": "MIT","engines": {"node": ">=6"}@@ -2363,6 +2891,27 @@"url": "https://github.com/sponsors/ljharb"}},+ "node_modules/queue-microtask": {+ "version": "1.2.3",+ "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz",+ "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT"+ },"node_modules/range-parser": {"version": "1.2.1","resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz",@@ -2405,10 +2954,22 @@"resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz","integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==","dev": true,+ "license": "MIT","engines": {"node": ">=4"}},+ "node_modules/reusify": {+ "version": "1.1.0",+ "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.1.0.tgz",+ "integrity": "sha512-g6QUff04oZpHs0eG5p83rFLhHeV00ug/Yf9nZM6fLeUrPguBTkTQOdpAWWspMh55TZfVQDPaN3NQJfbVRAxdIw==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "iojs": ">=1.0.0",+ "node": ">=0.10.0"+ }+ },"node_modules/rollup": {"version": "4.41.1","resolved": "https://registry.npmjs.org/rollup/-/rollup-4.41.1.tgz",@@ -2448,6 +3009,30 @@"fsevents": "~2.3.2"}},+ "node_modules/run-parallel": {+ "version": "1.2.0",+ "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz",+ "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==",+ "dev": true,+ "funding": [+ {+ "type": "github",+ "url": "https://github.com/sponsors/feross"+ },+ {+ "type": "patreon",+ "url": "https://www.patreon.com/feross"+ },+ {+ "type": "consulting",+ "url": "https://feross.org/support"+ }+ ],+ "license": "MIT",+ "dependencies": {+ "queue-microtask": "^1.2.2"+ }+ },"node_modules/safe-buffer": {"version": "5.2.1","resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",@@ -2474,6 +3059,19 @@"integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==","dev": true},+ "node_modules/semver": {+ "version": "7.7.2",+ "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz",+ "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==",+ "dev": true,+ "license": "ISC",+ "bin": {+ "semver": "bin/semver.js"+ },+ "engines": {+ "node": ">=10"+ }+ },"node_modules/send": {"version": "0.19.0","resolved": "https://registry.npmjs.org/send/-/send-0.19.0.tgz",@@ -2676,6 +3274,7 @@"resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz","integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==","dev": true,+ "license": "MIT","engines": {"node": ">=8"},@@ -2738,6 +3337,19 @@"tldts-core": "^7.0.12"}},+ "node_modules/to-regex-range": {+ "version": "5.0.1",+ "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz",+ "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "is-number": "^7.0.0"+ },+ "engines": {+ "node": ">=8.0"+ }+ },"node_modules/toidentifier": {"version": "1.0.1","resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz",@@ -2747,6 +3359,19 @@"node": ">=0.6"}},+ "node_modules/ts-api-utils": {+ "version": "2.1.0",+ "resolved": "https://registry.npmjs.org/ts-api-utils/-/ts-api-utils-2.1.0.tgz",+ "integrity": "sha512-CUgTZL1irw8u29bzrOD/nH85jqyc74D6SshFgujOIA7osm2Rz7dYH77agkx7H4FBNxDq7Cjf+IjaX/8zwFW+ZQ==",+ "dev": true,+ "license": "MIT",+ "engines": {+ "node": ">=18.12"+ },+ "peerDependencies": {+ "typescript": ">=4.8.4"+ }+ },"node_modules/type-check": {"version": "0.4.0","resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz",@@ -2764,6 +3389,7 @@"resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz","integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==","dev": true,+ "license": "(MIT OR CC0-1.0)","engines": {"node": ">=10"},@@ -2784,6 +3410,44 @@"node": ">= 0.6"}},+ "node_modules/typescript": {+ "version": "5.9.2",+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.9.2.tgz",+ "integrity": "sha512-CWBzXQrc/qOkhidw1OzBTQuYRbfyxDXJMVJ1XNwUHGROVmuaeiEm3OslpZ1RV96d7SKKjZKrSJu3+t/xlw3R9A==",+ "dev": true,+ "license": "Apache-2.0",+ "bin": {+ "tsc": "bin/tsc",+ "tsserver": "bin/tsserver"+ },+ "engines": {+ "node": ">=14.17"+ }+ },+ "node_modules/typescript-eslint": {+ "version": "8.41.0",+ "resolved": "https://registry.npmjs.org/typescript-eslint/-/typescript-eslint-8.41.0.tgz",+ "integrity": "sha512-n66rzs5OBXW3SFSnZHr2T685q1i4ODm2nulFJhMZBotaTavsS8TrI3d7bDlRSs9yWo7HmyWrN9qDu14Qv7Y0Dw==",+ "dev": true,+ "license": "MIT",+ "dependencies": {+ "@typescript-eslint/eslint-plugin": "8.41.0",+ "@typescript-eslint/parser": "8.41.0",+ "@typescript-eslint/typescript-estree": "8.41.0",+ "@typescript-eslint/utils": "8.41.0"+ },+ "engines": {+ "node": "^18.18.0 || ^20.9.0 || >=21.1.0"+ },+ "funding": {+ "type": "opencollective",+ "url": "https://opencollective.com/typescript-eslint"+ },+ "peerDependencies": {+ "eslint": "^8.57.0 || ^9.0.0",+ "typescript": ">=4.8.4 <6.0.0"+ }+ },"node_modules/undici-types": {"version": "6.20.0","resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.20.0.tgz",@@ -2804,6 +3468,7 @@"resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz","integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==","dev": true,+ "license": "BSD-2-Clause","dependencies": {"punycode": "^2.1.0"}diff --git a/tracker/package.json b/tracker/package.jsonindex f412787b51..68e9a5768c 100644--- a/tracker/package.json+++ b/tracker/package.json@@ -1,7 +1,9 @@{- "tracker_script_version": 30,+ "tracker_script_version": 31,"type": "module","scripts": {+ "lint": "eslint",+ "check-format": "prettier --check \"**/*.{js,mjs,ts,html,json,md}\"","deploy": "node compile.js","test": "npx playwright test","test:local": "npx playwright test",@@ -24,11 +26,17 @@"threads": "^1.7.0"},"devDependencies": {+ "@eslint/js": "^9.34.0","@playwright/test": "^1.52.0","@types/node": "^22.13.4",- "eslint": "^9.20.1",+ "eslint": "^9.34.0",+ "eslint-config-prettier": "^10.1.8","eslint-plugin-playwright": "^2.2.2","express": "^4.21.2",- "markdown-table": "^3.0.4"+ "globals": "^16.3.0",+ "markdown-table": "^3.0.4",+ "prettier": "^3.3.3",+ "typescript": "^5.9.2",+ "typescript-eslint": "^8.41.0"}}diff --git a/tracker/src/autocapture.js b/tracker/src/autocapture.jsindex 12f0883d4b..6a7d2aee27 100644--- a/tracker/src/autocapture.js+++ b/tracker/src/autocapture.js@@ -1,4 +1,4 @@-import { config, location, document } from './config'+import { config } from './config'export function init(track) {var lastPage;diff --git a/tracker/src/config.js b/tracker/src/config.jsindex f73edc249b..9e516c2968 100644--- a/tracker/src/config.js+++ b/tracker/src/config.js@@ -1,9 +1,7 @@-var location = window.location-var document = window.document-if (COMPILE_COMPAT) {var scriptEl = document.getElementById('plausible')} else if (COMPILE_PLAUSIBLE_LEGACY_VARIANT) {+ // eslint-disable-next-line no-redeclarevar scriptEl = document.currentScript}@@ -65,4 +63,4 @@ export function init(options) {}}-export { config, scriptEl, location, document }+export { config, scriptEl }diff --git a/tracker/src/custom-events.js b/tracker/src/custom-events.jsindex 399a5533d2..a9a67f9e28 100644--- a/tracker/src/custom-events.js+++ b/tracker/src/custom-events.js@@ -1,5 +1,6 @@-// Code for tracking tagged events, form submissions, file downloads and outbound links-import { config, scriptEl, location, document } from './config'+// This file has the logic for tracking tagged events, form submissions, file downloads and outbound links.++import { config, scriptEl } from './config'import { track } from './track'export var DEFAULT_FILE_TYPES = ['pdf', 'xlsx', 'docx', 'txt', 'rtf', 'csv', 'exe', 'key', 'pps', 'ppt', 'pptx', '7z', 'pkg', 'rar', 'gz', 'zip', 'avi', 'mov', 'mp4', 'mpeg', 'wmv', 'midi', 'mp3', 'wav', 'wma', 'dmg']@@ -61,9 +62,9 @@ function handleLinkClickEvent(event) {function sendLinkClickEvent(event, link, eventAttrs) {// In some legacy variants, this block delays opening the link up to 5 seconds,// or until analytics request finishes, otherwise navigation could prevent the analytics event from being sent.+ var attrsif (COMPILE_COMPAT) {var followedLink = false-function followLink() {if (!followedLink) {followedLink = true@@ -72,7 +73,7 @@ function sendLinkClickEvent(event, link, eventAttrs) {}if (shouldInterceptNavigation(event, link)) {- var attrs = { props: eventAttrs.props, callback: followLink }+ attrs = { props: eventAttrs.props, callback: followLink }if (COMPILE_REVENUE) {attrs.revenue = eventAttrs.revenue}@@ -80,14 +81,14 @@ function sendLinkClickEvent(event, link, eventAttrs) {setTimeout(followLink, 5000)event.preventDefault()} else {- var attrs = { props: eventAttrs.props }+ attrs = { props: eventAttrs.props }if (COMPILE_REVENUE) {attrs.revenue = eventAttrs.revenue}track(eventAttrs.name, attrs)}} else {- var attrs = { props: eventAttrs.props }+ attrs = { props: eventAttrs.props }if (COMPILE_REVENUE) {attrs.revenue = eventAttrs.revenue}@@ -139,10 +140,12 @@ function getTaggedEventAttributes(htmlElement) {for (var i = 0; i < classList.length; i++) {var className = classList.item(i)+ var key+ var valuevar matchList = className.match(/plausible-event-(.+)(=|--)(.+)/)if (matchList) {- var key = matchList[1]- var value = matchList[3].replace(/\+/g, ' ')+ key = matchList[1]+ value = matchList[3].replace(/\+/g, ' ')if (key.toLowerCase() == 'name') {eventAttrs.name = value@@ -154,8 +157,8 @@ function getTaggedEventAttributes(htmlElement) {if (COMPILE_REVENUE) {var revenueMatchList = className.match(/plausible-revenue-(.+)(=|--)(.+)/)if (revenueMatchList) {- var key = revenueMatchList[1]- var value = revenueMatchList[3]+ key = revenueMatchList[1]+ value = revenueMatchList[3]eventAttrs.revenue[key] = value}}@@ -206,7 +209,8 @@ export function init() {var form = event.targetvar eventAttrs = getTaggedEventAttributes(form)if (!eventAttrs.name) { return }-++ var attrs// In some legacy variants, this block delays submitting the form for up to 5 seconds,// or until analytics request finishes, otherwise form-related navigation could prevent the analytics event from being sent.if (COMPILE_COMPAT) {@@ -222,13 +226,13 @@ export function init() {setTimeout(submitForm, 5000)- var attrs = { props: eventAttrs.props, callback: submitForm }+ attrs = { props: eventAttrs.props, callback: submitForm }if (COMPILE_REVENUE) {attrs.revenue = eventAttrs.revenue}track(eventAttrs.name, attrs)} else {- var attrs = { props: eventAttrs.props }+ attrs = { props: eventAttrs.props }if (COMPILE_REVENUE) {attrs.revenue = eventAttrs.revenue}@@ -277,6 +281,7 @@ export function init() {}}}+document.addEventListener('submit', handleTaggedFormSubmitEvent)document.addEventListener('click', handleTaggedElementClickEvent)diff --git a/tracker/src/track.js b/tracker/src/track.jsindex 475e6b299a..464d7c232b 100644--- a/tracker/src/track.js+++ b/tracker/src/track.js@@ -1,6 +1,6 @@import { sendRequest } from './networking'import { prePageviewTrack, postPageviewTrack, onPageviewIgnored } from './engagement'-import { config, scriptEl, location, document } from './config'+import { config, scriptEl } from './config'export function track(eventName, options) {if (COMPILE_PLAUSIBLE_NPM && !config.isInitialized) {@@ -25,9 +25,10 @@ export function track(eventName, options) {if (window.localStorage.plausible_ignore === 'true') {return onIgnoredEvent(eventName, options, 'localStorage flag')}- } catch (e) {-+ } catch (_error) {+ // ignore error}+if (COMPILE_EXCLUSIONS) {var dataIncludeAttr = scriptEl && scriptEl.getAttribute('data-include')var dataExcludeAttr = scriptEl && scriptEl.getAttribute('data-exclude')@@ -39,6 +40,7 @@ export function track(eventName, options) {actualPath += location.hash}+ // eslint-disable-next-line no-useless-escapereturn actualPath.match(new RegExp('^' + wildcardPath.trim().replace(/\*\*/g, '.*').replace(/([^\.])\*/g, '$1[^\\s\/]*') + '\/?$'))}@@ -97,6 +99,7 @@ export function track(eventName, options) {// Track custom properties for pageviews and other eventsif (COMPILE_CUSTOM_PROPERTIES && config.customProperties) {+ // eslint-disable-next-line no-redeclarevar props = config.customPropertiesif (typeof props === 'function') {props = config.customProperties(eventName)diff --git a/tracker/test/callbacks.spec.ts b/tracker/test/callbacks.spec.tsindex e66015bd15..ffdaafdfc6 100644--- a/tracker/test/callbacks.spec.ts+++ b/tracker/test/callbacks.spec.ts@@ -1,5 +1,4 @@import { test, expect } from '@playwright/test'-import { LOCAL_SERVER_ADDR } from './support/server'import { initializePageDynamically } from './support/initialize-page-dynamically'import { mockManyRequests } from './support/mock-many-requests'import { switchByMode } from './support/test-utils'@@ -49,7 +48,7 @@ for (const mode of ['web', 'esm', 'legacy']) {expectedResult: undefined}]) {- test(name, async ({ page }, { testId }) => {+ test(`${name}`, async ({ page }, { testId }) => {const config = { domain: DOMAIN, endpoint: apiPath, captureOnLocalhost }const { url } = await initializePageDynamically(page, {testId,@@ -78,11 +77,12 @@ for (const mode of ['web', 'esm', 'legacy']) {mockRequestTimeout: 2000})await page.goto(url)- await page.waitForFunction(() => (window as any).plausible?.l)+ await page.waitForFunction(() => window.plausible?.l)const callbackResult = await page.evaluate(() =>new Promise((resolve) =>- (window as any).plausible('Purchase', {+ // @ts-expect-error - window.plausible is defined+ window.plausible('Purchase', {callback: (result) => resolve(result)}))diff --git a/tracker/test/custom-properties.spec.ts b/tracker/test/custom-properties.spec.tsindex 04c0564c8b..60971e64fd 100644--- a/tracker/test/custom-properties.spec.ts+++ b/tracker/test/custom-properties.spec.ts@@ -7,7 +7,6 @@ import {expectPlausibleInAction,hideAndShowCurrentTab,isEngagementEvent,- isPageviewEvent,switchByMode} from './support/test-utils'import { test } from '@playwright/test'diff --git a/tracker/test/file-downloads.spec.ts b/tracker/test/file-downloads.spec.tsindex 84ba2aaaf1..dd6192e863 100644--- a/tracker/test/file-downloads.spec.ts+++ b/tracker/test/file-downloads.spec.ts@@ -697,7 +697,7 @@ test.describe('file downloads feature when using legacy .compat extension', () =})}- test('if the tracking requests delays navigation for more than 5s, it navigates anyway, without waiting for the request to resolve ', async ({+ test('if the tracking requests delays navigation for more than 5s, it navigates anyway, without waiting for the request to resolve', async ({page}, { testId }) => {test.setTimeout(20000)diff --git a/tracker/test/hash-based-routing.spec.ts b/tracker/test/hash-based-routing.spec.tsindex 80d1c0763c..d9fda649ec 100644--- a/tracker/test/hash-based-routing.spec.ts+++ b/tracker/test/hash-based-routing.spec.ts@@ -3,9 +3,7 @@ import {e,expectPlausibleInAction,hideAndShowCurrentTab,- isEngagementEvent,switchByMode,- tracker_script_version} from './support/test-utils'import { test } from '@playwright/test'import { ScriptConfig } from './support/types'diff --git a/tracker/test/logging.spec.ts b/tracker/test/logging.spec.tsindex 20552bb641..dcc89d4cf9 100644--- a/tracker/test/logging.spec.ts+++ b/tracker/test/logging.spec.ts@@ -1,9 +1,7 @@import { initializePageDynamically } from './support/initialize-page-dynamically'import {expectPlausibleInAction,- isEngagementEvent,switchByMode,- tracker_script_version} from './support/test-utils'import { expect, test } from '@playwright/test'import { ScriptConfig } from './support/types'@@ -17,7 +15,7 @@ const DEFAULT_CONFIG: ScriptConfig = {for (const mode of ['web', 'esm']) {test.describe(`respects "logging" v2 config option (${mode})`, () => {- test('if logging is not explicitly set, it is treated as true and logs are emitted on ingored events', async ({+ test('if logging is not explicitly set, it is treated as true and logs are emitted on ignored events', async ({page}, { testId }) => {const config = { ...DEFAULT_CONFIG }@@ -50,7 +48,7 @@ for (const mode of ['web', 'esm']) {])})- test('if logging is explicitly set to false, logs are not emitted on ingored events', async ({+ test('if logging is explicitly set to false, logs are not emitted on ignored events', async ({page}, { testId }) => {const config = { ...DEFAULT_CONFIG, logging: false }diff --git a/tracker/test/outbound-links.spec.ts b/tracker/test/outbound-links.spec.tsindex bcbe31026e..b9f3166700 100644--- a/tracker/test/outbound-links.spec.ts+++ b/tracker/test/outbound-links.spec.ts@@ -429,7 +429,7 @@ test.describe('outbound links feature when using legacy .compat extension', () =])})- test('if the tracking requests delays navigation for more than 5s, it navigates anyway, without waiting for the request to resolve ', async ({+ test('if the tracking requests delays navigation for more than 5s, it navigates anyway, without waiting for the request to resolve', async ({page}, { testId }) => {test.setTimeout(20000)diff --git a/tracker/test/plausible-npm-init.spec.ts b/tracker/test/plausible-npm-init.spec.tsindex 0093d6813b..832835150e 100644--- a/tracker/test/plausible-npm-init.spec.ts+++ b/tracker/test/plausible-npm-init.spec.ts@@ -14,6 +14,18 @@ const DEFAULT_CONFIG = {captureOnLocalhost: true}+declare global {+ interface Window {+ init: (...args: unknown[]) => void+ track: (eventName: string, options?: unknown) => void+ plausible?: {+ l: boolean+ v: string+ s: string+ }+ }+}+test('if `init` is called without domain, it throws', async ({ page }, {testId}) => {@@ -25,7 +37,7 @@ test('if `init` is called without domain, it throws', async ({ page }, {await page.goto(url)const config = { ...DEFAULT_CONFIG, domain: undefined }await expect(- page.evaluate((config) => (window as any).init(config), { config })+ page.evaluate((config) => window.init(config), { config })).rejects.toThrow('plausible.init(): domain argument is required')})@@ -38,7 +50,7 @@ test('if `init` is called with no configuration, it throws', async ({ page }, {bodyContent: 'body'})await page.goto(url)- await expect(page.evaluate(() => (window as any).init())).rejects.toThrow(+ await expect(page.evaluate(() => window.init())).rejects.toThrow('plausible.init(): domain argument is required')})@@ -53,7 +65,7 @@ test('if `track` is called before `init`, it throws', async ({ page }, {})await page.goto(url)await expect(- page.evaluate(() => (window as any).track('purchase'))+ page.evaluate(() => window.track('purchase'))).rejects.toThrow('plausible.track() can only be called after plausible.init()')@@ -80,7 +92,7 @@ test('if `init` is called twice, it throws, but tracking still works', async ({})await expect(- page.evaluate((config) => (window as any).init(config), config)+ page.evaluate((config) => window.init(config), config)).rejects.toThrow('plausible.init() can only be called once')await expectPlausibleInAction(page, {@@ -110,15 +122,15 @@ test('`bindToWindow` is true by default, and plausible is attached to window', aexpectedRequests: [{ n: 'pageview' }]})await expect(- page.waitForFunction(() => (window as any).plausible?.l !== undefined)+ page.waitForFunction(() => window.plausible?.l !== undefined)).resolves.toBeTruthy()await expect(page.evaluate(() => {- if ((window as any).plausible?.l) {+ if (window.plausible?.l) {return {- l: (window as any).plausible.l,- v: (window as any).plausible.v,- s: (window as any).plausible.s+ l: window.plausible.l,+ v: window.plausible.v,+ s: window.plausible.s}}return false@@ -126,7 +138,7 @@ test('`bindToWindow` is true by default, and plausible is attached to window', a).resolves.toEqual({ l: true, v: tracker_script_version, s: 'npm' })})-test('if `bindToWindow` is false, `plausible` is not attached to window', async ({+test('if `bindToWindow` is false, plausible is not attached to window', async ({page}, { testId }) => {const config = { ...DEFAULT_CONFIG, bindToWindow: false }@@ -148,7 +160,7 @@ test('if `bindToWindow` is false, `plausible` is not attached to window', asyncawait expect(page.waitForFunction(- () => (window as any).plausible !== undefined,+ () => window.plausible !== undefined,undefined,{timeout: 1000diff --git a/tracker/test/plausible-web-init.spec.ts b/tracker/test/plausible-web-init.spec.tsindex 5c8de75a6e..e95c9b4cfb 100644--- a/tracker/test/plausible-web-init.spec.ts+++ b/tracker/test/plausible-web-init.spec.ts@@ -69,7 +69,8 @@ test('handles double-initialization of the script with a console.warn', async ({await expect(page.evaluate(() =>- (window as any).plausible.init({+ // @ts-expect-error - window.plausible is defined+ window.plausible.init({captureOnLocalhost: true,customProperties: { init: 2 }})diff --git a/tracker/test/scroll-depth.spec.js b/tracker/test/scroll-depth.spec.jsindex f3ca6ea445..1b648a28d2 100644--- a/tracker/test/scroll-depth.spec.js+++ b/tracker/test/scroll-depth.spec.js@@ -1,5 +1,5 @@import { expectPlausibleInAction, hideCurrentTab, hideAndShowCurrentTab } from './support/test-utils'-import { test } from '@playwright/test'+import { test, expect } from '@playwright/test'import { LOCAL_SERVER_ADDR } from './support/server'test.describe('scroll depth (engagement events)', () => {@@ -89,7 +89,7 @@ test.describe('scroll depth (engagement events)', () => {await page.evaluate(() => window.scrollBy(0, document.body.scrollHeight))// Wait until documentHeight gets increased by the fixture JS- await page.waitForSelector('#more-content')+ await expect(page.getByText('Navigate away')).toBeVisible()await page.evaluate(() => window.scrollBy(0, 1000))diff --git a/tracker/test/support/initialize-page-dynamically.ts b/tracker/test/support/initialize-page-dynamically.tsindex d1f8f132f1..14a3a98249 100644--- a/tracker/test/support/initialize-page-dynamically.ts+++ b/tracker/test/support/initialize-page-dynamically.ts@@ -48,7 +48,7 @@ const PLAUSIBLE_WEB_SNIPPET = `</script>`-export function serializeWithFunctions(obj: Record<string, any>): string {+export function serializeWithFunctions(obj: Record<string, unknown>): string {const functions: Record<string, string> = {}let counter = 0diff --git a/tracker/test/support/installation-support-playwright-wrappers.ts b/tracker/test/support/installation-support-playwright-wrappers.tsindex 93d0109091..788eacdc2d 100644--- a/tracker/test/support/installation-support-playwright-wrappers.ts+++ b/tracker/test/support/installation-support-playwright-wrappers.ts@@ -25,7 +25,8 @@ export async function executeVerifyV2(async function verify() {await page.evaluate(verifierCode) // injects window.verifyPlausibleInstallationreturn await page.evaluate(- (c) => {return (window as any).verifyPlausibleInstallation(c)},+ // @ts-expect-error - window.verifyPlausibleInstallation has been injected+ (c) => {return window.verifyPlausibleInstallation(c)},{...functionContext, responseHeaders});}@@ -78,7 +79,8 @@ export async function verifyV1(page, context) {return await page.evaluate(async ({ expectedDataDomain, debug }) => {- return await (window as any).verifyPlausibleInstallation(+ // @ts-expect-error - window.verifyPlausibleInstallation has been injected+ return await window.verifyPlausibleInstallation(expectedDataDomain,debug)@@ -100,7 +102,8 @@ export async function detect(page, context) {return await page.evaluate(async (d) => {- return await (window as any).scanPageBeforePlausibleInstallation(d)+ // @ts-expect-error - window.scanPageBeforePlausibleInstallation has been injected+ return await window.scanPageBeforePlausibleInstallation(d)},{ detectV1, debug, timeoutMs })diff --git a/tracker/test/support/types.ts b/tracker/test/support/types.tsindex 9684c57dc5..128c64fce8 100644--- a/tracker/test/support/types.ts+++ b/tracker/test/support/types.ts@@ -6,8 +6,8 @@ export type Options = {captureOnLocalhost: booleanautoCapturePageviews: booleancustomProperties:- | Record<string, any>- | ((eventName: string) => Record<string, any>)+ | Record<string, unknown>+ | ((eventName: string) => Record<string, unknown>)transformRequest: (payload: unknown) => unknownlogging: boolean}@@ -46,6 +46,7 @@ export type VerifyV2Result = {data:| {completed: true+ attempts: numberplausibleIsOnWindow: booleanplausibleIsInitialized: booleanplausibleVersion: number@@ -57,7 +58,7 @@ export type VerifyV2Result = {/*** window.plausible (track) callback*/- callbackResult?: any+ callbackResult?: unknown/*** intercepted fetch response status*/diff --git a/tracker/test/tagged-events.spec.ts b/tracker/test/tagged-events.spec.tsindex 5d9b694e62..e807616a38 100644--- a/tracker/test/tagged-events.spec.ts+++ b/tracker/test/tagged-events.spec.ts@@ -324,7 +324,7 @@ for (const mode of ['legacy', 'web']) {return new Promise((resolve) => {let taggedElementwhile (!taggedElement) {- if ((window as any).plausible?.l !== true) {+ if (window.plausible?.l !== true) {continue} else {taggedElement = document.createElement('button')diff --git a/tracker/test/transform_request.spec.ts b/tracker/test/transform_request.spec.tsindex 12989118e6..6bbf588d13 100644--- a/tracker/test/transform_request.spec.ts+++ b/tracker/test/transform_request.spec.ts@@ -7,7 +7,6 @@ import {expectPlausibleInAction,hideAndShowCurrentTab,isEngagementEvent,- isPageviewEvent,switchByMode} from './support/test-utils'import { test } from '@playwright/test'@@ -143,9 +142,10 @@ for (const mode of ['web', 'esm']) {const config = {...DEFAULT_CONFIG,transformRequest: (payload) => {- const w = window as any- w.requestCount = (w.requestCount ?? 0) + 1- return { ...payload, p: { requestCount: w.requestCount } }+ // @ts-expect-error - defines window.requestCount+ window.requestCount = (window.requestCount ?? 0) + 1+ // @ts-expect-error - window.requestCount is defined+ return { ...payload, p: { requestCount: window.requestCount } }}}