CodeSampleX

샘플

@typescript-eslint/visitor-keys 8.66.0

검증된 샘플 — npm @typescript-eslint/visitor-keys 8.66.0. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: visitorKeys defines AST visitor key mappings…

sha256:aa3f96e8a137d77b1db46e5f952bff381a70cc99b0cdb8f6727812ff84a8cd9e

이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다. 통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다. MIT-0

실행 증거

선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.

증거 기준
서명된 컨트랙트 통과
검증 영수증
1
빌드한 서명 키
1
선언된 환경 node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10

검증 실행 환경

환경 컨트랙트 단계 실행일
node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 PASS compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS
CONTAINER_RUN · node-typescript@1
2026-08-21

케이스

HOW
목표
verify pkg:npm/%40typescript-eslint/visitor-keys@8.66.0
패키지
환경
node 22.23.2
생성일
2026-08-21T09:44:50Z

컨트랙트

  1. visitorKeys defines AST visitor key mappings for TypeScript syntax nodes including TSInterfaceDeclaration and TSTypeAnnotation
  2. visitorKeys extends ESTree ClassDeclaration keys with TypeScript-specific decorators and typeParameters
  3. getKeys extracts enumerable property keys from AST nodes excluding blacklisted and underscore properties

파일

  • PROMPT.md
  • csx.json
  • index.js
  • package-lock.json
  • package.json
  • spec.json
  • test/contract.js

소스 아티팩트 내려받기 (tar.gz)

소스

PROMPT.md
Clean-room public code sample — generation instructions

Write a brand-new, minimal, self-contained code sample in this clean-room directory.
Do not copy, paraphrase, or reference any existing project source. Work only from this spec.

A csx.json manifest scaffold already exists. Do not recreate it from memory. Preserve its case.goal, packages and symbols; fill its empty case.contract with exact assertions and correct its environment, commands and verifierAdapter for the files you generate.

Goal: verify pkg:npm/%40typescript-eslint/visitor-keys@8.66.0
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/%40typescript-eslint/visitor-keys@8.66.0
Constraints:
  - executionContext: node
Required runtime conditions:
  - ecosystem: npm
  - language: javascript
  - moduleSystem: cjs
  - packageManager: npm@10.9.8
  - runtime: node@22.23.2

Rules:
  - One focused purpose; the smallest project that proves the goal.
  - Include a contract test (test/contract.*) that runs OFFLINE and exits 0 exactly when the goal behavior works.
  - Pin every dependency with a lockfile so resolution is reproducible.
  - No secrets, credentials, or tokens. No real URLs (only example.com or localhost). No absolute paths.
  - No personal names, emails, company names, or project identifiers of any kind.
  - No binaries and no generated output (node_modules, dist, target, venv, .git, .env).
  - Keep it under 200 files and 256KB packed.
csx.json
{"case":{"caseId":"case:sha256:246848ea164c81590b1c75a669672ee61e0e6864679c46fee1ba2c444bbabc66","constraints":{"executionContext":"node"},"contract":["visitorKeys defines AST visitor key mappings for TypeScript syntax nodes including TSInterfaceDeclaration and TSTypeAnnotation","visitorKeys extends ESTree ClassDeclaration keys with TypeScript-specific decorators and typeParameters","getKeys extracts enumerable property keys from AST nodes excluding blacklisted and underscore properties"],"goal":"verify pkg:npm/%40typescript-eslint/visitor-keys@8.66.0","kind":"HOW","packages":["pkg:npm/%40typescript-eslint/visitor-keys@8.66.0"],"schemaVersion":1},"contractCommand":["node","test/contract.js"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","executionContext":"node","language":"javascript","libc":"glibc","libcVersion":"2.39","moduleSystem":"cjs","os":"linux","osVersionBucket":"24","packageManager":"npm","packageManagerVersion":"10.9.8","runtime":"node","runtimeVersion":"22.23.2","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/%40typescript-eslint/visitor-keys@8.66.0"],"schemaVersion":1,"subject":"pkg:npm/%40typescript-eslint/visitor-keys@8.66.0","verifierAdapter":"node-typescript@1"}
index.js
const { visitorKeys, getKeys } = require('@typescript-eslint/visitor-keys');

function getVisitorKeysForType(type) {
  return visitorKeys[type];
}

function getNodeKeys(node) {
  return getKeys(node);
}

module.exports = {
  visitorKeys,
  getKeys,
  getVisitorKeysForType,
  getNodeKeys,
};
package-lock.json
{
  "name": "sample",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample",
      "version": "1.0.0",
      "dependencies": {
        "@typescript-eslint/visitor-keys": "8.66.0"
      }
    },
    "node_modules/@typescript-eslint/types": {
      "version": "8.66.0",
      "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.66.0.tgz",
      "integrity": "sha512-H6gcYaSDOyvL3AD/jHUtUFo2jqGgn/F6nuyuZSu0QTesxL+cP4dQoIMrODRofuJC09g64+WgZ6tE19Y1N2YIFQ==",
      "license": "MIT",
      "engines": {
        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/typescript-eslint"
      }
    },
    "node_modules/@typescript-eslint/visitor-keys": {
      "version": "8.66.0",
      "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.66.0.tgz",
      "integrity": "sha512-dkKR8q+lKciskj1Y3vthHktl+3cMLWGyVUP23bRiPZ5O9BRT++4EqDDV+TVeIKBL1VXVEqrJlz8MYbcnvJcAlg==",
      "license": "MIT",
      "dependencies": {
        "@typescript-eslint/types": "8.66.0",
        "eslint-visitor-keys": "^5.0.0"
      },
      "engines": {
        "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
      },
      "funding": {
        "type": "opencollective",
        "url": "https://opencollective.com/typescript-eslint"
      }
    },
    "node_modules/eslint-visitor-keys": {
      "version": "5.0.1",
      "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-5.0.1.tgz",
      "integrity": "sha512-tD40eHxA35h0PEIZNeIjkHoDR4YjjJp34biM0mDvplBe//mB+IHCqHDGV7pxF+7MklTvighcCPPZC7ynWyjdTA==",
      "license": "Apache-2.0",
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      },
      "funding": {
        "url": "https://opencollective.com/eslint"
      }
    }
  }
}
package.json
{
  "name": "sample",
  "version": "1.0.0",
  "description": "Minimal sample verifying @typescript-eslint/visitor-keys",
  "main": "index.js",
  "type": "commonjs",
  "dependencies": {
    "@typescript-eslint/visitor-keys": "8.66.0"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:npm/%40typescript-eslint/visitor-keys@8.66.0",
  "kind": "HOW",
  "packages": [
    "pkg:npm/%40typescript-eslint/visitor-keys@8.66.0"
  ],
  "constraints": {
    "executionContext": "node"
  },
  "runtimeConditions": {
    "ecosystem": "npm",
    "language": "javascript",
    "moduleSystem": "cjs",
    "packageManager": "npm@10.9.8",
    "runtime": "node@22.23.2"
  }
}
test/contract.js
const assert = require('node:assert');
const {
  visitorKeys,
  getKeys,
  getVisitorKeysForType,
  getNodeKeys,
} = require('../index.js');

// Contract 1: visitorKeys defines AST visitor key mappings for TypeScript syntax nodes including TSInterfaceDeclaration and TSTypeAnnotation
assert(typeof visitorKeys === 'object' && visitorKeys !== null, 'visitorKeys must be an object');
assert.deepStrictEqual(
  getVisitorKeysForType('TSInterfaceDeclaration'),
  ['id', 'typeParameters', 'extends', 'body'],
  'TSInterfaceDeclaration must have visitor keys [id, typeParameters, extends, body]'
);
assert.deepStrictEqual(
  getVisitorKeysForType('TSTypeAnnotation'),
  ['typeAnnotation'],
  'TSTypeAnnotation must have visitor keys [typeAnnotation]'
);
assert.deepStrictEqual(
  getVisitorKeysForType('TSPropertySignature'),
  ['key', 'typeAnnotation'],
  'TSPropertySignature must have visitor keys [key, typeAnnotation]'
);

// Contract 2: visitorKeys extends ESTree ClassDeclaration keys with TypeScript-specific decorators and typeParameters
const classDeclKeys = getVisitorKeysForType('ClassDeclaration');
assert(Array.isArray(classDeclKeys), 'ClassDeclaration keys must be an array');
assert(classDeclKeys.includes('decorators'), 'ClassDeclaration keys must include decorators');
assert(classDeclKeys.includes('typeParameters'), 'ClassDeclaration keys must include typeParameters');
assert(classDeclKeys.includes('superTypeArguments'), 'ClassDeclaration keys must include superTypeArguments');
assert(classDeclKeys.includes('implements'), 'ClassDeclaration keys must include implements');
assert.deepStrictEqual(
  classDeclKeys,
  ['decorators', 'id', 'typeParameters', 'superClass', 'superTypeArguments', 'implements', 'body'],
  'ClassDeclaration keys must match expected TypeScript-ESTree visitor order'
);

// Contract 3: getKeys extracts enumerable property keys from AST nodes excluding blacklisted and underscore properties
const mockTsNode = {
  type: 'TSInterfaceDeclaration',
  id: { type: 'Identifier', name: 'User' },
  body: { type: 'TSInterfaceBody', body: [] },
  leadingComments: [{ type: 'Line', value: 'comment' }],
  trailingComments: [],
  comments: [],
  tokens: [],
  parent: null,
  _internalState: 'secret',
  customProp: 'value',
};

const extractedKeys = getNodeKeys(mockTsNode);
assert(Array.isArray(extractedKeys), 'getKeys must return an array of keys');
assert.strictEqual(extractedKeys.includes('type'), true, 'getKeys must include type');
assert.strictEqual(extractedKeys.includes('id'), true, 'getKeys must include id');
assert.strictEqual(extractedKeys.includes('body'), true, 'getKeys must include body');
assert.strictEqual(extractedKeys.includes('customProp'), true, 'getKeys must include customProp');
assert.strictEqual(extractedKeys.includes('_internalState'), false, 'getKeys must filter out underscore-prefixed properties');
assert.strictEqual(extractedKeys.includes('parent'), false, 'getKeys must filter out parent property');
assert.strictEqual(extractedKeys.includes('leadingComments'), false, 'getKeys must filter out leadingComments');
assert.strictEqual(extractedKeys.includes('trailingComments'), false, 'getKeys must filter out trailingComments');

console.log('All visitor-keys contracts passed successfully.');

오리진 시더

익명