샘플
eslint-scope 8.4.0: eslint-scope
검증된 샘플 — npm eslint-scope 8.4.0: eslint-scope. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: analyze creates ImportBinding definition for…
sha256:e99fe92a45435ee65cf59863b0a13b01d51f90aea21ccde9c47155fb2cb707d2
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
linux 24 · ubuntu · glibc 2.39 x64 npm
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| node 22 · linux alpine/x64 · docker ed25519:c1973797be207ac4 | PASS | compile:SKIPPED · contract:PASS · load:PASS · resolve:PASS CONTAINER_RUN · node-typescript@1node:22-alpine@sha256:c610fcdfb1d5… |
2026-08-27 |
케이스
HOW- 목표
- verify eslint-scope in pkg:npm/eslint-scope@8.4.0
- 심벌
-
- eslint-scope
- 생성일
- 2026-08-27T09:53:58Z
컨트랙트
- analyze creates ImportBinding definition for module imports referenced across scopes
- ClassDeclaration creates ClassScope and binds class name in both outer and class scopes
- MethodDefinition FunctionExpression creates function scope with arguments and parameter definitions
- ArrowFunctionExpression creates function scope without arguments binding
- ArrowFunctionExpression resolves lexical references to outer method parameters
파일
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- test/contract.mjs
소스
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 eslint-scope in pkg:npm/eslint-scope@8.4.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/eslint-scope@8.4.0
Demonstrate these symbols/APIs:
- eslint-scope
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:373d8ad3c1b1fc24c8e14186902c2eca4b61b31391e06c1c1acc85ec2c022efa","contract":["analyze creates ImportBinding definition for module imports referenced across scopes","ClassDeclaration creates ClassScope and binds class name in both outer and class scopes","MethodDefinition FunctionExpression creates function scope with arguments and parameter definitions","ArrowFunctionExpression creates function scope without arguments binding","ArrowFunctionExpression resolves lexical references to outer method parameters"],"goal":"verify eslint-scope in pkg:npm/eslint-scope@8.4.0","kind":"HOW","packages":["pkg:npm/eslint-scope@8.4.0"],"schemaVersion":1,"symbols":["eslint-scope"]},"contractCommand":["node","test/contract.mjs"],"environment":{"arch":"x64","distro":"ubuntu","ecosystem":"npm","libc":"glibc","libcVersion":"2.39","os":"linux","osVersionBucket":"24","packageManager":"npm","schemaVersion":1},"license":"MIT-0","packages":["pkg:npm/eslint-scope@8.4.0"],"schemaVersion":1,"subject":"pkg:npm/eslint-scope@8.4.0","symbols":["eslint-scope"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-eslint-scope",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-eslint-scope",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"eslint-scope": "8.4.0"
}
},
"node_modules/eslint-scope": {
"version": "8.4.0",
"resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-8.4.0.tgz",
"integrity": "sha512-sNXOfKCn74rt8RICKMvJS7XKV/Xk9kA7DyJr8mJik3S7Cwgy3qlkkmyS2uQB3jiJg6VNdZd/pDBJu0nvG2NlTg==",
"license": "BSD-2-Clause",
"dependencies": {
"esrecurse": "^4.3.0",
"estraverse": "^5.2.0"
},
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"url": "https://opencollective.com/eslint"
}
},
"node_modules/esrecurse": {
"version": "4.3.0",
"resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz",
"integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==",
"license": "BSD-2-Clause",
"dependencies": {
"estraverse": "^5.2.0"
},
"engines": {
"node": ">=4.0"
}
},
"node_modules/estraverse": {
"version": "5.3.0",
"resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz",
"integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==",
"license": "BSD-2-Clause",
"engines": {
"node": ">=4.0"
}
}
}
}
{
"name": "sample-eslint-scope",
"version": "1.0.0",
"type": "module",
"license": "MIT-0",
"dependencies": {
"eslint-scope": "8.4.0"
}
}
{
"schemaVersion": 1,
"goal": "verify eslint-scope in pkg:npm/eslint-scope@8.4.0",
"kind": "HOW",
"packages": [
"pkg:npm/eslint-scope@8.4.0"
],
"symbols": [
"eslint-scope"
]
}
import assert from 'node:assert/strict';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const { analyze } = require('eslint-scope');
// Build an ESTree AST representing import declarations, class hierarchy, method definition, and nested arrow function
const importDecl = {
type: 'ImportDeclaration',
range: [0, 35],
specifiers: [
{
type: 'ImportSpecifier',
range: [9, 17],
imported: { type: 'Identifier', name: 'helper', range: [9, 15] },
local: { type: 'Identifier', name: 'myHelper', range: [9, 17] }
}
],
source: { type: 'Literal', value: './helper.js', raw: "'./helper.js'", range: [24, 35] }
};
const arrowFunc = {
type: 'ArrowFunctionExpression',
range: [105, 179],
id: null,
params: [
{ type: 'Identifier', name: 'delta', range: [106, 111] }
],
body: {
type: 'BinaryExpression',
range: [116, 179],
operator: '+',
left: { type: 'Identifier', name: 'item', range: [116, 120] },
right: { type: 'Identifier', name: 'delta', range: [123, 128] }
},
expression: true
};
const methodFunc = {
type: 'FunctionExpression',
range: [81, 186],
id: null,
params: [
{ type: 'Identifier', name: 'item', range: [82, 86] }
],
body: {
type: 'BlockStatement',
range: [88, 186],
body: [
{
type: 'ReturnStatement',
range: [98, 180],
argument: arrowFunc
}
]
}
};
const classDecl = {
type: 'ClassDeclaration',
range: [37, 190],
id: { type: 'Identifier', name: 'Service', range: [43, 50] },
superClass: { type: 'Identifier', name: 'myHelper', range: [59, 67] },
body: {
type: 'ClassBody',
range: [68, 190],
body: [
{
type: 'MethodDefinition',
range: [74, 186],
key: { type: 'Identifier', name: 'process', range: [74, 81] },
computed: false,
kind: 'method',
static: false,
value: methodFunc
}
]
}
};
const ast = {
type: 'Program',
range: [0, 190],
sourceType: 'module',
body: [importDecl, classDecl]
};
const scopeManager = analyze(ast, {
ecmaVersion: 2022,
sourceType: 'module'
});
assert.strictEqual(scopeManager.scopes.length, 5);
const [, moduleScope, classScope, methodScope, arrowScope] = scopeManager.scopes;
// 1. analyze creates ImportBinding definition for module imports referenced across scopes
const helperVar = moduleScope.set.get('myHelper');
assert.ok(helperVar, 'myHelper variable should exist in module scope');
assert.strictEqual(helperVar.defs[0].type, 'ImportBinding');
assert.strictEqual(helperVar.references.length, 1);
assert.strictEqual(helperVar.references[0].from, classScope);
// 2. ClassDeclaration creates ClassScope and binds class name in both outer and class scopes
assert.strictEqual(classScope.type, 'class');
assert.strictEqual(classScope.block, classDecl);
const outerClassVar = moduleScope.set.get('Service');
const innerClassVar = classScope.set.get('Service');
assert.ok(outerClassVar, 'Service should be bound in module scope');
assert.ok(innerClassVar, 'Service should be bound in class scope');
assert.strictEqual(outerClassVar.defs[0].type, 'ClassName');
// 3. MethodDefinition FunctionExpression creates function scope with arguments and parameter definitions
assert.strictEqual(methodScope.type, 'function');
assert.strictEqual(methodScope.block, methodFunc);
assert.ok(methodScope.set.has('arguments'), 'method scope should define arguments');
const itemVar = methodScope.set.get('item');
assert.ok(itemVar, 'item parameter should be defined in method scope');
assert.strictEqual(itemVar.defs[0].type, 'Parameter');
// 4. ArrowFunctionExpression creates function scope without arguments binding
assert.strictEqual(arrowScope.type, 'function');
assert.strictEqual(arrowScope.block, arrowFunc);
assert.strictEqual(arrowScope.set.has('arguments'), false, 'arrow function scope should not define arguments');
const deltaVar = arrowScope.set.get('delta');
assert.ok(deltaVar, 'delta parameter should be defined in arrow function scope');
// 5. ArrowFunctionExpression resolves lexical references to outer method parameters
assert.strictEqual(itemVar.references.length, 1);
const itemRef = itemVar.references[0];
assert.strictEqual(itemRef.from, arrowScope);
assert.strictEqual(itemRef.resolved, itemVar);
assert.strictEqual(itemRef.isRead(), true);
오리진 시더
익명