JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 265
  • Score
    100M100P100Q81841F
  • License MIT

Thin wrapper around FTA (Fast TypeScript Analyzer) that provides actionable error messages for automated code quality checks and AI agent guidance

Package Exports

  • fta-check
  • fta-check/dist/cli.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (fta-check) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

fta-check

A thin wrapper around FTA (Fast TypeScript Analyzer) that provides actionable error messages for automated code quality checks and AI agent guidance.

Installation

npm install --save-dev fta-check fta-cli
# or
pnpm add -D fta-check fta-cli
# or
yarn add -D fta-check fta-cli

Note: fta-cli is a peer dependency and must be installed alongside fta-check. The fta-check CLI executes the fta binary directly from your PATH (no hard dependency on pnpm). Ensure fta-cli is installed locally so fta is available.

Usage

# Analyze current directory
npx fta-check
# or
pnpm exec fta-check

# Analyze specific directory
npx fta-check ./src

# Show help
npx fta-check --help

Configuration

Default Settings

fta-check applies sensible defaults that exclude test files from analysis:

{
  "exclude_filenames": ["*.test.{ts,tsx}"]
}

This means most projects don't need an fta.json file at all.

Customizing Configuration

Create an fta.json file in your project root to customize settings. Each key you specify completely replaces the corresponding default (no merging). See the official FTA configuration docs for all available options.

To include test files in analysis, override the default with an empty array:

{
  "exclude_filenames": []
}

Use --threshold (not score_cap) with fta-check to control which files are reported as violations while ensuring a detailed report is generated.

Troubleshooting

  • Error: FTA CLI not found on PATH
    • Install the peer dependency in your project: npm i -D fta-cli (or yarn add -D fta-cli, pnpm add -D fta-cli).
    • Verify npx fta --version works in your project directory.

What does it do?

fta-check runs FTA analysis and formats the output to show:

  • File-level metrics: Complexity scores, maintainability ratings, and Halstead metrics
  • Actionable recommendations: Clear guidance on which files need attention
  • Human-readable reports: Color-coded output with severity indicators

Example Output


Analyzing TypeScript files...

⚠️ High Complexity Files:

src/complex-service.ts
Cyclomatic Complexity: 45 (threshold: 20)
Maintainability: 42.3 (threshold: 65)
→ Consider refactoring this file into smaller functions

✓ 12 files analyzed
⚠️ 1 file needs attention

Development

# Install dependencies
pnpm install

# Build the project
pnpm run build

# Watch mode for development
pnpm run dev

# Test locally
node ./bin/fta-check --help

License

MIT © Łukasz Jerciński