-
Notifications
You must be signed in to change notification settings - Fork 356
fix: remove inline jsr: import from generated functions template
#4591
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
…emplate the template generated by 'supabase functions new' produces deno lint errors on line 6 due to inline jsr: import without version specifier: import jsr:@supabase/functions-js/edge-runtime.d.ts this triggers two default deno lint rules: - no-import-prefix: inline jsr: dependency not allowed - no-unversioned-import: missing version in specifier fix moves the dependency declaration to deno.json with proper versioning and updates index.ts to use bare specifier import as recommended by deno. closes supabase#4424
| // This enables autocomplete, go to definition, etc. | ||
|
|
||
| // Setup type definitions for built-in Supabase Runtime APIs | ||
| import "jsr:@supabase/functions-js/edge-runtime.d.ts" |
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.
@nyannyacha is this a problem we need to address?
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.
The mentioned lints appear to have been introduced in Deno v2.5.
Since we're currently fixed at Deno 2.1.4, not fixing the lints wouldn't cause much impact. However, the problem is that we can't prevent users from using the latest version of Deno.
So in my opinion... yes, I agree to change the template style so the lints don't complain.
|
Thanks, for that, it works for me |
jsr: import from generated functions template
|
+1 thanks @sweatybridge @7ttp |
jsr: import from generated functions templatejsr: import from generated functions template
Pull Request Test Coverage Report for Build 21512140722Details
💛 - Coveralls |
Summary
The template generated by
supabase functions newproduces code that triggers Deno lint errors due to an inlinejsr:import without a version specifier.Problem
The generated template includes:
This violates two default Deno lint rules:
jsr:dependencies are not allowedRelated
supabase functions newgenerates code with Deno IDE and linting errors #4424