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
As far as I know, the following construction, though syntactically valid, would never be used intentionally since ParseJSONModule has no side effects:
import'data.json'assert{type: 'json'};
In that case, disallowing it could surface programming errors. I'm not sure if the restriction would justify the complexity of another early error, though. Is it better left to linters?
The text was updated successfully, but these errors were encountered:
One the other hand, an early error like this could become a source of inconsistency. Hosts won't be able to apply it to their own import assertions even in cases where the same rationale (that is: "there is no side-effect") applies.
It would have an effect, though - which is to fail the module graph if the JSON is invalid, and to populate the cache (thus, disallowing it would be preventing code that does have a use case).
As far as I know, the following construction, though syntactically valid, would never be used intentionally since ParseJSONModule has no side effects:
In that case, disallowing it could surface programming errors. I'm not sure if the restriction would justify the complexity of another early error, though. Is it better left to linters?
The text was updated successfully, but these errors were encountered: