Skip to content

Latest commit

 

History

History
65 lines (53 loc) · 1.68 KB

obsolete-match-import.md

File metadata and controls

65 lines (53 loc) · 1.68 KB

obsoleteMatchImport

Warns when importing @effect/match in projects targeting Effect v4, where Match is included directly in the effect package

Property Value
Category Correctness
Default severity warning
Fixable No
Effect versions v4
Diagnostic codes TS377129
Language Service name obsoleteMatchImport
Oxlint name effecttsgo/obsolete-match-import

Preview

import { Effect } from "effect"
// @ts-expect-error - @effect/match is obsolete in v4
import * as Match from "@effect/match"
/**
                       ^^^^^^^^^^^^^^^ effecttsgo(obsolete-match-import): This module reference imports `@effect/match`, which is obsolete in Effect v4. In Effect v4, pattern matching is provided directly by `Match` from `effect` (or `effect/Match`).
*/

export const preview = Effect.sync(() => Match)

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": {
          "obsoleteMatchImport": "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/obsolete-match-import": "warn"
  }
}