Skip to content

Fix Guardian ESLint parse errors in runtime extensions - #413

Merged
Vladimir Morozov (vmoroz) merged 1 commit into
microsoft:mainfrom
vmoroz:PR/eslint-parse-errors
Nov 12, 2026
Merged

Vladimir Morozov (vmoroz) merged 1 commit into
microsoft:mainfrom
vmoroz:PR/eslint-parse-errors

Conversation

@vmoroz

@vmoroz Vladimir Morozov (vmoroz) commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

Summary

Guardian's ESLint scan fails on modern JavaScript syntax and incomplete extension
wrapper fragments, leaving otherwise successful builds partially successful.

  • Modern JavaScript: Use ES2021 parsing in the build and release pipelines so
    complete runtime extensions remain checked by the existing SDL security rules.
  • Wrapper fragments: Exclude only the opening and closing wrapper files,
    which the build concatenates around the scanned extensions.

Test Plan

Ran Guardian's ESLint 7.32.0 command with the SDL 0.1.7 required rules from the
checkout's parent directory. It exits 0 with no messages, scans the six complete
runtime extension and ARM64 stress scripts, and ignores only the two wrapper
fragments. Without the parser option, the same command still fails to parse.

The CI pipeline passed on this commit. Guardian ESLint ran with
--parser-options=ecmaVersion:2021 and exited 0. Its SARIF lists the same six
files, with no results or parse errors. No task failed or finished with issues.
Pipeline previews show the option in the PR and CI pipelines. The release
pipeline accepts it, but runs no ESLint task today, so it is set there only for
consistency.

Microsoft Reviewers: Open in CodeFlow

Guardian runs ESLint 7 with its default ES5 parser, so the standalone
runtime extensions that use class and new.target fail to parse, and the
header/footer IIFE fragments cannot parse on their own.

Set ecmaVersion 2021 for the SDL ESLint scan in the build and release
pipeline templates, and exclude only the two wrapper fragments. The
other runtime extensions remain scanned by the SDL required rules.
Copilot AI balanced review requested due to automatic review settings November 11, 2026 20:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues block the ESLint parsing and wrapper-fragment exclusion changes.

No open issues 🎉

What changed in this PR

This PR addresses Guardian ESLint parse failures by enabling ES2021 parsing and excluding incomplete wrapper fragments, while keeping complete runtime extensions covered by existing security rules.

Changes:

  • Configure ES2021 parsing in the build and release pipelines.
  • Exclude only the extension header and footer fragments in addition to existing exclusions.
  • Correct the ignore-file comments to clarify that runtime extensions remain scanned.
File Description
.eslintignore Excludes the two wrapper fragments and clarifies scan coverage.
.ado/​release-pipeline.yml Adds ES2021 parser settings for consistency; no ESLint task currently runs here.
.ado/​build-template.yml Enables ES2021 parsing for Guardian ESLint in PR and CI builds.

Review effort: Balanced

@github-actions

Copy link
Copy Markdown

Benchmark Results

Total benchmarks: 204

Inputs: baseline/baseline.json, bench_result.json

