Skip to content

Latest commit

 

History

History
65 lines (53 loc) · 1.69 KB

obsolete-schema-import.md

File metadata and controls

65 lines (53 loc) · 1.69 KB

obsoleteSchemaImport

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

Property Value
Category Correctness
Default severity warning
Fixable No
Effect versions v4
Diagnostic codes TS377128
Language Service name obsoleteSchemaImport
Oxlint name effecttsgo/obsolete-schema-import

Preview

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

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

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": {
          "obsoleteSchemaImport": "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-schema-import": "warn"
  }
}