globalDate

August 4, 2026 ยท View on GitHub

Warns when using Date.now() or new Date() outside Effect generators instead of Clock/DateTime

PropertyValue
CategoryEffect-native
Default severityoff
FixableNo
Effect versionsv3, v4
Diagnostic codesTS377066, TS377068
Language Service nameglobalDate
Oxlint nameeffecttsgo/global-date

Preview

export const preview = Date.now()
/**
                       ^^^^^^^^^^ effecttsgo(global-date): This code uses `Date.now()`, time access is represented through `Clock` from Effect.
*/

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": {
          "globalDate": "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-date": "warn"
  }
}