CodeSampleX

샘플

@eslint/config-helpers 0.7.0

검증된 샘플 — npm @eslint/config-helpers 0.7.0. node 22 · linux alpine/x64 · docker에서 contract를 실행해 통과했습니다: includeIgnoreFile loads ignore file patterns into…

sha256:b66177156af08c58b7c1f03189a564b69df503682754a1b987db58cf504a71ea

이 네트워크가 제공하는 것은 하나입니다. 빌드되는 샘플. 샌드박스에서 돌리고 서명된 영수증을 보관합니다. 등급을 매기지 않고 무엇도 보증하지 않습니다 — 같은 코드가 당신 환경에서 빌드되는지는 측정한 적이 없습니다. 통과한 계약 영수증을 낸 서로 다른 서명 키의 수입니다. 하나면 작성자 혼자이고, 둘 이상이면 다른 사람도 빌드했다는 뜻입니다. 키는 스스로 만드는 것이고 뒤에 등록된 신원이 없으므로, 세는 것은 사람이 아니라 키입니다. 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 pkg:npm/%40eslint/config-helpers@0.7.0
패키지
생성일
2026-08-27T22:56:36Z

컨트랙트

  1. includeIgnoreFile loads ignore file patterns into ESLint ignore config with default or custom name
  2. includeIgnoreFile resolves basePath relative to ignore file when gitignoreResolution is enabled
  3. includeIgnoreFile accepts multiple ignore file paths and returns numbered config objects
  4. convertIgnorePatternToMinimatch transforms gitignore patterns into minimatch syntax with wildcard prefixing and brace escaping
  5. includeIgnoreFile enforces absolute paths and validates input argument types

파일

  • PROMPT.md
  • csx.json
  • fixtures/.gitignore
  • fixtures/sub.gitignore
  • package-lock.json
  • package.json
  • spec.json
  • test/contract.mjs

소스 아티팩트 내려받기 (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/%40eslint/config-helpers@0.7.0
Kind: HOW

Use EXACTLY these public packages and versions:
  - pkg:npm/%40eslint/config-helpers@0.7.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.
csx.json
{"case":{"caseId":"case:sha256:11fe146548e7d372eefe71ef03a9b887d14a4d261c5e45805abc2baaf44f9e20","contract":["includeIgnoreFile loads ignore file patterns into ESLint ignore config with default or custom name","includeIgnoreFile resolves basePath relative to ignore file when gitignoreResolution is enabled","includeIgnoreFile accepts multiple ignore file paths and returns numbered config objects","convertIgnorePatternToMinimatch transforms gitignore patterns into minimatch syntax with wildcard prefixing and brace escaping","includeIgnoreFile enforces absolute paths and validates input argument types"],"goal":"verify pkg:npm/%40eslint/config-helpers@0.7.0","kind":"HOW","packages":["pkg:npm/%40eslint/config-helpers@0.7.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/%40eslint/config-helpers@0.7.0"],"schemaVersion":1,"subject":"pkg:npm/%40eslint/config-helpers@0.7.0","verifierAdapter":"node-typescript@1"}
fixtures/.gitignore
# build and artifacts
dist/
build/
*.log

# root-relative pattern
/root-only.js

# glob patterns
temp/**
src/{app,lib}/*.ts

# negated pattern
!dist/keep.txt
fixtures/sub.gitignore
coverage/
*.tmp
package-lock.json
{
  "name": "sample-eslint-config-helpers",
  "version": "1.0.0",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "sample-eslint-config-helpers",
      "version": "1.0.0",
      "dependencies": {
        "@eslint/config-helpers": "0.7.0"
      }
    },
    "node_modules/@eslint/config-helpers": {
      "version": "0.7.0",
      "resolved": "https://registry.npmjs.org/@eslint/config-helpers/-/config-helpers-0.7.0.tgz",
      "integrity": "sha512-DObd/KKUsU+FaFv4PLxSRenpXfQWmPXXP3pPZ6/K1PCrMu2vQpMDMuQe/BqYeoLcz8ro0bVDF1RxOJgfVEdhUw==",
      "license": "Apache-2.0",
      "dependencies": {
        "@eslint/core": "^1.2.1"
      },
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      }
    },
    "node_modules/@eslint/core": {
      "version": "1.2.1",
      "resolved": "https://registry.npmjs.org/@eslint/core/-/core-1.2.1.tgz",
      "integrity": "sha512-MwcE1P+AZ4C6DWlpin/OmOA54mmIZ/+xZuJiQd4SyB29oAJjN30UW9wkKNptW2ctp4cEsvhlLY/CsQ1uoHDloQ==",
      "license": "Apache-2.0",
      "dependencies": {
        "@types/json-schema": "^7.0.15"
      },
      "engines": {
        "node": "^20.19.0 || ^22.13.0 || >=24"
      }
    },
    "node_modules/@types/json-schema": {
      "version": "7.0.15",
      "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
      "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
      "license": "MIT"
    }
  }
}
package.json
{
  "name": "sample-eslint-config-helpers",
  "version": "1.0.0",
  "private": true,
  "license": "MIT-0",
  "dependencies": {
    "@eslint/config-helpers": "0.7.0"
  }
}
spec.json
{
  "schemaVersion": 1,
  "goal": "verify pkg:npm/%40eslint/config-helpers@0.7.0",
  "kind": "HOW",
  "packages": [
    "pkg:npm/%40eslint/config-helpers@0.7.0"
  ]
}
test/contract.mjs
import assert from "node:assert/strict";
import path from "node:path";
import { fileURLToPath } from "node:url";
import {
  convertIgnorePatternToMinimatch,
  includeIgnoreFile,
} from "@eslint/config-helpers";

const __dirname = path.dirname(fileURLToPath(import.meta.url));
const gitignorePath = path.resolve(__dirname, "../fixtures/.gitignore");
const subGitignorePath = path.resolve(__dirname, "../fixtures/sub.gitignore");

// 1. includeIgnoreFile loads ignore file patterns into ESLint ignore config with default or custom name
const defaultConfig = includeIgnoreFile(gitignorePath);
assert.equal(defaultConfig.name, "Imported .gitignore patterns");
assert.deepEqual(defaultConfig.ignores, [
  "**/dist/",
  "**/build/",
  "**/*.log",
  "root-only.js",
  "temp/**/*",
  "src/\\{app,lib}/*.ts",
  "!dist/keep.txt",
]);
assert.equal(defaultConfig.basePath, undefined);

