샘플
@typescript-eslint/scope-manager 8.65.0: Variable
검증된 샘플 — npm @typescript-eslint/scope-manager 8.65.0: Variable. node 22 · linux debian/x64 · docker에서 contract를 실행해 통과했습니다: assert Variable distinguishes…
sha256:b33e56ff98172d8068b95bc1466f63b574b4ad9cc770a50edd7847940a242cec
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
node 22.23 linux 24 · ubuntu · glibc 2.39 x64 node 22.23 javascript npm 10
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| node 22 · linux debian/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22@sha256:8a34c4ab3ea2… |
2026-09-05 |
케이스
HOW- 목표
- verify @typescript-eslint/scope-manager.Variable in pkg:npm/%40typescript-eslint/scope-manager@8.65.0
- 심벌
-
- @typescript-eslint/scope-manager.Variable
- 환경
- node 22.23.2
- 생성일
- 2026-09-05T19:04:44Z
컨트랙트
- assert Variable distinguishes value variables and type variables with isValueVariable and isTypeVariable
- assert Variable tracks definition AST identifiers and definitions array across redeclarations
- assert Variable records read and write references in scope with reference direction
- assert Variable maintains reference to its enclosing Scope
파일
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.cjs
소스
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 @typescript-eslint/scope-manager.Variable in pkg:npm/%40typescript-eslint/scope-manager@8.65.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40typescript-eslint/scope-manager@8.65.0
Demonstrate these symbols/APIs:
- @typescript-eslint/scope-manager.Variable
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.
{"case":{"caseId":"case:sha256:1bd089e36240a800a6661a9873db3238070f0f4897c2445b41c9b1c74a854ad9","constraints":{"executionContext":"node"},"contract":["assert Variable distinguishes value variables and type variables with isValueVariable and isTypeVariable","assert Variable tracks definition AST identifiers and definitions array across redeclarations","assert Variable records read and write references in scope with reference direction","assert Variable maintains reference to its enclosing Scope"],"goal":"verify @typescript-eslint/scope-manager.Variable in pkg:npm/%40typescript-eslint/scope-manager@8.65.0","kind":"HOW","packages":["pkg:npm/%40typescript-eslint/scope-manager@8.65.0"],"schemaVersion":1,"symbols":["@typescript-eslint/scope-manager.Variable"]},"contractCommand":["node","test/contract.cjs"],"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/scope-manager@8.65.0"],"schemaVersion":1,"subject":"pkg:npm/%40typescript-eslint/scope-manager@8.65.0","symbols":["@typescript-eslint/scope-manager.Variable"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-typescript-eslint-scope-manager",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-typescript-eslint-scope-manager",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@typescript-eslint/scope-manager": "8.65.0"
}
},
"node_modules/@typescript-eslint/scope-manager": {
"version": "8.65.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-8.65.0.tgz",
"integrity": "sha512-Esbl8OSYiVxBokYgWPf7VVWg/BE798wXhimnn9ML9Pt5qoDf8bfQlgjlKXR/k98+AcNzlLKYrpCcrcuZ9DZLgg==",
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.65.0",
"@typescript-eslint/visitor-keys": "8.65.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
}
},
"node_modules/@typescript-eslint/types": {
"version": "8.65.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-8.65.0.tgz",
"integrity": "sha512-JSSwWNy+H0E/01jJEM+hrX6N0OFDzFzeIhHFSAS01tlVaevpG8cFyYRPhS5yjGOvBUx3sqQHVMjCL1CAZZMxBg==",
"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.65.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-8.65.0.tgz",
"integrity": "sha512-8C71BQkGjiMmXtop7pHVJu1l2NNShFdkCyD6a2ezzs5vU/L3LRtb69EtcteFwz0mYMPzIgOw0n6OV4VBUWZd7A==",
"license": "MIT",
"dependencies": {
"@typescript-eslint/types": "8.65.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"
}
}
}
}
{
"name": "sample-typescript-eslint-scope-manager",
"version": "1.0.0",
"private": true,
"license": "MIT-0",
"dependencies": {
"@typescript-eslint/scope-manager": "8.65.0"
}
}
{
"schemaVersion": 1,
"goal": "verify @typescript-eslint/scope-manager.Variable in pkg:npm/%40typescript-eslint/scope-manager@8.65.0",
"kind": "HOW",
"packages": [
"pkg:npm/%40typescript-eslint/scope-manager@8.65.0"
],
"symbols": [
"@typescript-eslint/scope-manager.Variable"
]
}
const assert = require("node:assert");
const {
analyze,
Variable
} = require("@typescript-eslint/scope-manager");
// Construct AST covering value declarations, type aliases, classes, redeclarations, and references
const ast = {
type: "Program",
body: [
// const count = 42;
{
type: "VariableDeclaration",
kind: "const",
declarations: [
{
type: "VariableDeclarator",
id: { type: "Identifier", name: "count", range: [6, 11], decorators: [] },
init: { type: "Literal", value: 42, raw: "42", range: [14, 16] },
range: [6, 16]
}
],
range: [0, 17],
decorators: []
},
// type UserId = string;
{
type: "TSTypeAliasDeclaration",
id: { type: "Identifier", name: "UserId", range: [23, 29], decorators: [] },
typeAnnotation: { type: "TSStringKeyword", range: [32, 38] },
range: [18, 39]
},
// class Session {}
{
type: "ClassDeclaration",
id: { type: "Identifier", name: "Session", range: [46, 53], decorators: [] },
superClass: null,
implements: [],
body: { type: "ClassBody", body: [], range: [54, 56] },
range: [40, 56],
decorators: []
},
// var status = "init"; var status = "ready";
{
type: "VariableDeclaration",
kind: "var",
declarations: [
{
type: "VariableDeclarator",
id: { type: "Identifier", name: "status", range: [61, 67], decorators: [] },
init: { type: "Literal", value: "init", raw: '"init"', range: [70, 76] },
range: [61, 76]
}
],
range: [57, 77],
decorators: []
},
{
type: "VariableDeclaration",
kind: "var",
declarations: [
{
type: "VariableDeclarator",
id: { type: "Identifier", name: "status", range: [82, 88], decorators: [] },
init: { type: "Literal", value: "ready", raw: '"ready"', range: [91, 98] },
range: [82, 98]
}
],
range: [78, 99],
decorators: []
},
// count;
{
type: "ExpressionStatement",
expression: { type: "Identifier", name: "count", range: [100, 105] },
range: [100, 106]
}
],
sourceType: "module",
range: [0, 110],
comments: [],
tokens: []
};
const scopeManager = analyze(ast, { sourceType: "module" });
const moduleScope = scopeManager.scopes.find(s => s.type === "module");
assert(moduleScope, "module scope must exist");
// 1. Assert Variable distinguishes value variables and type variables with isValueVariable and isTypeVariable
const countVar = moduleScope.set.get("count");
assert(countVar instanceof Variable, "count is an instance of Variable");
assert.strictEqual(countVar.name, "count", "count variable has name count");
assert.strictEqual(countVar.isValueVariable, true, "count is a value variable");
assert.strictEqual(countVar.isTypeVariable, false, "count is not a type variable");
const typeVar = moduleScope.set.get("UserId");
assert(typeVar instanceof Variable, "UserId is an instance of Variable");
assert.strictEqual(typeVar.name, "UserId", "UserId variable has name UserId");
assert.strictEqual(typeVar.isValueVariable, false, "UserId is not a value variable");
assert.strictEqual(typeVar.isTypeVariable, true, "UserId is a type variable");
const classVar = moduleScope.set.get("Session");
assert(classVar instanceof Variable, "Session is an instance of Variable");
assert.strictEqual(classVar.name, "Session", "Session variable has name Session");
assert.strictEqual(classVar.isValueVariable, true, "Session class is a value variable");
assert.strictEqual(classVar.isTypeVariable, true, "Session class is a type variable");
// 2. Assert Variable tracks definition AST identifiers and definitions array across redeclarations
const statusVar = moduleScope.set.get("status");
assert(statusVar instanceof Variable, "status is an instance of Variable");
assert.strictEqual(statusVar.name, "status", "status variable has name status");
assert.strictEqual(statusVar.identifiers.length, 2, "redeclared variable has 2 identifier AST nodes");
assert.strictEqual(statusVar.identifiers[0].name, "status", "first identifier matches name");
assert.strictEqual(statusVar.identifiers[1].name, "status", "second identifier matches name");
assert.strictEqual(statusVar.defs.length, 2, "redeclared variable has 2 definitions");
assert.strictEqual(statusVar.defs[0].name.name, "status", "first def name matches");
assert.strictEqual(statusVar.defs[1].name.name, "status", "second def name matches");
// 3. Assert Variable records read and write references in scope with reference direction
assert(countVar.references.length >= 2, "count variable records write and read references");
const writeRef = countVar.references.find(ref => ref.isWrite());
const readRef = countVar.references.find(ref => ref.isRead());
assert(writeRef, "count has a write reference from initialization");
assert.strictEqual(writeRef.identifier.name, "count", "write reference identifier is count");
assert(readRef, "count has a read reference from expression statement");
assert.strictEqual(readRef.identifier.name, "count", "read reference identifier is count");
// 4. Assert Variable maintains reference to its enclosing Scope
assert.strictEqual(countVar.scope, moduleScope, "count references its enclosing module scope");
assert.strictEqual(typeVar.scope, moduleScope, "UserId references its enclosing module scope");
assert.strictEqual(statusVar.scope, moduleScope, "status references its enclosing module scope");
오리진 시더
익명