refactor(lint): add eslint-plugin-baseline-js for browser compatibility#1019
refactor(lint): add eslint-plugin-baseline-js for browser compatibility#1019overbalance merged 14 commits intomainfrom
Conversation
eslint-plugin-baseline-js now handles syntax and Web API compliance. Removed es-check, AST-based Web API analysis, and unused build.js.
Chrome DevTools Protocol Tracing (Script: 102.49ms, Heap: 13.09MB)
Lighthouse (Script Eval: 46.40ms)
Platform Tests (vite-7 gzip: 47.99KB)vite-7 Platform Tests
vite-otel-latest Platform Tests
webpack-5 Platform Tests
|
jpmunz
left a comment
There was a problem hiding this comment.
confirming this is not adding new functionality correct? The idea is to keep the same validation we had before but leverage eslint-plugin-baseline-js instead of our custom code?
| export class FetchTransport implements IExporterTransport { | ||
| public constructor(private readonly _config: FetchRequestParameters) {} | ||
|
|
||
| /* eslint-disable baseline-js/use-baseline -- compression-streams baseline widely available since May 2023, plugin data stale */ |
There was a problem hiding this comment.
is this needed given the ignoreFeatures in eslint.dist.config.js?
There was a problem hiding this comment.
Yes because comments are stripped out of compiled output.
There was a problem hiding this comment.
I'm not sure I follow, if this was removed the rule still triggers even though ignoreFeatures: ['compression-streams', 'proto'] is set? What is ignoreFeatures then configuring?
There was a problem hiding this comment.
eslint.config.js validates source code (which doesn't ignore features, hence the disable comments) and eslint.dist.config.js is used to validate compiled output. The IIFE file is stripped of comments so it was more convenient to add ignoreFeatures for all files in the dist folder.
There was a problem hiding this comment.
ah ok I understand now, thanks!
| 'error', | ||
| { | ||
| available: 'widely', | ||
| // compression-streams: widely available since May 2023, plugin data stale |
There was a problem hiding this comment.
this is pretty long ago for the plugin to not take it into account, is it updated regularly?
There was a problem hiding this comment.
I wrote this poorly. CS was added to all browsers thirty months ago but only became "widely available" in November 2025. I'll revise.
What problem is this solving?
Adds automated checking for Web API browser compatibility, ensuring SDK code only uses APIs that are "widely available" (30+ months across all major browsers).
Short description of changes
eslint-plugin-baseline-jswith type-aware parsing for source filessdk:check=sdk:check:tsc+sdk:check:eslintvalidate-sdk.jsby removing redundant AST-based baseline analysises-checkon compiled output as syntax verification safety netscripts/build.jsTesting
navigator.scheduling)usingin ES2022)