| name | deno |
| description | Rules for using Deno |
| metadata | {"url":"https://gist.github.com/kuboon/b0d7c4384a9baf3c650be6d6fdd5665a","updated_on":"2026-04-01T00:00:00.000Z"} |
CI
add root deno.json file:
{
"tasks": {
"lint": "deno fmt && deno lint && deno check",
"check": "deno lint && deno check && deno fmt --check"
}
}
run deno task lint locally on every commit.
.github/workflows/ci.yml
name: CI
on:
push:
branches: ["main"]
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: denoland/setup-deno@v2
- run: deno task check
Imports
bad
import { serve } from "https://deno.land/std@0.177.0/http/server.ts";
good
run
deno add jsr:@std/http
deno add npm:tailwindcss to add the import map, then
import { serve } from "@std/http/server.ts";
import { serve } from "tailwindcss";
Permissions
bad
deno run --allow-net server.ts
good
Write a deno.json file in the root of your project:
{
"permissions": {
"default": {
"net": ["example.com", "api.example.com"],
"read": ["./data/*"],
"env": {
"ignore": true,
"allow": ["API_KEY", "DATABASE_URL"]
}
},
"build": {
"net": ["deno.land"],
"read": ["./src/*"],
"write": ["./dist/*"]
}
}
}
Then run your script with the -P flags:
deno run -P server.ts
deno run -P=build build.ts
reference