You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It appears that this is caused by the check to see if an object has a __compat property inside of it. This check ensured that we weren't attempting to order the members of compatibility statements, since their ordering was handled separately in the other files. Unfortunately, this check also assumed that the top level of a file had a __compat statement -- in other words, it expected global_attributes to have a __compat statement. This means it's also affecting various files within the JavaScript category, such as grammar and statements.
Ultimately, I think that this is a fatal flaw in the way that the ordering script is programmed. Since we're using the replacer parameter of JSON.stringify, we have no context of what level or path we're at in the JSON; we only know the key and value we're looking at.
To solve this, I believe that a rewrite of the ordering script(s) would be needed. The ordering script would need to be written in a way where we can track the current path and depth, track what kind of object (relative to the schema) we're modifying, and ultimately, ensure we're sorting everything we can. This would also be a good opportunity to merge the ordering scripts into one script.
What type of issue is this?
Linter issue
What is the issue?
The features in https://github.com/mdn/browser-compat-data/blob/main/svg/global_attributes.json are not sorted alphabetically.
What behavior were you expecting?
https://github.com/mdn/browser-compat-data/blob/main/svg/global_attributes.json to be sorted alphabetically (or the linter complaining about it.)
What version(s) of BCD is the issue present in?
main
branchDo you have anything more you want to share?
Same problem in https://github.com/mdn/browser-compat-data/blob/main/html/global_attributes.json too
The text was updated successfully, but these errors were encountered: