Skip to main content
Detects ES5 polyfills and legacy JavaScript code
Rule IDperf/legacy-js
CategoryPerformance
ScopePer-page
Severityinfo
Weight3/10

Solution

Consider removing legacy polyfills if you don’t need to support old browsers. Use differential serving (module/nomodule) to send modern code to modern browsers. Update Babel/TypeScript target to ES2020+ if your audience uses modern browsers. Check browserslist configuration.

Enable / Disable

Disable this rule

squirrel.toml
[rules]
disable = ["perf/legacy-js"]

Disable all Performance rules

squirrel.toml
[rules]
disable = ["perf/*"]

Enable only this rule

squirrel.toml
[rules]
enable = ["perf/legacy-js"]
disable = ["*"]