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
I ran into this problem when using rollup specifically, but the issue occurs anytime someone attempts to perform a named import. ie.
import{post,get,delete}from'ky'
The problem here is that delete is a restricted keyword and causes issues when imported and called. One suggestion is to rename it during the import like:
import{post,get,deleteasdel}from'ky'
But this doesnt really solve the problem that the export is still confusing.
As a suggestion, i think adding 'del', which would just be an alias for delete would remove this problem:
import{del}from'ky'
The text was updated successfully, but these errors were encountered:
jdalrymple
changed the title
Include a del alias function
Adding an delete alias for better named imports
Nov 8, 2018
Ky is a default export. The methods are not named exports. I'm not sure why Rollup lets you use named exports for it (you should open a Rollup issue about that), but that's definitely incorrect. Using named exports also decreases readability as it's not immediately clear what get() refers to in a large file without going all the way up to look at the import statement.
I ran into this problem when using rollup specifically, but the issue occurs anytime someone attempts to perform a named import. ie.
The problem here is that delete is a restricted keyword and causes issues when imported and called. One suggestion is to rename it during the import like:
But this doesnt really solve the problem that the export is still confusing.
As a suggestion, i think adding 'del', which would just be an alias for delete would remove this problem:
The text was updated successfully, but these errors were encountered: