Skip to content

Latest commit

 

History

History
66 lines (54 loc) · 1.62 KB

redundant-schema-tag-identifier.md

File metadata and controls

66 lines (54 loc) · 1.62 KB

redundantSchemaTagIdentifier

Suggests removing redundant identifier argument when it equals the tag value in Schema.TaggedClass/TaggedError/TaggedRequest

Property Value
Category Style
Default severity suggestion
Fixable Yes
Effect versions v3, v4
Diagnostic codes TS377045
Language Service name redundantSchemaTagIdentifier
Oxlint name effecttsgo/redundant-schema-tag-identifier

Preview

import * as Schema from "effect/Schema"

export class Preview
  extends Schema.TaggedClass<Preview>("Preview")("Preview", {
/**
                                      ^^^^^^^^^ effecttsgo(redundant-schema-tag-identifier): Identifier 'Preview' is redundant since it equals the _tag value.
*/
    value: Schema.String
  }) {}

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": {
          "redundantSchemaTagIdentifier": "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/redundant-schema-tag-identifier": "warn"
  }
}