v8 (6176ms, 5396ms) -12.6%
v8 hermes (CI) hermes (CI)
v8-crypto 622.6ms 597.4ms
v8-deltablue 739.4ms 766ms
v8-raytrace 127.8ms 124.8ms
v8-regexp 593ms 389ms
v8-richards 937ms 880.8ms
v8-splay 225.2ms 226.8ms
v8-crypto (static) 452ms 430.6ms
v8-deltablue (static) 661.6ms 642.2ms
v8-raytrace (static) 91.8ms 95.6ms
v8-regexp (static) 749.2ms 394.2ms
v8-richards (static) 781.4ms 661.6ms
v8-splay (static) 195ms 187ms
test-suites (317886ms, 304415ms) -4.2%
test-suites hermes (CI) hermes (CI)
box2d 2949.8ms 2756ms
earley-boyer 2564.8ms 2526.8ms
navier-stokes 5743.8ms 4357.2ms
pdfjs 1038.2ms 911ms
gbemu 2296ms 2296.2ms
code-load 4472.8ms 4589.8ms
typescript 3381.8ms 3575.2ms
simpleSum 8855.4ms 5680.4ms
propAccess 2691.2ms 2116.6ms
allocObj 252ms 192.2ms
allocObjLit 6371.8ms 5857.8ms
allocNewObj 20053ms 20515ms
allocArray 249ms 192.2ms
allocNewArray 34956.8ms 34640.8ms
arrayRead 115.6ms 91.2ms
arrayReadByIndex 550ms 562.2ms
largeArrayRead 827.2ms 547.2ms
arrayWrite 261.8ms 243.6ms
largeArrayWrite 2218ms 2071ms
interp-dispatch 2880ms 1933.8ms
wb-perf 8327ms 9368.2ms
arrayReverse 40.6ms 36.2ms
arrayMap 1472.6ms 1493.4ms
arrayIndexOf 143.2ms 131.8ms
arrayLastIndexOf 148.6ms 147.2ms
arrayEvery 2308.8ms 2295.8ms
arraySome 2174.4ms 2256.4ms
arrayFill 2401.2ms 2426.8ms
arrayFilter 1866.4ms 1850.8ms
arrayFind 3207ms 3334.2ms
arrayFindIndex 3322ms 3302.6ms
arrayPop 1031.4ms 1040.6ms
arrayReduce 1994.2ms 2082.8ms
arrayReduceRight 2075.8ms 2098.4ms
arrayShift 2065.8ms 2096.4ms
arrayUnshift 2109.4ms 2147.2ms
arrayIncludes 1216.6ms 137.8ms
arrayFrom 1102.8ms 1125.6ms
arrayCopyWithin 1487ms 1528ms
stringFromCharCode 92.6ms 89.6ms
arraySlice 786.2ms 824.4ms
arraySplice 26.8ms 26.4ms
arrayOf 1048.8ms 1055.6ms
stringCharAt 1346.6ms 1282.2ms
stringMatch 3192.4ms 3129ms
stringSearch 3508.2ms 3067ms
stringStartsWith 701ms 571.4ms
stringEndsWith 650.4ms 539.4ms
stringIncludes 1520.6ms 1707.8ms
stringIndexOf 1555.6ms 1975.2ms
stringLastIndexOf 1821.4ms 1717.4ms
stringSplit 822ms 729.2ms
stringSlice 490ms 437.8ms
stringPadStart 2910.8ms 3303.8ms
stringPadEnd 2910ms 3295.4ms
regExpMatch 1506.2ms 632.4ms
regExpSearch 1227ms 1061.6ms
regExpToString 1204ms 1261.2ms
stringReplace 1394.8ms 1485.4ms
regExpReplace 3309.2ms 396.8ms
regExpFlags 956.8ms 1039ms
regExpSplit 1307.8ms 741.6ms
numberArrayReadWrite 2477.8ms 2391ms
protoCache 3594.6ms 2448ms
box2d (static) 1792.6ms 1818ms
earley-boyer (static) 1875.6ms 1935ms
navier-stokes (static) 3410.2ms 3358.4ms
pdfjs (static) 812.8ms 769ms
gbemu (static) 1797ms 1766.8ms
code-load (static) 4199.2ms 4218.8ms
typescript (static) 2685.6ms 2593ms
simpleSum (static) 936.2ms 937.2ms
propAccess (static) 2298ms 2257ms
allocObj (static) 0.2ms 0ms
allocObjLit (static) 4154.4ms 3739.6ms
allocNewObj (static) 15749.2ms 17427.4ms
allocArray (static) 0.6ms 0.6ms
allocNewArray (static) 28494.2ms 28778.6ms
arrayRead (static) 74.2ms 69.2ms
arrayReadByIndex (static) 453.2ms 447.4ms
largeArrayRead (static) 552.2ms 532.6ms
arrayWrite (static) 178.4ms 161ms
largeArrayWrite (static) 1568.6ms 1457ms
interp-dispatch (static) 1918.8ms 1909.4ms
wb-perf (static) 8991.2ms 9044.4ms
arrayReverse (static) 37ms 36.2ms
arrayMap (static) 1064.8ms 980.8ms
arrayIndexOf (static) 128.2ms 120.6ms
arrayLastIndexOf (static) 138.8ms 119.2ms
arrayEvery (static) 1397.6ms 1421.4ms
arraySome (static) 1406.6ms 1423ms
arrayFill (static) 1969.2ms 2030.4ms
arrayFilter (static) 1061ms 1065.2ms
arrayFind (static) 2242.2ms 2257.8ms
arrayFindIndex (static) 2235.8ms 2312.2ms
arrayPop (static) 878ms 906.8ms
arrayReduce (static) 1311.8ms 1361ms
arrayReduceRight (static) 1322.6ms 1343ms
arrayShift (static) 1512ms 1581.8ms
arrayUnshift (static) 1568.2ms 1597.6ms
arrayIncludes (static) 963.4ms 127.6ms
arrayFrom (static) 1030.6ms 1024.4ms
arrayCopyWithin (static) 1109.6ms 1123.8ms
stringFromCharCode (static) 77ms 76.2ms
arraySlice (static) 571.6ms 589.4ms
arraySplice (static) 26ms 26.2ms
arrayOf (static) 868.8ms 879.2ms
stringCharAt (static) 1100.6ms 1120.2ms
stringMatch (static) 2227.6ms 2519ms
stringSearch (static) 2219.2ms 2466ms
stringStartsWith (static) 494.2ms 457ms
stringEndsWith (static) 457.8ms 454.2ms
stringIncludes (static) 1437.4ms 1172.8ms
stringIndexOf (static) 1440.8ms 1444.6ms
stringLastIndexOf (static) 1956.6ms 1459.2ms
stringSplit (static) 651.2ms 680ms
stringSlice (static) 445.6ms 377.8ms
stringPadStart (static) 2294.4ms 2785ms
stringPadEnd (static) 2499.2ms 2785.8ms
regExpMatch (static) 1483.2ms 553.8ms
regExpSearch (static) 1296.2ms 1063.6ms
regExpToString (static) 1326.6ms 1228.6ms
stringReplace (static) 1455.6ms 1068.4ms
regExpReplace (static) 851.8ms 332.8ms
regExpFlags (static) 870.6ms 862ms
regExpSplit (static) 1200ms 643.6ms
numberArrayReadWrite (static) 2132.8ms 1961.2ms
protoCache (static) 3595.8ms 3590.4ms
micros (60876ms, 60488ms) -0.6%
micros hermes (CI) hermes (CI)
getNodeById.js 5273ms 4776.8ms
setInsert.js 2864.8ms 2739.2ms
stringify-number.js 1823.4ms 1525.8ms
typed-array-sort.js 22381ms 22577.6ms
getNodeById.js (static) 3941ms 3931.4ms
setInsert.js (static) 2517.6ms 2472.6ms
stringify-number.js (static) 1663.6ms 1380.4ms
typed-array-sort.js (static) 20411.4ms 21084.6ms
jit-benches (8563ms, 6310ms) -26.3%
jit-benches hermes (CI) hermes (CI)
idisp.js 2810.2ms 1935.6ms
idispn.js 3395.8ms 2016.2ms
idisp.js (static) 1906ms 1902.2ms
idispn.js (static) 450.8ms 455.8ms
many-subclasses (73437ms, 81212ms) +10.6%
many-subclasses hermes (CI) hermes (CI)
many.js 19104.8ms 18892.6ms
many-sh-1.js 7322.8ms 10280.8ms
many-sh-2.js 7329ms 10427.2ms
many-sh-3.js 7083.6ms 8018.2ms
many-sh-4.js 7235ms 8022.8ms
many.js (static) 15996ms 15820.8ms
many-sh-1.js (static) 2285.2ms 2367.6ms
many-sh-2.js (static) 2387ms 2412.2ms
many-sh-3.js (static) 2347.2ms 2422.4ms
many-sh-4.js (static) 2346ms 2547.2ms
map-objects (3627ms, 1984ms) -45.3%
map-objects hermes (CI) hermes (CI)
map-objects-untyped.js 1023.6ms 994.8ms
map-objects-typed.js 957.6ms -
map-objects-untyped.js (static) 917.2ms 989.6ms
map-objects-typed.js (static) 728.8ms -
map-strings (4335ms, 2286ms) -47.3%
map-strings hermes (CI) hermes (CI)
map-strings-untyped.js 1196.8ms 1163.8ms
map-strings-typed.js 1139.2ms -
map-strings-untyped.js (static) 1092.2ms 1121.8ms
map-strings-typed.js (static) 906.8ms -
nbody (3448ms, 2892ms) -16.1%
nbody hermes (CI) hermes (CI)
original/nbody.js 839.6ms 674ms
fully-typed/nbody.js 710ms 551.8ms
fully-typed/nbody.ts 865.2ms 669.2ms
original/nbody.js (static) 449.2ms 450.2ms
fully-typed/nbody.js (static) 135ms 97.6ms
fully-typed/nbody.ts (static) 449.2ms 449.4ms
string-switch (6503ms, 6647ms) +2.2%
string-switch (string-switch/plain) hermes (CI) hermes (CI)
bench.js 1316ms 1304.8ms
bench.js (static) 5187ms 5342.2ms
raytracer (5608ms, 5623ms) +0.3%
raytracer (raytracer/original) hermes (CI) hermes (CI)
bench-raytracer.js 1550.4ms 1546.2ms
raytracer.ts 1667.6ms 1544.2ms
bench-raytracer.js (static) 1198.4ms 1286.4ms
raytracer.ts (static) 1191.8ms 1246.6ms
MiniReact (30332ms, 21818ms) -28.1%
MiniReact hermes (CI) hermes (CI)
no-objects/out/simple-stripped.js 2239.2ms 854.2ms
no-objects/out/simple-lowered.js 2270.8ms 892.8ms
no-objects/out/music-stripped.js 42.6ms 42ms
no-objects/out/music-lowered.js 47.2ms 47ms
no-deps/stripped/MiniReact.js 5004ms 4518.6ms
no-deps/MiniReact.js 5256.2ms 4465.6ms
no-objects/out/simple.js 2260.4ms 840.2ms
no-objects/out/music.js 45.6ms 43.6ms
no-objects/out/simple-stripped.js (static) 1725.2ms 690.8ms
no-objects/out/simple-lowered.js (static) 1725.4ms 680ms
no-objects/out/music-stripped.js (static) 18.8ms 26.2ms
no-objects/out/music-lowered.js (static) 19.4ms 26.4ms
no-deps/stripped/MiniReact.js (static) 4024.8ms 4037.4ms
no-deps/MiniReact.js (static) 3938.2ms 3971.2ms
no-objects/out/simple.js (static) 1695.2ms 655.4ms
no-objects/out/music.js (static) 19ms 26.6ms
widgets (12934ms, 12771ms) -1.3%
widgets hermes (CI) hermes (CI)
simple-classes/widgets.js 1758.2ms 2258.8ms
original/es5/widgets.js 2798.8ms 2536ms
single-file/es5/widgets.js 2775.2ms 2510.2ms
simple-classes/widgets.js (static) 1012ms 1159.8ms
original/es5/widgets.js (static) 2283.2ms 2139.4ms
single-file/es5/widgets.js (static) 2306.2ms 2166.4ms

@vmoroz
Vladimir Morozov (vmoroz) merged commit d0fd2f3 into microsoft:main Nov 12, 2026
31 checks passed
@vmoroz
Vladimir Morozov (vmoroz) deleted the PR/eslint-parse-errors branch November 12, 2026 00:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants