Warns when using the global fetch function outside Effect generators instead of the Effect HTTP client
| Property | Value |
|---|---|
| Category | Effect-native |
| Default severity | off |
| Fixable | No |
| Effect versions | v3, v4 |
| Diagnostic codes | TS377061 |
| Language Service name | globalFetch |
| Oxlint name | effecttsgo/global-fetch |
export const preview = fetch("https://example.com")
/**
^^^^^ effecttsgo(global-fetch): This code uses the global `fetch` function, HTTP requests are represented through `HttpClient` from `@effect/platform`.
*/See the Language Service setup guide for installation instructions.
See the Oxlint setup guide for installation and patching instructions.
{
"$schema": "./node_modules/@effect/tsgo/oxlint-schema.json",
"options": {
"typeAware": true
},
"plugins": ["effecttsgo"],
"rules": {
"effecttsgo/global-fetch": "warn"
}
}
{ "$schema": "./node_modules/@effect/tsgo/schema.json", "compilerOptions": { "plugins": [ { "name": "@effect/language-service", "diagnosticSeverity": { "globalFetch": "warning" } } ] } }