Skip to content

Drop testing for TypeScript RC (7, ts-go) and expand TS matrix to 5.8 / 5.9 / 6#228

Merged
NullVoxPopuli merged 3 commits into
mainfrom
copilot/fix-ts-testing-issues
Jul 2, 2026
Merged

Drop testing for TypeScript RC (7, ts-go) and expand TS matrix to 5.8 / 5.9 / 6#228
NullVoxPopuli merged 3 commits into
mainfrom
copilot/fix-ts-testing-issues

Conversation

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

The typescript@rc tag now points to 7.0.1-rc (the typescript-go native port), which ships no JavaScript compiler API. In src/parser/ts-patch.js, one try block was resolving typescript and requiring @typescript-eslint/parser together; on TS 7, resolving typescript throws ERR_PACKAGE_PATH_NOT_EXPORTED, so the catch replaced replaceExtensions with an identity function and left typescriptParser unset — producing 15 test failures.

Changes

  • src/parser/ts-patch.jsreplaceExtensions rewritten as a small hand-written scanner (skips comments, template literals, and non-specifier strings) that rewrites .gts.mts only after from, bare import, or import(. No dependency on the TS compiler API, works on any TS version, length invariant preserved.
  • src/parser/ts-patch.js@typescript-eslint/parser is now required in its own try block, decoupled from the TS-compiler resolve. A missing / API-less typescript install no longer silently disables the ts-eslint parser too.
  • Tests — the three .gts-only suites (parser.test.js > transform, the .gts blocks in eslint-directive-comments.test.js, and program-comments-sort-order.test.js) skip when typescriptParser is undefined. This lets TS 7 pass cleanly while every other TS version still exercises them.
  • .github/workflows/ci.ymltsVersion matrix gains 5.8, 5.9, "6". pnpm --filter '*' test:check and test:fix are guarded with if: matrix.tsVersion != 'rc' && matrix.tsVersion != 'next', since the workspace lint-check projects transitively load @typescript-eslint/*, which cannot currently load against TS 7.

Notes

TS 7 (typescript-go) is fundamentally incompatible with today's @typescript-eslint runtime — typescript-estree fails with ERR_PACKAGE_PATH_NOT_EXPORTED when trying to require('typescript') against it. Until the upstream ts-eslint stack ships a TS-7-compatible release, the rc / next matrix entries can only meaningfully cover our own code paths; .gts parsing and workspace lint remain gated on ts-eslint being loadable.

Verified locally across TS 5.3, 5.4, 5.5, 5.6, 5.7, 5.8, 5.9, 6, and rc. All green (rc: 68 passed / 17 skipped for the .gts-only suites).

Comment thread src/parser/ts-patch.js Outdated
*
* Implemented as a small hand-written scanner instead of leaning on the
* TypeScript compiler API so it keeps working when TypeScript itself
* isn't installed, or when the installed `typescript` package exposes no

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@copilot we should not do this, it sounds like we should disable rc testing, since rc has no extension API

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed — reverted src/parser/ts-patch.js and the test skip logic, and dropped rc/next from the CI matrix instead (keeping the new 5.8/5.9/6 entries). The only diff vs. main is now three lines in .github/workflows/ci.yml. Done in 2c85fbd.

Copilot AI requested a review from NullVoxPopuli July 2, 2026 03:04
@NullVoxPopuli NullVoxPopuli marked this pull request as ready for review July 2, 2026 03:04
@github-actions

github-actions Bot commented Jul 2, 2026

Copy link
Copy Markdown
Contributor

🏎️ Benchmark Comparison

Benchmark Control (p50) Experiment (p50) Δ
gts small 1142.38 ms 1155.59 ms +1.2%
gts medium 2124.57 ms 2133.60 ms +0.4%
gts large 995.75 ms 1005.24 ms +1.0%
🟠 gjs small 946.87 ms 988.69 ms +4.4%
gjs medium 1838.32 ms 1824.40 ms -0.8%
gjs large 814.91 ms 810.18 ms -0.6%
hbs small 163.12 ms 165.11 ms +1.2%
hbs medium 946.83 ms 938.16 ms -0.9%
🟠 hbs large 961.17 ms 988.44 ms +2.8%

🟢 faster · 🔴 slower · 🟠 slightly slower · ⚪ within 2%

Full mitata output
clk: ~3.09 GHz
cpu: AMD EPYC 7763 64-Core Processor
runtime: node 24.18.0 (x64-linux)

benchmark                   avg (min … max) p75 / p99    (min … top 1%)
------------------------------------------- -------------------------------
gts small (control)             1.19 s/iter    1.29 s     █  █             
                          (1.02 s … 1.39 s)    1.35 s ▅   █ ▅█ ▅▅     ▅ ▅ ▅
                    (138.74 mb … 191.77 mb) 157.05 mb █▁▁▁█▁██▁██▁▁▁▁▁█▁█▁█

gts small (experiment)          1.17 s/iter    1.19 s           ██         
                          (1.02 s … 1.37 s)    1.33 s ▅ ▅ ▅▅  ▅▅██        ▅
                    (144.48 mb … 191.71 mb) 157.95 mb █▁█▁██▁▁████▁▁▁▁▁▁▁▁█

                             ┌                                            ┐
                             ╷         ┌────────────┬────────────┐        ╷
         gts small (control) ├─────────┤            │            ├────────┤
                             ╵         └────────────┴────────────┘        ╵
                              ╷      ┌───────────┬──┐                  ╷
      gts small (experiment)  ├──────┤           │  ├──────────────────┤
                              ╵      └───────────┴──┘                  ╵
                             └                                            ┘
                             1.02 s              1.18 s              1.35 s

summary
  gts small (experiment)
   1.02x faster than gts small (control)

------------------------------------------- -------------------------------
gts medium (control)            2.16 s/iter    2.16 s         ██           
                          (2.03 s … 2.52 s)    2.24 s ▅ ▅   ▅ ██▅ ▅     ▅ ▅
                    (318.97 mb … 338.97 mb) 328.08 mb █▁█▁▁▁█▁███▁█▁▁▁▁▁█▁█

gts medium (experiment)         2.17 s/iter    2.19 s           ██         
                          (2.00 s … 2.50 s)    2.25 s ▅     ▅ ▅ ██▅  ▅   ▅▅
                    (276.63 mb … 336.79 mb) 313.06 mb █▁▁▁▁▁█▁█▁███▁▁█▁▁▁██

                             ┌                                            ┐
                                  ╷           ┌───────────┬              ╷
        gts medium (control)      ├───────────┤           │──────────────┤
                                  ╵           └───────────┴              ╵
                             ╷                 ┌────────────┬───┐         ╷
     gts medium (experiment) ├─────────────────┤            │   ├─────────┤
                             ╵                 └────────────┴───┘         ╵
                             └                                            ┘
                             2.00 s              2.13 s              2.25 s

summary
  gts medium (control)
   1x faster than gts medium (experiment)

------------------------------------------- -------------------------------
gts large (control)             1.04 s/iter    1.05 s   █                  
                       (952.20 ms … 1.34 s)    1.14 s   █                  
                    (123.48 mb … 176.22 mb) 159.04 mb ███▁▁█▁█▁██▁▁█▁▁▁▁▁▁█

gts large (experiment)          1.05 s/iter    1.08 s              █       
                       (957.60 ms … 1.29 s)    1.11 s ▅ ▅▅▅▅▅      █  ▅  ▅▅
                    (122.82 mb … 178.36 mb) 153.57 mb █▁█████▁▁▁▁▁▁█▁▁█▁▁██

                             ┌                                            ┐
                             ╷  ┌─────────────────┬─┐                     ╷
         gts large (control) ├──┤                 │ ├─────────────────────┤
                             ╵  └─────────────────┴─┘                     ╵
                              ╷     ┌───────────────┬──────┐      ╷
      gts large (experiment)  ├─────┤               │      ├──────┤
                              ╵     └───────────────┴──────┘      ╵
                             └                                            ┘
                             952.20 ms            1.05 s             1.14 s

summary
  gts large (control)
   1.01x faster than gts large (experiment)

------------------------------------------- -------------------------------
gjs small (control)          989.55 ms/iter    1.03 s     █           █    
                       (873.06 ms … 1.21 s)    1.07 s ▅  ▅█ ▅ ▅     ▅ █  ▅▅
                    (108.73 mb … 152.53 mb) 140.29 mb █▁▁██▁█▁█▁▁▁▁▁█▁█▁▁██

gjs small (experiment)          1.01 s/iter    1.07 s █ ███ █   █   ██ ██ █
                       (875.45 ms … 1.22 s)    1.10 s █ ███ █   █   ██ ██ █
                    (111.61 mb … 152.35 mb) 145.38 mb █▁███▁█▁▁▁█▁▁▁██▁██▁█

                             ┌                                            ┐
                             ╷      ┌───────────────┬───────┐      ╷
         gjs small (control) ├──────┤               │       ├──────┤
                             ╵      └───────────────┴───────┘      ╵
                             ╷      ┌──────────────────┬──────────┐       ╷
      gjs small (experiment) ├──────┤                  │          ├───────┤
                             ╵      └──────────────────┴──────────┘       ╵
                             └                                            ┘
                             873.06 ms           988.63 ms           1.10 s

summary
  gjs small (control)
   1.02x faster than gjs small (experiment)

------------------------------------------- -------------------------------
gjs medium (control)            1.87 s/iter    1.88 s     █                
                          (1.76 s … 2.16 s)    1.96 s ▅▅  █ ▅ ▅▅ ▅ ▅ ▅    ▅
                    (257.73 mb … 309.57 mb) 281.80 mb ██▁▁█▁█▁██▁█▁█▁█▁▁▁▁█

gjs medium (experiment)         1.86 s/iter    1.89 s █          █         
                          (1.70 s … 2.16 s)    1.98 s █  ▅   ▅▅▅ █  ▅  ▅  ▅
                    (250.60 mb … 311.65 mb) 282.04 mb █▁▁█▁▁▁███▁█▁▁█▁▁█▁▁█

                             ┌                                            ┐
                                      ╷     ┌──────────┬──┐           ╷
        gjs medium (control)          ├─────┤          │  ├───────────┤
                                      ╵     └──────────┴──┘           ╵
                             ╷     ┌──────────────────┬─────┐             ╷
     gjs medium (experiment) ├─────┤                  │     ├─────────────┤
                             ╵     └──────────────────┴─────┘             ╵
                             └                                            ┘
                             1.70 s              1.84 s              1.98 s

summary
  gjs medium (experiment)
   1.01x faster than gjs medium (control)

------------------------------------------- -------------------------------
gjs large (control)          874.44 ms/iter 905.41 ms   ██                 
                       (785.15 ms … 1.17 s) 947.36 ms ▅ ██▅ ▅      ▅ ▅  ▅ ▅
                    ( 99.49 mb … 152.25 mb) 134.82 mb █▁███▁█▁▁▁▁▁▁█▁█▁▁█▁█

gjs large (experiment)       860.93 ms/iter 898.26 ms █  █                 
                       (780.69 ms … 1.11 s) 944.84 ms █ ▅█▅▅      ▅ ▅▅    ▅
                    ( 98.91 mb … 153.08 mb) 130.35 mb █▁████▁▁▁▁▁▁█▁██▁▁▁▁█

                             ┌                                            ┐
                              ╷   ┌───────────────────┬────────┐          ╷
         gjs large (control)  ├───┤                   │        ├──────────┤
                              ╵   └───────────────────┴────────┘          ╵
                             ╷    ┌────────────────┬─────────┐           ╷
      gjs large (experiment) ├────┤                │         ├───────────┤
                             ╵    └────────────────┴─────────┘           ╵
                             └                                            ┘
                             780.69 ms         864.03 ms          947.36 ms

summary
  gjs large (experiment)
   1.02x faster than gjs large (control)

------------------------------------------- -------------------------------
hbs small (control)          173.99 ms/iter 181.37 ms █     █ ████ ██  ██ █
                    (128.60 ms … 283.21 ms) 190.82 ms █     █ ████ ██  ██ █
                    ( 24.47 mb …  67.47 mb)  32.57 mb █▁▁▁▁▁█▁████▁██▁▁██▁█

hbs small (experiment)       172.26 ms/iter 178.71 ms                   █  
                    (127.09 ms … 264.47 ms) 185.07 ms ▅     ▅ ▅▅  ▅▅   ▅█▅▅
                    ( 24.14 mb …  67.55 mb)  31.70 mb █▁▁▁▁▁█▁██▁▁██▁▁▁████

                             ┌                                            ┐
                              ╷                 ┌─────────────┬────┐      ╷
         hbs small (control)  ├─────────────────┤             │    ├──────┤
                              ╵                 └─────────────┴────┘      ╵
                             ╷                ┌──────────────┬───┐    ╷
      hbs small (experiment) ├────────────────┤              │   ├────┤
                             ╵                └──────────────┴───┘    ╵
                             └                                            ┘
                             127.09 ms         158.95 ms          190.82 ms

summary
  hbs small (experiment)
   1.01x faster than hbs small (control)

------------------------------------------- -------------------------------
hbs medium (control)         974.08 ms/iter 999.76 ms █ █         █        
                       (903.87 ms … 1.16 s)    1.06 s █▅█  ▅    ▅▅█       ▅
                    (187.12 mb … 199.15 mb) 192.48 mb ███▁▁█▁▁▁▁███▁▁▁▁▁▁▁█

hbs medium (experiment)      966.82 ms/iter 986.68 ms  █                   
                       (903.36 ms … 1.16 s)    1.04 s ██                   
                    (185.92 mb … 199.02 mb) 191.54 mb ██▁▁▁█▁▁▁██▁█▁█▁▁▁▁▁█

                             ┌                                            ┐
                             ╷ ┌─────────────────┬───────┐                ╷
        hbs medium (control) ├─┤                 │       ├────────────────┤
                             ╵ └─────────────────┴───────┘                ╵
                             ╷ ┌───────────────┬─────┐              ╷
     hbs medium (experiment) ├─┤               │     ├──────────────┤
                             ╵ └───────────────┴─────┘              ╵
                             └                                            ┘
                             903.36 ms           982.08 ms           1.06 s

summary
  hbs medium (experiment)
   1.01x faster than hbs medium (control)

------------------------------------------- -------------------------------
hbs large (control)          995.51 ms/iter    1.02 s    █          █      
                       (930.93 ms … 1.16 s)    1.05 s ▅▅▅█ ▅      ▅ █▅    ▅
                    (133.37 mb … 189.18 mb) 159.38 mb ████▁█▁▁▁▁▁▁█▁██▁▁▁▁█

hbs large (experiment)          1.00 s/iter    1.02 s                     █
                       (924.58 ms … 1.20 s)    1.02 s                     █
                    (133.00 mb … 188.75 mb) 159.16 mb █▁▁▁███▁█▁▁▁▁█▁▁██▁▁█

                             ┌                                            ┐
                               ╷   ┌──────────────────┬───────┐           ╷
         hbs large (control)   ├───┤                  │       ├───────────┤
                               ╵   └──────────────────┴───────┘           ╵
                             ╷        ┌─────────────────┬──────┐╷
      hbs large (experiment) ├────────┤                 │      ├┤
                             ╵        └─────────────────┴──────┘╵
                             └                                            ┘
                             924.58 ms           989.11 ms           1.05 s

summary
  hbs large (control)
   1.01x faster than hbs large (experiment)

@NullVoxPopuli NullVoxPopuli merged commit 9a97f41 into main Jul 2, 2026
38 of 39 checks passed
@NullVoxPopuli NullVoxPopuli deleted the copilot/fix-ts-testing-issues branch July 2, 2026 03:21
@NullVoxPopuli NullVoxPopuli changed the title Fix tests on TypeScript RC and expand TS matrix to 5.8 / 5.9 / 6 Drop testing for TypeScript RC (7, ts-go) and expand TS matrix to 5.8 / 5.9 / 6 Jul 2, 2026
@github-actions github-actions Bot mentioned this pull request Jul 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants