Skip to content

feat: publish JSON Schema for flaglint.config.json #123

Description

@Krishan27

Summary

flaglint.config.json (and the inline Zod schema in src/config.ts) define a validated config shape, but there is no published JSON Schema that editors can use for autocompletion and inline validation. Without it, contributors writing a config file have no IDE guidance and must read the source.

Providing a schema at schema/flaglint-config.schema.json and linking it from the README gives users instant IDE autocompletion in VS Code, WebStorm, and any other editor that supports $schema.

Acceptance criteria

  • schema/flaglint-config.schema.json is present and valid JSON Schema (draft-07 or 2020-12)
  • It covers all fields currently defined in the Zod schema in src/config.ts:
    • staleThreshold, minFileCount, include, exclude, wrappers, enforce
  • A $schema example is shown in the README under the config section:
    {
      "$schema": "https://raw.githubusercontent.com/flaglint/flaglint/main/schema/flaglint-config.schema.json",
      "staleThreshold": 90
    }
  • The schema file is included in the npm package (files in package.json)

Implementation notes

  • The schema can be authored by hand from the Zod definition in src/config.ts — no codegen needed
  • Keep the schema in sync with the Zod schema; a comment in src/config.ts pointing to the schema file makes the coupling explicit

Files likely touched

  • schema/flaglint-config.schema.json — new file
  • package.json — add schema/ to files
  • README.md — add $schema usage example

No logic changes required — pure docs/config artifact. Great for a first contribution.

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationenhancementNew feature or requestgood first issueGood for newcomers

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions