-
Notifications
You must be signed in to change notification settings - Fork 34
chore: implement generate baseline script #309
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
yeonjuan
commented
Apr 3, 2025
•
edited
Loading
edited
- ref: Add support for Baseline features #308
- This PR adds code to generate a baseline feature status map, which will be used by the upcoming use-baseline rule.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a script to generate a baseline feature status map for upcoming baseline rules.
- Introduces a new script at tools/base-line/generate-baseline.mjs that parses browser compatibility data and serializes baseline statuses
- Updates eslint.config.js to support ES modules under the tools folder
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated 1 comment.
File | Description |
---|---|
tools/base-line/generate-baseline.mjs | Implements baseline generation with data extraction and file generation |
eslint.config.js | Updates configuration to handle ES module files in the tools directory |
Files not reviewed (2)
- .cspell.json: Language not supported
- package.json: Language not supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR implements a script to generate a baseline feature status map for an upcoming use-baseline rule. Key changes include:
- Addition of a new baseline generation script in tools/base-line/generate-baseline.mjs that traverses browser compatibility data.
- Integration of Prettier for code formatting and use of fs.writeFileSync to output the generated baseline.
- Update to eslint.config.js to support .mjs files in the tools folder.
Reviewed Changes
Copilot reviewed 4 out of 6 changed files in this pull request and generated no comments.
File | Description |
---|---|
tools/base-line/generate-baseline.mjs | Added baseline generation logic using data traversal and formatting |
eslint.config.js | Updated configuration to handle module files (*.mjs) |
Files not reviewed (2)
- .cspell.json: Language not supported
- package.json: Language not supported
Comments suppressed due to low confidence (2)
tools/base-line/generate-baseline.mjs:12
- [nitpick] Using a boolean (false) as a key in the baselineIds map can be ambiguous. Consider using a consistent key type, such as a string (e.g., 'false'), for clarity and consistency.
[false, BASELINE_FALSE],
tools/base-line/generate-baseline.mjs:97
- The check for a leading '≤' in baseline_low_date could be fragile if data formats change. Ensure that the data specification for baseline_low_date is well-defined or consider a more robust parsing strategy.
if (status.baseline_low_date && status.baseline_low_date.startsWith("≤")) {
["a.attributionsrc", "0:"], | ||
["a.download", "10:2019"], | ||
["a.href", "10:2015"], | ||
["a.href.href_sms", "0:"], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can ignore any keys like this containing an underscore. Those don't correspond to the element/attribute itself, they're more like implementation details.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #309 +/- ##
=======================================
Coverage 98.72% 98.72%
=======================================
Files 70 70
Lines 2042 2045 +3
Branches 556 556
=======================================
+ Hits 2016 2019 +3
Misses 26 26
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|