Skip to content

Commit 800af74

Browse files
committed
chore(cloudflare): Disallow Node SDK usage outside of nodejs_compat
1 parent 910235c commit 800af74

1 file changed

Lines changed: 18 additions & 1 deletion

File tree

packages/cloudflare/.oxlintrc.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,24 @@
1414
{
1515
"files": ["**/src/**"],
1616
"rules": {
17-
"sdk/no-class-field-initializers": "off"
17+
"sdk/no-class-field-initializers": "off",
18+
"no-restricted-imports": [
19+
"error",
20+
{
21+
"paths": [
22+
{
23+
"name": "@sentry/node",
24+
"message": "Do not import from `@sentry/node` in the Cloudflare SDK. It relies on Node.js APIs that are only available when the `nodejs_compat` flag is set. The only allowed importers are files in `src/nodejs_compat/`, which are exposed via the `@sentry/cloudflare/nodejs_compat/*` entry points."
25+
}
26+
]
27+
}
28+
]
29+
}
30+
},
31+
{
32+
"files": ["**/src/nodejs_compat/**"],
33+
"rules": {
34+
"no-restricted-imports": "off"
1835
}
1936
}
2037
]

0 commit comments

Comments
 (0)