Skip to content

Latest commit

 

History

History
65 lines (53 loc) · 1.51 KB

global-console-in-effect.md

File metadata and controls

65 lines (53 loc) · 1.51 KB

globalConsoleInEffect

Warns when using console methods inside Effect generators instead of Effect.log/Logger

Property Value
Category Effect-native
Default severity off
Fixable No
Effect versions v3, v4
Diagnostic codes TS377065
Language Service name globalConsoleInEffect
Oxlint name effecttsgo/global-console-in-effect

Preview

import { Effect } from "effect"

export const preview = Effect.gen(function*() {
  console.log("hello")
/**
  ^^^^^^^^^^^^^^^^^^^^ effecttsgo(global-console-in-effect): This Effect code uses `console.log`, logging in Effect code is represented through `Effect.log or Logger`.
*/
})

Language Service Configuration

See the Language Service setup guide for installation instructions.

{
  "$schema": "./node_modules/@effect/tsgo/schema.json",
  "compilerOptions": {
    "plugins": [
      {
        "name": "@effect/language-service",
        "diagnosticSeverity": {
          "globalConsoleInEffect": "warning"
        }
      }
    ]
  }
}

Oxlint Configuration

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-console-in-effect": "warn"
  }
}