Skip to content

Configuration

@masumdev/tscheck exclusively uses type-safe TypeScript/JavaScript configuration (tscheck.config.ts, tscheck.config.js, tscheck.config.mjs, tscheck.config.cjs).

When no explicit configuration file path is passed via -c or --config, tscheck automatically searches the current directory and walks up the directory tree to discover:

  1. tscheck.config.ts
  2. tscheck.config.js
  3. tscheck.config.mjs
  4. tscheck.config.cjs

TypeScript Configuration (tscheck.config.ts)

Use the defineConfig() helper with the Editor Enum for compile-time type validation, autocompletion, and JSDoc tooltips:

import { defineConfig, Editor } from "@masumdev/tscheck";
export default defineConfig({
rootDir: process.cwd(),
workspaces: ["packages/*", "apps/*"],
exclude: ["node_modules", "dist", "build", ".expo", ".turbo", ".temp"],
editor: Editor.CURSOR, // VSCODE, CURSOR, ANTIGRAVITY, WINDSURF, ZED, WEBSTORM, SUBLIME
rules: {
deprecated: true,
unused: true,
noExplicitAny: true,
circular: true,
},
reporters: {
outputDir: ".temp/tscheck",
json: true,
markdown: true,
html: true,
ai: true,
},
failOnWarning: false,
});

Inline Comment Suppression

You can selectively disable inspections for individual lines or blocks of code using comment annotations:

// 1. Ignore next line for a specific rule
// tscheck-ignore-next-line any
const rawData: any = JSON.parse(response);
// 2. Ignore multiple rules on next line
// tscheck-ignore-next-line any, deprecated
const result: any = legacyHelper();
// 3. Ignore all rules on next line
// tscheck-ignore-next-line
const oldItem: any = oldApi();
// 4. Block-level suppression
/* tscheck-disable any */
const a: any = 1;
const b: any = 2;
/* tscheck-enable any */

Supported Rule Keywords in Comments

  • deprecated
  • unused
  • any / noExplicitAny
  • circular
  • all

Configuration Options Reference

rootDir

  • Type: string
  • Default: "." (resolved to process.cwd())

workspaces

  • Type: string[]
  • Default: ["packages/*", "apps/*"] (or fallback to root tsconfig.json)

exclude

  • Type: string[]
  • Default: ["node_modules", "dist", "build", ".expo", ".turbo", ".temp"]

staged

  • Type: boolean
  • Default: false

since

  • Type: string
  • Example: "main" or "HEAD~1"

fix

  • Type: boolean
  • Default: false

format

  • Type: "pretty" | "json" | "github" | "ai"
  • Default: "pretty"

serve

  • Type: boolean
  • Default: true (starts local HTTP report server after audit)

open

  • Type: boolean
  • Default: false

port

  • Type: number
  • Default: 5500

editor

  • Type: "vscode" | "cursor" | "antigravity" | "windsurf" | "zed" | "webstorm" | "sublime" | "vscode-insiders"
  • Default: "vscode"

reporters

  • Type: object
    • outputDir?: string (Default: ".temp/tscheck"): Destination folder for generated reports.
    • json?: boolean (Default: true): Generates audit-report.json.
    • markdown?: boolean (Default: true): Generates audit-report.md.
    • html?: boolean (Default: true): Generates interactive audit-report.html with real-time search, filters, dark/light theme, and clickable editor links.
    • ai?: boolean (Default: true): Generates token-efficient audit-report.ai.md.
    • githubAnnotations?: boolean (Default: false): Emits GitHub Actions workflow annotations.