360 Secure SkillHub
360 安全技能中心

Json Linter

这是一款JSON语法校验工具,核心功能是递归扫描工作区或指定目录的.json文件,通过JSON.parse()验证语法正确性。典型场景包括检查配置文件、内存文件、数据资产等的语法错误。支持默认扫描当前工作区,或通过--dir指定目录;输出含扫描时间、文件统计及错误详情的JSON报告。

wanng-ide
wanng-ide
热度 94.07
最近更新 2026-05-11 17:25:49
分类:开发依赖:代码执行 / 读写文件应用场景:代码审查 / 数据处理

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add json-linter
Metadata
name
json-linter
description
Validates JSON syntax across the workspace. Use this skill to check for syntax errors in configuration files, memory files, or data assets.

JSON Linter

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

Usage

# 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

{
  "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"
    }
  ]
}