npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@promptnroll/vali

v0.4.0

Published

AI 생성 코드의 환각, 슬롭, 과잉설계를 자동 감지하는 린터

Downloads

61

Readme

vali

AI 생성 코드의 환각, 슬롭, 과잉설계를 자동 감지하는 린터

npm version License: MIT Node.js

Copilot, Claude, Cursor 등 AI가 생성한 코드에서 흔히 발생하는 문제를 AST 기반으로 정적 분석합니다.

핵심 기능

  • 10개 내장 규칙 — 환각 import, 빈 함수, 과잉 설계, 중복 코드 등
  • 자동 수정--fix 옵션으로 즉시 코드 정리
  • ESLint 통합 — 에디터에서 실시간 피드백
  • 확장 가능defineRule()로 커스텀 규칙 추가
  • GitHub Action — CI/CD에서 SARIF 리포트 자동 업로드

Quick Start

# 설치
npm install -D @promptnroll/vali

# 검사 실행
npx @promptnroll/vali check src/

# 자동 수정
npx @promptnroll/vali check src/ --fix

사용법

CLI

# 기본 검사
vali check src/

# JSON 출력
vali check src/ --format json

# SARIF 출력 (GitHub Security 탭 연동)
vali check src/ --format sarif > results.sarif

# error만 출력
vali check src/ --quiet

# Git 변경 파일만 검사
vali check src/ --diff

# 규칙 목록 확인
vali rules

# 설정 초기화
vali init

설정 (.valirc.json)

{
  "rules": {
    "VAL001": true,
    "VAL004": ["info", { "threshold": 0.4 }],
    "VAL005": ["warning", { "maxLayers": 3 }]
  },
  "include": ["src/**/*.ts"],
  "exclude": ["**/*.test.ts"],
  "customRules": ["./custom-rules/*.ts"]
}

커스텀 규칙

defineRule()로 3줄이면 규칙을 추가할 수 있습니다:

import { defineRule } from '@promptnroll/vali';
import { SyntaxKind } from 'ts-morph';

export default defineRule({
  id: 'CUSTOM001',
  name: 'no-console-log',
  description: '프로덕션 코드에서 console.log 금지',
  check({ sourceFile, filePath }) {
    const diagnostics = [];
    for (const call of sourceFile.getDescendantsOfKind(SyntaxKind.CallExpression)) {
      if (call.getExpression().getText() === 'console.log') {
        diagnostics.push({
          ruleId: 'CUSTOM001',
          ruleName: 'no-console-log',
          severity: 'warning',
          message: 'console.log를 사용하지 마세요',
          file: filePath,
          line: call.getStartLineNumber(),
        });
      }
    }
    return diagnostics;
  },
});

.valirc.json에 등록:

{
  "customRules": ["./custom-rules/*.ts"]
}

자세한 내용은 커스텀 규칙 가이드를 참고하세요.

ESLint 통합

npm install -D @promptnroll/eslint-plugin-vali

eslint.config.js (Flat Config):

import vali from '@promptnroll/eslint-plugin-vali';

export default [
  vali.configs.recommended,
];

GitHub Action

- name: Vali Check
  uses: ./action
  with:
    target: src/
    format: sarif

규칙 목록

| ID | 이름 | 설명 | 심각도 | 자동수정 | |----|------|------|--------|---------| | VAL001 | hallucinated-import | 존재하지 않는 모듈 import | error | - | | VAL002 | hallucinated-api | 존재하지 않는 API 호출 | error | - | | VAL003 | empty-function | 빈 함수/메서드 | warning | O | | VAL004 | comment-bloat | 주석 비율 과다 | info | - | | VAL005 | over-engineered | 과잉 설계 패턴 | warning | - | | VAL006 | near-duplicate | 유사 중복 코드 | warning | - | | VAL007 | dead-parameter | 사용하지 않는 매개변수 | warning | O | | VAL008 | excessive-error | 불필요한 try-catch | warning | - | | VAL009 | ai-boilerplate | AI 생성 보일러플레이트 | warning | O | | VAL010 | unused-abstraction | 미사용 추상화 | info | - |

API

import { defineRule, rules, getRuleById } from '@promptnroll/vali';
import type { Rule, RuleContext, Diagnostic } from '@promptnroll/vali';

| Export Path | 내용 | |-------------|------| | @promptnroll/vali | defineRule, rules, config utilities | | @promptnroll/vali/api | defineRule + 타입 | | @promptnroll/vali/rules | 내장 규칙 배열 | | @promptnroll/vali/types | 타입 정의 |

기여하기

CONTRIBUTING.md를 참고해주세요.

라이선스

MIT