json-linter

TotalClaw 作者 totalclaw

跨工作区验证 JSON 语法。使用此技能检查配置文件、内存文件或数据资产中的语法错误。

安装 / 下载方式

TotalClaw CLI推荐
totalclaw install totalclaw:totalclaw~wanng-ide-json-linter
cURL直接下载,无需登录
curl -fsSL https://skills.taituai.com/api/skills/totalclaw%3Atotalclaw~wanng-ide-json-linter/file -o wanng-ide-json-linter.md
## 概述(中文)

跨工作区验证 JSON 语法。使用此技能检查配置文件、内存文件或数据资产中的语法错误。

## 原文

# JSON Linter

A simple utility to recursively scan the workspace for `.json` files and validate their syntax using `JSON.parse()`.

## Usage

```bash
# Scan the entire workspace (from current working directory)
node skills/json-linter/index.js

# Scan a specific directory
node skills/json-linter/index.js --dir path/to/dir
```

## Output

JSON report containing:
- `scanned_at`: Timestamp
- `total_files`: Number of `.json` files scanned
- `valid_files`: Number of valid files
- `invalid_files`: Number of invalid files
- `errors`: Array of error objects:
  - `path`: Relative path to file
  - `error`: Error message (e.g., "Unexpected token } in JSON at position 42")

## Example Output

```json
{
  "scanned_at": "2026-02-14T21:45:00.000Z",
  "total_files": 150,
  "valid_files": 149,
  "invalid_files": 1,
  "errors": [
    {
      "path": "config/broken.json",
      "error": "Unexpected token } in JSON at position 42"
    }
  ]
}
```