create-efforge 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -16,10 +16,13 @@ export default defineConfig({
16
16
  categories: { correctness: "error", suspicious: "error", perf: "error" },
17
17
  // an explicit list replaces oxlint's defaults, so keep oxc/typescript/unicorn
18
18
  plugins: ["oxc", "typescript", "unicorn", "react", "import", "effecttsgo"],
19
+ jsPlugins: ["./lint/effect-tests.js"],
19
20
  options: { typeAware: true, typeCheck: true },
20
21
  rules: {
21
22
  "typescript/no-explicit-any": "error",
22
23
  "typescript/no-floating-promises": "error",
24
+ "typescript/no-misused-promises": "error",
25
+ "typescript/no-deprecated": "error",
23
26
  "no-unused-vars": "error",
24
27
  "react/exhaustive-deps": "error",
25
28
  "no-console": ["error", { allow: ["warn", "error"] }],
@@ -30,8 +33,30 @@ export default defineConfig({
30
33
  "react/react-in-jsx-scope": "off",
31
34
  // exact pins make "unstable" Effect APIs safe; this flags it.effect itself
32
35
  "effecttsgo/unstable-api-usage": "off",
36
+ // bindings reach code through effect-cf layers; cloudflare.ts is the one file that reads env
37
+ "no-restricted-imports": [
38
+ "error",
39
+ {
40
+ paths: [
41
+ {
42
+ name: "cloudflare:workers",
43
+ importNames: ["env"],
44
+ message:
45
+ "Read bindings through effect-cf layers; only server/cloudflare.ts reads env.",
46
+ },
47
+ ],
48
+ },
49
+ ],
33
50
  },
34
51
  overrides: [
52
+ {
53
+ files: ["**/*.test.ts", "**/*.test.tsx"],
54
+ rules: { "effect-tests/no-manual-runtime": "error" },
55
+ },
56
+ {
57
+ files: ["apps/web/src/server/cloudflare.ts"],
58
+ rules: { "no-restricted-imports": "off" },
59
+ },
35
60
  {
36
61
  // entry points are where layers get provided: the server runtime and one-off scripts
37
62
  files: ["apps/web/src/server/runtime.ts", "packages/*/scripts/**"],
@@ -1,4 +1,4 @@
1
- import { type FormEvent, useState } from "react"
1
+ import { type SubmitEvent, useState } from "react"
2
2
  import { Button } from "@/components/ui/button"
3
3
  import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card"
4
4
  import { Input } from "@/components/ui/input"
@@ -9,7 +9,7 @@ export function RealtimeDemo() {
9
9
  const { messages, status, send } = useRoom("demo")
10
10
  const [text, setText] = useState("")
11
11
 
12
- const submit = (event: FormEvent) => {
12
+ const submit = (event: SubmitEvent) => {
13
13
  event.preventDefault()
14
14
  if (text.trim() === "") return
15
15
  send(text)