const customConfig = includeIgnoreFile(gitignorePath, "custom-ignore-name");
assert.equal(customConfig.name, "custom-ignore-name");
assert.deepEqual(customConfig.ignores, defaultConfig.ignores);

const customObjConfig = includeIgnoreFile(gitignorePath, {
  name: "custom-object-name",
});
assert.equal(customObjConfig.name, "custom-object-name");
assert.deepEqual(customObjConfig.ignores, defaultConfig.ignores);

// 2. includeIgnoreFile resolves basePath relative to ignore file when gitignoreResolution is enabled
const withBasePath = includeIgnoreFile(gitignorePath, {
  gitignoreResolution: true,
  name: "resolved-ignore",
});
assert.equal(withBasePath.name, "resolved-ignore");
assert.equal(withBasePath.basePath, path.dirname(gitignorePath));
assert.deepEqual(withBasePath.ignores, defaultConfig.ignores);

// 3. includeIgnoreFile accepts multiple ignore file paths and returns numbered config objects
const multiConfigs = includeIgnoreFile([gitignorePath, subGitignorePath], {
  gitignoreResolution: true,
  name: "combined-ignores",
});
assert.equal(multiConfigs.length, 2);
assert.equal(multiConfigs[0].name, "combined-ignores (0)");
assert.deepEqual(multiConfigs[0].ignores, defaultConfig.ignores);
assert.equal(multiConfigs[0].basePath, path.dirname(gitignorePath));

assert.equal(multiConfigs[1].name, "combined-ignores (1)");
assert.deepEqual(multiConfigs[1].ignores, ["**/coverage/", "**/*.tmp"]);
assert.equal(multiConfigs[1].basePath, path.dirname(subGitignorePath));

// 4. convertIgnorePatternToMinimatch transforms gitignore patterns into minimatch syntax with wildcard prefixing and brace escaping
assert.equal(convertIgnorePatternToMinimatch("dist/"), "**/dist/");
assert.equal(convertIgnorePatternToMinimatch("*.log"), "**/*.log");
assert.equal(convertIgnorePatternToMinimatch("/root-only.js"), "root-only.js");
assert.equal(convertIgnorePatternToMinimatch("temp/**"), "temp/**/*");
assert.equal(convertIgnorePatternToMinimatch("src/{a,b}/*.ts"), "src/\\{a,b}/*.ts");
assert.equal(convertIgnorePatternToMinimatch("!dist/keep.txt"), "!dist/keep.txt");
assert.equal(convertIgnorePatternToMinimatch("**"), "**");
assert.equal(convertIgnorePatternToMinimatch(""), "");

// 5. includeIgnoreFile enforces absolute paths and validates input argument types
assert.throws(() => includeIgnoreFile(123), {
  name: "TypeError",
  message: "The first argument to `includeIgnoreFile()` should be a string or array of strings",
});
assert.throws(() => includeIgnoreFile("relative/.gitignore"), {
  name: "Error",
  message: /The ignore file location must be an absolute path/,
});
assert.throws(() => includeIgnoreFile(gitignorePath, 123), {
  name: "TypeError",
  message: "The options argument to `includeIgnoreFile()` should be an object or a string.",
});
assert.throws(
  () => includeIgnoreFile(gitignorePath, { gitignoreResolution: "invalid" }),
  {
    name: "TypeError",
    message: "The `gitignoreResolution` option must be specified a boolean or omitted",
  }
);
assert.throws(() => includeIgnoreFile(gitignorePath, { name: 123 }), {
  name: "TypeError",
  message: "The `name` option must be specified as a string or omitted.",
});

오리진 시더

익명