샘플
@typescript-eslint/tsconfig-utils 8.69.0
검증된 샘플 — npm @typescript-eslint/tsconfig-utils 8.69.0. node 22 · linux debian/x64 · docker에서 contract를 실행해 통과했습니다: CORE_COMPILER_OPTIONS defines required…
sha256:006226f3b7c404f9746dec42b351d0527a6ca2c45ab6c0d11e35e6ec2465b8b7
이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다.
통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다.
MIT-0
실행 증거
선언된 환경과 서명된 실행을 분리해 두었습니다. 이 샘플이 무엇을 어디서 실행했는지 그대로 볼 수 있습니다.
- 증거 기준
- 서명된 컨트랙트 통과
- 검증 영수증
- 1
- 빌드한 서명 키
- 1
선언된 환경
linux 24 · ubuntu · glibc 2.39 x64 npm
검증 실행 환경
| 환경 | 컨트랙트 | 단계 | 실행일 |
|---|---|---|---|
| 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-19 |
케이스
HOW- 목표
- verify pkg:npm/%40typescript-eslint/tsconfig-utils@8.69.0
- 생성일
- 2026-09-17T21:49:52Z
컨트랙트
- CORE_COMPILER_OPTIONS defines required compiler options including noEmit noUnusedLocals and noUnusedParameters
- getParsedConfigFile parses tsconfig.json and enforces CORE_COMPILER_OPTIONS in parsed compiler options
- getParsedConfigFile resolves source file paths according to tsconfig files and include configurations
- getParsedConfigFile throws diagnostic error when tsconfig file contains invalid syntax or cannot be read
- getParsedConfigFile throws error when invoked in a non-Node environment without tsserver sys
파일
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- 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 pkg:npm/%40typescript-eslint/tsconfig-utils@8.69.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/%40typescript-eslint/tsconfig-utils@8.69.0
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:ff920c1934531b4e5c77916bbf54702a03553242663c4c39fef508204408718a","contract":["CORE_COMPILER_OPTIONS defines required compiler options including noEmit noUnusedLocals and noUnusedParameters","getParsedConfigFile parses tsconfig.json and enforces CORE_COMPILER_OPTIONS in parsed compiler options","getParsedConfigFile resolves source file paths according to tsconfig files and include configurations","getParsedConfigFile throws diagnostic error when tsconfig file contains invalid syntax or cannot be read","getParsedConfigFile throws error when invoked in a non-Node environment without tsserver sys"],"goal":"verify pkg:npm/%40typescript-eslint/tsconfig-utils@8.69.0","kind":"HOW","packages":["pkg:npm/%40typescript-eslint/tsconfig-utils@8.69.0"],"schemaVersion":1},"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/%40typescript-eslint/tsconfig-utils@8.69.0"],"schemaVersion":1,"subject":"pkg:npm/%40typescript-eslint/tsconfig-utils@8.69.0","verifierAdapter":"node-typescript@1"}
{
"name": "sample-tsconfig-utils",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-tsconfig-utils",
"version": "1.0.0",
"license": "MIT-0",
"dependencies": {
"@typescript-eslint/tsconfig-utils": "8.69.0",
"typescript": "5.7.3"
}
},
"node_modules/@typescript-eslint/tsconfig-utils": {
"version": "8.69.0",
"resolved": "https://registry.npmjs.org/@typescript-eslint/tsconfig-utils/-/tsconfig-utils-8.69.0.tgz",
"integrity": "sha512-xNqK7YTDZsLniQMV/4rpFR8Z5JlqeRvVjuG1YgF/mdPVH84HSD19L8CczMA0qg2RfwEV231GHH3VnToJDo4MfQ==",
"license": "MIT",
"engines": {
"node": "^18.18.0 || ^20.9.0 || >=21.1.0"
},
"funding": {
"type": "opencollective",
"url": "https://opencollective.com/typescript-eslint"
},
"peerDependencies": {
"typescript": ">=4.8.4 <6.1.0"
}
},
"node_modules/typescript": {
"version": "5.7.3",
"resolved": "https://registry.npmjs.org/typescript/-/typescript-5.7.3.tgz",
"integrity": "sha512-84MVSjMEHP+FQRPy3pX9sTVV/INIex71s9TL2Gm5FG/WG1SqXeKyZ0k7/blY/4FdOzI12CBy1vGc4og/eus0fw==",
"license": "Apache-2.0",
"bin": {
"tsc": "bin/tsc",
"tsserver": "bin/tsserver"
},
"engines": {
"node": ">=14.17"
}
}
}
}
{
"name": "sample-tsconfig-utils",
"version": "1.0.0",
"private": true,
"description": "Clean-room code sample for @typescript-eslint/tsconfig-utils",
"main": "src/index.js",
"license": "MIT-0",
"dependencies": {
"@typescript-eslint/tsconfig-utils": "8.69.0",
"typescript": "5.7.3"
}
}
{
"schemaVersion": 1,
"goal": "verify pkg:npm/%40typescript-eslint/tsconfig-utils@8.69.0",
"kind": "HOW",
"packages": [
"pkg:npm/%40typescript-eslint/tsconfig-utils@8.69.0"
]
}
const ts = require('typescript');
const {
CORE_COMPILER_OPTIONS,
getParsedConfigFile
} = require('@typescript-eslint/tsconfig-utils');
/**
* Returns the default core compiler options enforced by tsconfig-utils.
*
* @returns {object} The core compiler options.
*/
function getCoreCompilerOptions() {
return CORE_COMPILER_OPTIONS;
}
/**
* Parses a tsconfig file using TypeScript and tsconfig-utils logic.
*
* @param {string} configPath - Path to tsconfig.json relative to projectRoot.
* @param {string} [projectRoot] - Path to project root (defaults to process.cwd()).
* @returns {object} The parsed command line configuration.
*/
function loadParsedConfig(configPath, projectRoot) {
return getParsedConfigFile(ts, configPath, projectRoot);
}
module.exports = {
CORE_COMPILER_OPTIONS,
getParsedConfigFile,
getCoreCompilerOptions,
loadParsedConfig
};
import assert from 'node:assert/strict';
import fs from 'node:fs';
import os from 'node:os';
import path from 'node:path';
import { createRequire } from 'node:module';
const require = createRequire(import.meta.url);
const {
CORE_COMPILER_OPTIONS,
getParsedConfigFile,
getCoreCompilerOptions,
loadParsedConfig
} = require('../src/index.js');
const ts = require('typescript');
async function runTests() {
// 1. CORE_COMPILER_OPTIONS defines required compiler options including noEmit noUnusedLocals and noUnusedParameters
assert.equal(typeof CORE_COMPILER_OPTIONS, 'object', 'CORE_COMPILER_OPTIONS must be an object');
assert.equal(CORE_COMPILER_OPTIONS.noEmit, true, 'noEmit must be true');
assert.equal(CORE_COMPILER_OPTIONS.noUnusedLocals, true, 'noUnusedLocals must be true');
assert.equal(CORE_COMPILER_OPTIONS.noUnusedParameters, true, 'noUnusedParameters must be true');
assert.deepEqual(getCoreCompilerOptions(), CORE_COMPILER_OPTIONS, 'getCoreCompilerOptions helper matches constant');
const tmpDir = fs.mkdtempSync(path.join(os.tmpdir(), 'csx-tsconfig-test-'));
try {
const srcDir = path.join(tmpDir, 'src');
fs.mkdirSync(srcDir, { recursive: true });
const dummySource = path.join(srcDir, 'index.ts');
fs.writeFileSync(dummySource, 'export const greeting = "hello";');
// 2. getParsedConfigFile parses tsconfig.json and enforces CORE_COMPILER_OPTIONS in parsed compiler options
const tsconfigPath = path.join(tmpDir, 'tsconfig.json');
fs.writeFileSync(
tsconfigPath,
JSON.stringify({
compilerOptions: {
target: 'ES2022',
module: 'commonjs',
strict: true,
noEmit: false,
noUnusedLocals: false
},
files: ['src/index.ts']
}, null, 2)
);
const parsed = loadParsedConfig('tsconfig.json', tmpDir);
assert.ok(parsed, 'Parsed config must not be null');
assert.equal(parsed.options.noEmit, true, 'noEmit must be overridden to true');
assert.equal(parsed.options.noUnusedLocals, true, 'noUnusedLocals must be overridden to true');
assert.equal(parsed.options.noUnusedParameters, true, 'noUnusedParameters must be set to true');
assert.equal(parsed.options.strict, true, 'strict option must be preserved');
// 3. getParsedConfigFile resolves source file paths according to tsconfig files and include configurations
assert.ok(Array.isArray(parsed.fileNames), 'fileNames must be an array');
assert.equal(parsed.fileNames.length, 1, 'fileNames should contain one matched file');
assert.equal(
path.resolve(parsed.fileNames[0]),
path.resolve(dummySource),
'fileNames must resolve to the source file path'
);
// 4. getParsedConfigFile throws diagnostic error when tsconfig file contains invalid syntax or cannot be read
const badConfigPath = path.join(tmpDir, 'bad-tsconfig.json');
fs.writeFileSync(badConfigPath, '{ compilerOptions: { target: ');
assert.throws(
() => {
getParsedConfigFile(ts, 'bad-tsconfig.json', tmpDir);
},
/Unable to parse the specified 'tsconfig' file/,
'Must throw diagnostic error on invalid tsconfig JSON syntax'
);
assert.throws(
() => {
getParsedConfigFile(ts, 'nonexistent-tsconfig.json', tmpDir);
},
/Cannot read file/,
'Must throw error on missing tsconfig file'
);
// 5. getParsedConfigFile throws error when invoked in a non-Node environment without tsserver sys
assert.throws(
() => {
getParsedConfigFile({}, 'tsconfig.json', tmpDir);
},
/only supported in a Node-like environment/,
'Must throw when tsserver.sys is undefined'
);
console.log('All contract assertions for @typescript-eslint/tsconfig-utils passed successfully.');
} finally {
fs.rmSync(tmpDir, { recursive: true, force: true });
}
}
runTests().catch((err) => {
console.error('Contract test failed:', err);
process.exit(1);
});
오리진 시더
익명