typescript — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited typescript (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
TypeScript 핸드북 기반 타입 정의 및 베스트 프랙티스. 기본 문법·타입 조작·유틸리티 타입 상세는 references/ 및 Handbook 참고.
불필요한 어노테이션 생략. 변경 시 이중 수정 부담 감소, 추론이 더 정확한 경우 많음.
// ❌
const name: string = "John";
const user: { name: string; age: number } = { name: "John", age: 30 };
// ✅
const name = "John";
const user = { name: "John", age: 30 };함수 계약 명확화, 반환 타입 오변경 방지. 공개 API·복잡한 로직에서 필수.
function calculateTotal(items: Item[]): number {
return items.reduce((sum, item) => sum + item.price, 0);
}
async function fetchUser(id: string): Promise<User> {
const res = await fetch(`/api/users/${id}`);
return res.json();
}타입 안전성·자동완성 무효화. unknown + 타입 가드 또는 구체 타입 사용.
// ❌
function process(data: any) {
return data.value;
}
// ✅
function process(data: unknown): number {
if (typeof data === "object" && data !== null && "value" in data)
return (data as { value: number }).value;
throw new Error("Invalid data");
}T, K extends keyof T 등 제약 명시. getProperty<T, K extends keyof T>(obj: T, key: K): T[K] 패턴 활용.typeof, instanceof, in으로 분기 후 타입 좁히기(value): value is T 사용템플릿: assets/types.guards.ts템플릿:
>
-assets/tsconfig.nextjs.ts-assets/tsconfig.node.ts-assets/tsconfig.react.ts
템플릿: assets/types.events.ts템플릿: assets/types.utils.tsinterface, 유니온/인터섹션은 type. API 설명은 명사형으로 작성 (/** 비활성화 상태 */).typeof obj[keyof typeof obj] 로 이넘처럼 활용.type UserId = string & { readonly brand: unique symbol } 로 동일 원시 타입 구분.as 대신 타입 가드.T extends object 등 명시.| 에러 | 대응 |
|---|---|
Type 'X' is not assignable to type 'Y' | 타입 가드로 분기 후 할당 |
Property 'X' does not exist on type 'Y' | 타입 확장 또는 optional |
Object is possibly 'null' or 'undefined' | if (x == null) / ?. / ?? |
Argument of type 'X' is not assignable to parameter of type 'Y' | 제네릭 T[] 또는 오버로드 |
Type 'X' cannot be used as an index type | keyof typeof obj 사용 |
디버깅: 호버로 추론 확인, 가드·제네릭·유틸리티 타입으로 해결 후 as는 최후 수단.
이 문서들은 규칙이 아니라 참고용, 판단 기준은 각 skill 문서를 우선
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.