Commit Graph
92 Commits
Author SHA1 Message Date
Andrew Rumble 05423f1a1d Merge pull request #34344 from overleaf/copilot/convert-fetch-utils-to-es-modules
Convert @overleaf/fetch-utils to TypeScript ESM with Vitest, enable noImplicitAny, fix downstream regressions, and align buildscript generation

GitOrigin-RevId: e060152f056cbae31da0650fb22471525835bd5e
2026-09-17 11:24:05 +00:00
Andrew Rumble 152004a600 Merge pull request #35095 from overleaf/lg-node-24-17-platform-compat
[Node 24.17.0][Platform packages] Fix node-fetch keep-alive false positive and bump clsi yauzl for Node 24.17

GitOrigin-RevId: 9e0382533d45e1e3b3ed88d4ccfc577591666e10
2026-09-17 11:24:02 +00:00
John Lees-Miller e4dd97936a Remove mirror-documentation job (#35399)
* Remove mirror-documentation job

* Update yarn.lock after removing mirror-documentation

GitOrigin-RevId: b6be94f44ff4d2aaeda14798f7232cf89a54eeee
2026-09-17 11:23:23 +00:00
Andrew Rumble 5a602e1b1d Merge pull request #35290 from overleaf/ar-stop-using-unix-formatter-locally
[monorepo] switch from unix to stylish formatter for lint

GitOrigin-RevId: e3c84e556941b4747e469a123a99d5731697976d
2026-09-17 11:21:32 +00:00
Domagoj Kriskovic 6a736ecc62 refactor(third-party-references): replace simple-oauth2 with a custom OAuth2 client (#34917)
* [3rd-party-references] replace simple-oauth2 with openid-client

* Refactor OAuth2 handling: replace openid-client with custom OAuth2Client implementation

* Guard unconfigured OAuth2 providers with a controlled error

Providers whose client id/secret env vars are unset now stay registered
but without an OAuth2 client. Using one throws a controlled OError
("OAuth2 provider is not configured") from getOAuth2Client rather than a
TypeError from calling a method on undefined or sending "undefined"
credentials.

* Guard unconfigured OAuth2 providers with a controlled error

* Add clarification comments on OAuth 2.0 client ID and secret encoding requirements

* Add logging for invalid token expiration dates in parseToken function

GitOrigin-RevId: b17884ccba171ff4db8e6a698b3d4dcdca24e8ae
2026-09-17 11:21:13 +00:00
Jakob Ackermann 926b7c534b [agents] allow running all the test-runner skill commands (#35247)
* [agents] allow running all the test-runner skill commands

* [agents] move linting into AGENTS.md

* [agents] double down on permissions and cwd

* [saas-e2e] add support for MOCHA_GREP

* [saas-e2e] fail fast by default outside CI

* [agents] avoid need for Codespace detection

* [agents] work around missing trust prompt in Codespaces

* [saas-e2e] e2e_test_setup: merge split-tests in dev-env

GitOrigin-RevId: f1c1cd2a732e98b2e6125ef86a2b2cda5d3aabb6
2026-09-17 11:20:53 +00:00
Kristina 1765f6be51 Merge pull request #35223 from overleaf/lg-linkify-it-security-upgrade
[Security upgrade] bump linkify-it to patched version via resolutions

GitOrigin-RevId: a3e689de7d4842c00b2d6d5ac7631224ce76ad1a
2026-09-17 11:20:41 +00:00
Tim Down 6ed39f18b7 Merge pull request #17214 from overleaf/td-latexqc-remove-babel-polyfill
Remove @babel/polyfill from latexqc service

GitOrigin-RevId: 5d649b14ade41fc2fce350419443f6db71e9d161
2026-09-17 11:20:38 +00:00
Lucie GermainandClaude Opus 4.8 cc741ec2f1 [Security upgrade] bump multer 2.1.1 -> 2.2.0 (web + clsi) (#34916)
GHSA-72gw-mp4g-v24j / CVE-2026-5079 — DoS via deeply nested field names,
patched in 2.2.0. multer is a direct dep of web and clsi (file uploads).

- bump multer to 2.2.0 in services/web and services/clsi
- re-target the Overleaf local patch (attach files with no filename as
  'undefined' instead of skipping) from 2.1.1 to 2.2.0, kept as a scoped
  root resolution to match the repo's patch convention

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
GitOrigin-RevId: 0d10137b521ebaacee71fc41adba32c4530a4041
2026-09-17 11:19:49 +00:00
Lucie GermainandClaude Sonnet 4.6 acdec8dd6b [Node 24.17.0][Core packages] Bump yauzl to ^3.4.0 in history-v1 and web for Node 24.17 (#35093)
* Bump yauzl to ^3.4.0 in history-v1 and web for Node 24.17

yauzl 3.x hangs extracting a large zip entry under Node 24.17 due to
stream backpressure changes. Fixes zip/project uploads, open-in-overleaf
template tests, and the SaaS-E2E "templates" test.

Also fix the open-in-overleaf acceptance test mock to serve the "too large"
fixture with a single res.end (Content-Length) instead of a backpressure-
ignoring res.write loop, which Node 24.17 surfaces as ECONNRESET (404)
instead of the expected 422.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Use plainTextResponse for large-file test fixture

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
GitOrigin-RevId: 55627b7c2c91959f0d1a7f3419467455edb06c9f
2026-09-17 11:19:46 +00:00
Jakob Ackermann 0354f03612 [eslint-plugin] integrate with build scripts (#35176)
GitOrigin-RevId: cc042f70981da3862f2660c695193190b0c62000
2026-09-17 11:19:04 +00:00
Lucie GermainandClaude Opus 4.8 d2c848320e [Security upgrade] bump js-yaml to 4.2.0 in root workspace (#34925)
* [Security upgrade] bump js-yaml 4.1.1 -> 4.2.0 in root workspace

GHSA-h67p-54hq-rp68, patched in 4.2.0. js-yaml 4.x is pulled at runtime via
the patched referer-parser (web) plus many dev/build consumers.

Bumped the existing scoped resolution referer-parser/js-yaml ^4.1.1 -> ^4.2.0
(security floor on the patched-parent path) and re-resolved all 4.x to 4.2.0
(yarn up -R). The js-yaml 3.x line (3.14.2) is a different major, unaffected.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Bump js-yaml range in referer-parser patch to ^4.2.0 for consistency

The referer-parser/js-yaml resolution override forces js-yaml to 4.2.0,
but the local patch still declared ^4.1.0. Align the patch's declared
range with the resolution. Addresses Jakob's review comment on #34695
(discussion_r3440549168).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Make patched-parent realignment a mandatory Type B step in yarn-security-update skill

The patch-realignment instruction was a soft 'for consistency' parenthetical;
a session reading the rule acted only on 'use a resolution' and dropped the
patch edit, leaving the resolution at ^4.2.0 while the referer-parser patch
still declared ^4.1.0 (PR #34925). Promote it to an explicit mandatory step.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Fully resolve js-yaml to 4.2.0 and stop patching its range in referer-parser

Add a scoped resolution for @istanbuljs/load-nyc-config/js-yaml so the last
sub-4.2.0 instance (3.14.2, GHSA-h67p-54hq-rp68) is forced to 4.2.0 too;
load-nyc-config uses js-yaml.load(), which is 4.x-compatible.

Drop the js-yaml and mocha dependency edits from the referer-parser patch:
editing a patched package's dependencies has no effect on resolution, so the
scoped resolution is the entire fix. Update the yarn-security-update skill to
match (patched parents route to Type B; do not edit the patch).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

* Combine js-yaml resolutions into a single global override

Replace the two scoped js-yaml resolutions (referer-parser/js-yaml and
@istanbuljs/load-nyc-config/js-yaml) with one global "js-yaml": "^4.2.0". Every
js-yaml consumer should reach the security floor and none needs an older major,
so the global override is equivalent and tidier (reviewer request).

Note the scoped-vs-global tradeoff in the yarn-security-update skill.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
GitOrigin-RevId: 1738cbc04f4cacbfb6880ba6f176a192aa4a03f7
2026-09-17 11:17:55 +00:00
Jakob Ackermann 966728d5a2 [clsi-lb] add health check and alerting for stalled poll loop (#35117)
* [clsi-lb] add settings entry for pollInterval

* [clsi-lb] add health check and alerting for stalled poll loop

* [k8s] clsi-lb: switch livenessProbe to config writer

* Revert "[k8s] clsi-lb: switch livenessProbe to config writer"

This reverts commit ae0c8624528db4bdf35a27fac836ffeecfc1682c.

* [clsi-lb] fix docker build

* [clsi-lb] throw when app.listen fails

* [clsi-lb] expose gc

* [clsi-lb] refactor lastPolledAt to Date

GitOrigin-RevId: 88542d9c10d5f63a4283ffab32badcdea1d3a95a
2026-09-17 11:16:48 +00:00
Lucie Germain a897780ca7 [Security upgrade] bump tmp to 0.2.7 in root yarn.lock (#34641)
GitOrigin-RevId: cc473f209393f9f44a1ef5ed6be1f840f22d6f07
2026-09-17 11:16:38 +00:00
Anna Claire Fields bdcb79c6fe third party code inventory changes (#34732)
GitOrigin-RevId: dc691ec60ade749b2fa9a14fac857840589d34ea
2026-09-17 11:16:31 +00:00
Chris Dryden 5778239fe2 Merge pull request #34953 from overleaf/cd-migrate-tpds-to-esm
Migrate `third-party-datastore` service from CommonJS to ESM syntax

GitOrigin-RevId: 5f1bbe827a0fd21c5ddb0be0e2cddce7d4f59a83
2026-09-17 11:16:19 +00:00
5dccf3b62c [Security upgrade] bump socket.io-client fork to ws@^8.21.0 (#35060)
* bump socket.io-client to overleaf fork 0.9.17-overleaf-6

Fixes GHSA-96hv-2xvq-fx4p (ws memory exhaustion DoS) by bumping the
overleaf/socket.io-client fork to a version that declares ws@^8.21.0
instead of ws@^1.1.5. The existing ws@npm:^8 resolution pins it to
8.21.0, removing ws@1.1.5 from yarn.lock entirely.

Depends on overleaf/socket.io-client#6.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* use 0.9.17-overleaf-6 tag for socket.io-client

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* use the socket.io-client-0.9.17-overleaf-6 release

* provide ws module for real-time acceptance tests

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-authored-by: Brian Gough <briangough@users.noreply.github.com>
Co-authored-by: Brian Gough <brian.gough@overleaf.com>
GitOrigin-RevId: 2d9a42f90bcf95a3a8f053df4c0092c4fbc26422
2026-09-17 11:15:42 +00:00
Lucie Germain 210ced0d31 Merge pull request #33361 from overleaf/copilot/remove-direct-use-of-body-parser
Remove direct use of body-parser in favour of express built-ins

GitOrigin-RevId: 656c5f216daf68e86d53ae07d272e080bd5ab27f
2026-09-17 11:14:46 +00:00
Andrew Rumble 6be5db7667 Merge pull request #34926 from overleaf/lg-otel-root-security
[Security upgrade] bump @opentelemetry/core to 2.8.0 (OTEL family)

GitOrigin-RevId: dd45fba9999de03b44ef6bd38ed4dedba0900a50
2026-09-17 11:14:42 +00:00
Andrew Rumble 834730d011 Merge pull request #34580 from overleaf/lg-security-grpc-grpc-js
[Security upgrade] bump @grpc/grpc-js from 1.14.3 to 1.14.4

GitOrigin-RevId: bda9e568e55f6e536cfd6d28a9453726aca2c39c
2026-09-17 11:14:37 +00:00
Brian Gough efaeb90e39 Merge pull request #34924 from overleaf/lg-tar-root-security
[Security upgrade] bump tar to 7.5.16 in root workspace

GitOrigin-RevId: 73ac951792ce3d8ac8e9c01508bd467932621f49
2026-09-17 11:14:33 +00:00
Mathias Jakobsen 60051a1c9f Merge pull request #34920 from overleaf/lg-form-data-security-upgrade-v2
[Security upgrade] bump form-data to patched versions in root workspace

GitOrigin-RevId: 77aa4482bee6c84ea71255817263b26023d8943f
2026-09-17 11:14:27 +00:00
Andrew Rumble 25d625d4ee Merge pull request #34918 from overleaf/lg-dev-tooling-security
[Security upgrade] bump webpack-dev-server, http-proxy-middleware, launch-editor (dev tooling)

GitOrigin-RevId: 50f2ffcf575beaf35d243f7059c82cb5210afbf8
2026-09-17 11:13:32 +00:00
Eric Mc Sween c645215afc Merge pull request #34907 from overleaf/em-promisify-github-sync
Promisify github-sync

GitOrigin-RevId: ac68f3f18ad211e204631d80bd5d4354ea23aaff
2026-06-26 08:07:30 +00:00
Eric Mc Sween 2c54574377 Merge pull request #34922 from overleaf/lg-vite-security-upgrade-v2
[Security upgrade] bump vite to 7.3.5 in root workspace

GitOrigin-RevId: 278475d98e23f0679ec45993e2a6816e9b93eb64
2026-06-26 08:07:25 +00:00
Andrew Rumble bbf5586935 Merge pull request #34919 from overleaf/lg-undici-security-upgrade
[Security upgrade] bump undici to 7.28.0 in root workspace

GitOrigin-RevId: 39a6fb92235c6453fbd6106c05af66fb1d089607
2026-06-26 08:06:49 +00:00
Brian Gough 29c8717b60 Merge pull request #33845 from overleaf/lg-ws-security-upgrade
[Security upgrade] pin ws@^8 to 8.21.0

GitOrigin-RevId: 40b839757122c1116debe8b7ebfa4eba9187bfa8
2026-06-24 08:06:51 +00:00
Andrew Rumble 255a6242cb Merge pull request #34340 from overleaf/ar-things-that-dont-need-to-be-pinned
[dependency-management] find unnecessary pins script

GitOrigin-RevId: b935ee7ae72c0339ea58f14d5f0a991ed4ae350c
2026-06-24 08:06:36 +00:00
Brian Gough c6a46fbdad Merge pull request #33961 from overleaf/lg-qs-security-upgrade
[Security upgrade] pin qs to 6.15.2 in root yarn.lock

GitOrigin-RevId: 4819f0a1f9b41821ccda354a309d190d8395ef56
2026-06-24 08:05:31 +00:00
Brian Gough 81f85293f2 Merge pull request #33656 from overleaf/lg-protobufjs-security-upgrade
[Security upgrade] Pin protobufjs to 7.6.3 and @protobufjs/utf8 to 1.1.1 via resolutions

GitOrigin-RevId: 7d71d564d7296af76f04fda8b35f178c5014a9b9
2026-06-24 08:05:26 +00:00
Jakob Ackermann 6b084424b5 [monorepo] fix running make lint from root (#33559)
* [monorepo] remove spurious package-name field from buildscript.txt

* [monorepo] align variables/paths across build script variants

* [monorepo] align linting/test setup for jobs/libraries

* [monorepo] fix "make lint/lint_fix" from root

* [wiki-algolia] integrate with yarn workspace

GitOrigin-RevId: a0954f2936d03cd4a69b3f2c8098d9ee2e361993
2026-06-23 08:06:37 +00:00
Eric Mc Sween 95e0a88bbb Merge pull request #34519 from overleaf/em-github-sync-octokit-migration
Replace octonode with octokit in github-sync

GitOrigin-RevId: 05886b87ed8625dbbcb77dc2d6ccbeda7b426e79
2026-06-18 08:06:22 +00:00
Anna Claire Fields 7035a2e025 Revert "Acf pnp migration master" (#34709)
GitOrigin-RevId: ec7d63e1212e05dd6dfc7a0ddf785c11eca76ad6
2026-06-17 08:07:56 +00:00
Anna Claire Fields 8f07308342 Acf pnp migration master (#34040)
GitOrigin-RevId: 418eab9bc733f27a6e0f8f04a2a8e21c2f5a491f
2026-06-17 08:07:16 +00:00
David 9fae908602 Merge pull request #34585 from overleaf/lg-security-hapi-wreck-joi
[Security upgrade] bump @hapi/wreck from 18.1.0 to 18.1.2 in services/third-party-references

GitOrigin-RevId: a6efbbb9b7c8ddf995c247f8b787c16fa8b6d6f3
2026-06-17 08:06:34 +00:00
CopilotandJakob Ackermann f40cebf60b [docstore] replace remaining Joi usage with zod (#34603)
Co-authored-by: Jakob Ackermann <jakob.ackermann@overleaf.com>
GitOrigin-RevId: 41ca0c35d59bf6accd619f6b5149be14a69e1078
2026-06-16 08:07:22 +00:00
Brian Gough be4108a573 add glob matching to isExtraneousFile (#34633)
GitOrigin-RevId: f12aedb52195cfc9e3254936f1db6189f49c3f37
2026-06-16 08:07:09 +00:00
Lucie Germain ed166a7291 [Security upgrade] upgrade react-router to 6.30.4 in latexqc (#34324)
* Upgrade react-router to 6.30.4 (GHSA-2j2x-hqr9-3h42)

GitOrigin-RevId: 1224dc24bac65a8d2ee2d7c3f83d900a22aae5a0
2026-06-16 08:05:54 +00:00
Lucie GermainandClaude Sonnet 4.6 93a4f0c88a Remove unused celebrate dependency from project-history (#34604)
celebrate is declared in project-history's package.json but never imported
anywhere in the service. Dropping it removes one of the consumers pulling in
joi@17 and shrinks the dependency surface. docstore still uses celebrate, so
it remains in the lockfile.

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
GitOrigin-RevId: 171c3e5435495d20256bd9b95158a275ec42f7e3
2026-06-15 08:08:10 +00:00
Andrew Rumble adf1659c59 Merge pull request #34468 from overleaf/ar-offload-data-fixes-part-2
[analytics] more streaming changes

GitOrigin-RevId: 7a5c337bb97342aa83b2991209221a0aea63a214
2026-06-11 08:05:48 +00:00
Jakob Ackermann 62c8fd37ac [clsi-lb] speed up refreshing server list from GCP (#34478)
* [clsi-lb] move retries to the individual GCP API call

* [clsi-lb] fix docker-compose.gcp.yml

* [clsi-lb] collect per-zone/per-group instances in parallel

* [clsi-lb] re-use the compute GCP client

GitOrigin-RevId: 46f7f89b0ddea061ed4df4df2fdbcb315f19cbaa
2026-06-10 11:58:57 +00:00
Lucie GermainandClaude Sonnet 4.6 60624f2ee7 [Security upgrade] bump tmp to ^0.2.6 in jobs/mirror-documentation (#34120)
* [Security upgrade] bump tmp to ^0.2.6 in jobs/mirror-documentation (GHSA-ph9p-34f9-6g65)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

* Update yarn.lock: resolve tmp@^0.2.6 to 0.2.7

The lockfile had no entry for the ^0.2.6 range, causing Yarn to try
adding tmp@0.2.7 at CI time. With CI=true Yarn runs in --immutable mode,
so the unrecorded resolution failed every build. Ran yarn install locally
to record the ^0.2.6 → 0.2.7 resolution before pushing.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

---------

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
GitOrigin-RevId: 5f62c586817c6a35c77a2bd0ff1990897d574338
2026-06-10 11:58:11 +00:00
Jakob Ackermann 52453edfa5 [clsi-lb] migrate to node.js (#34242)
* [clsi-lb] migrate to node.js

- Add env var for dynamically defining backends
- Reuse the server params across template and haproxy admin commands
- Keep the exact same rendering of the template

* [clsi-lb] fix WORKDIR for CI

* [k8s] clsi-lb: populate PROJECT_ID

* [k8s] clsi-lb: c3d compile backend class sports c3d and c3 instances

* [clsi-lb] update build scripts

* [clsi-lb] adopt @overleaf/stream-utils

* [clsi-lb] enable --watch mode in dev-env

* [clsi-lb] update build scripts

* [clsi-lb] update build scripts

GitOrigin-RevId: e05165b04a09d8200ce7f3a2321f9f2556544788
2026-06-10 08:07:10 +00:00
Lucie Germain 4024a3822c [Security upgrade] bump fast-xml-parser to 5.7.0 (#33916)
GitOrigin-RevId: cef87a7ce71a5d3742082a2af08a554265c9fbde
2026-06-10 08:06:59 +00:00
Antoine ClausseandClaude Opus 4.7 9dde7d3d71 [web] Add ESLint rules for locale JSON (#34221)
* Remove double spaces

* Enforce curly apostrophes

* Enforce French typographic spaces in fr.json

Add vitest test enforcing French spacing rules per
https://typographisme.net/post/Les-espaces-typographiques-et-le-web:
  - NNBSP (U+202F) before ? ! ;
  - NBSP (U+00A0) before :
  - NBSP (U+00A0) around guillemets « »

Fix 38 fr.json values that were using NBSP (or no space) before ? ! ;.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Extend French typography test to numbers and percent signs

Add rules per https://typographisme.net/post/Les-espaces-typographiques-et-le-web:
  - NNBSP (U+202F) between digit groups (thousands separator)
  - NBSP (U+00A0) between a number and a following word/unit
  - NBSP (U+00A0) before %

Fix 9 fr.json values where a regular space was used instead of NBSP between
a number and a following word (e.g. "1 résultat", "10 jetons", "7 jours").

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Use point médian for inclusive writing in fr.json

Replace parenthetical gender/plural markers like "sûr(e)", "abonné(e)",
"licence(s)" with the point médian "·" (e.g. "sûr·e", "abonné·e",
"licence·s") per modern French écriture inclusive.

Add a vitest rule rejecting "word(suffix)" patterns where suffix is 1-3
letters and there is no space before the opening parenthesis.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Simplify inclusive-writing check to "(e)" substring match

The previous regex (matchAll without the /g flag) would have thrown at
runtime. Drop matchAll entirely and use includes('(e)').

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Add point médian to participles in fr.json

Apply inclusive writing (·e) to past participles agreeing with the
addressed user ("affilié·e", "invité·e", "connecté·e", "abonné·e", etc.).

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Use inclusive forms in fr.json

* Change "de Overleaf" to "d’Overleaf"

* Fix tests

* Check for consecutive spaces, not just double spaces

* Update comment about guillemets

* Add ESLint rules for locale JSON conventions

Add three rules to @overleaf/eslint-plugin that run against locale JSON
files via @eslint/json:

- no-consecutive-spaces-in-locales
- no-straight-apostrophes-in-locales
- french-typography-in-locales

Wire them up in services/web/eslint.config.mjs against `locales/*.json`
(and `locales/fr.json` for the French-typography rule).

* Add `@eslint/json` so JSON files can be parsed

* Scope JS/TS-specific config to JS/TS files only so that built-in rules aren't applied to JSON files

* Disable `no-irregular-whitespace` in french-typography-in-locales.js

* Make the rules fixable

* Improve regexes: user `\s` instead of custom matchers

* Add sorted-keys-in-locales ESLint rule

Mirrors scripts/translations/sort.js as a fixable ESLint rule:
require top-level keys in locale JSON files to be sorted alphabetically.
The autofix re-serializes the file with sorted keys.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Add no-unused-locale-keys ESLint rule

Mirrors scripts/translations/cleanupUnusedLocales.js as a fixable ESLint
rule applied only to en.json. Shells out to `find` + `cat` once per
process (cached) to grep all candidate source files for key references,
then reports any en.json key that isn't found. The autofix re-serializes
en.json without the unused keys.

Hardcoded ALWAYS_USED set covers keys built at runtime (month names,
third-party-datastore notifications) that the regex scan can't see.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Add locale-variables-match-en ESLint rule

Mirrors scripts/translations/checkVariables.js as an ESLint rule applied
to non-en locale JSON files. Reads en.json (cached) and reports any
member whose `__name__` placeholders differ from the base.

GLOBALS (e.g. __appName__) are allowed as extras; IGNORE_NESTING_FOR
preserves the script's per-key exceptions.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Replace some double linebreak (@overleaf/no-consecutive-spaces-in-locales)

* Add no-orphan-locale-keys ESLint rule

Detect translation keys in non-en locale files that aren't present in
en.json. Mirrors the `--sync-non-en` flag of cleanupUnusedLocales.js.
The autofix re-serializes the locale file without the orphan keys,
sorted alphabetically.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Add tests for the locale JSON ESLint rules

Cover the four single-file rules:
  - no-consecutive-spaces-in-locales
  - no-straight-apostrophes-in-locales
  - sorted-keys-in-locales
  - french-typography-in-locales (including the inclusive-writing
    suggestion for "(e)")

The three cross-file rules (no-unused-locale-keys, no-orphan-locale-keys,
locale-variables-match-en) read from disk and aren't covered here; they
need integration tests via fixtures.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Drop bin/lint_locales — checks are now covered by ESLint rules

The four checks in bin/lint_locales are duplicated by the new
@overleaf/eslint-plugin rules:

  - sort.js --check                  → sorted-keys-in-locales
  - cleanupUnusedLocales.js --check  → no-unused-locale-keys
                                     + no-orphan-locale-keys
  - checkVariables.js                → locale-variables-match-en
  - single-quote grep                → no-straight-apostrophes-in-locales

`yarn lint` runs the ESLint rules against locales/*.json, so the
lint_locales script and Makefile target are redundant.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Remove Locales.test.mjs

* Delete scripts replaced by @overleaf/eslint-plugin rules

Remove the three locale scripts now superseded by ESLint rules:

  - scripts/translations/sort.js                   → sorted-keys-in-locales
  - scripts/translations/cleanupUnusedLocales.js   → no-unused-locale-keys
                                                   + no-orphan-locale-keys
  - scripts/translations/checkVariables.js         → locale-variables-match-en

Also drop the matching Makefile targets (sort_locales,
cleanup_unused_locales), update AGENTS.md / copilot-instructions.md to
point at `yarn lint --fix` instead, and prune the deleted entries from
the esm-check-migration allowlist.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Delete redundant scripts/translations/sort-locale-file.js

Single-file sort utility — superseded by `yarn lint --fix path/to/file.json`
via the sorted-keys-in-locales ESLint rule. No callers in repo.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Update comments and messages

* Add test file pattern to ESLint configuration

* Reorder "Backend specific rules" so `no-extraneous-dependencies` doesn't fail on test files

* Make french-typography fixes idempotent and catch edge cases

Apply Copilot's review feedback on PR #34221:

  - autoFix() now uses `\\s*`/`\\s+` instead of `\\s?`/`\\s` so it
    collapses any run of mixed whitespace into the correct NBSP/NNBSP,
    making the fix idempotent and order-independent.
  - The `:` lint regex now captures optional whitespace and reports
    when it isn't NBSP (catches `"Liste :"` with a regular space).
  - The `%` lint regex now matches the missing-space case (`"10%"`)
    via `\\s*` instead of requiring one char between digit and `%`.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

* Remove sort-locale-file.js from pre-commit

* Revert no-unused-locale-keys ESLint rule; Restore lint_locales scripts

---------

Co-authored-by: Claude Opus 4.7 <noreply@anthropic.com>
GitOrigin-RevId: 8351fab074e6e7f77920b70237df1cd1c781e053
2026-06-10 08:06:44 +00:00
Andrew Rumble cc2d74a44d Merge pull request #34406 from overleaf/lg-xmldom-security-fix
[Security upgrade] update @xmldom/xmldom to ^0.8.13 in services/web

GitOrigin-RevId: 2a7d55f73a71c6eb2f82821069cd3a8b367a55a0
2026-06-10 08:05:33 +00:00
Andrew Rumble b703acb55a Merge pull request #34325 from overleaf/ar-remove-noop-pins
[monorepo] remove no-op pins

GitOrigin-RevId: 9b059ae72e63f01b836a72501de893c28a4bbcbf
2026-06-09 08:06:52 +00:00
Anna Claire Fields 97247b8ea5 [PnP migration] Remove mock-fs dependency (#33835)
GitOrigin-RevId: ff8df32d85b2ecd2837c9eee6d6d2b3b95285239
2026-06-05 08:06:54 +00:00
Anna Claire Fields 3fcd133198 [patch] update sandboxed-module for Yarn PnP compatibility and add mongodb-legacy type definitions (#33983)
GitOrigin-RevId: 8f1e9a4e4b4b5fbf3a770951a070b5a259abdcee
2026-06-05 08:06:50 +00:00
Jakob Ackermann 0501586743 [latexqc] migrate to local s3, add codespaces support, add e2e tests (#34136)
GitOrigin-RevId: 167171103c14ed3c4ba2939d80231c343645e53a
2026-06-05 08:05:59 +00:00