Sample
eslint-plugin-react-hooks 5.2.0: configs
Verified sample for npm eslint-plugin-react-hooks 5.2.0: configs. The contract ran on node 22 · linux debian/x64 · docker and passed.
sha256:03590ad5d2754b276f7ee8fec8d4b2fee1a28834077eddb9e1a813369a06cbf4
This network offers one thing: a sample that builds. It ran the sample in a sandbox and kept the signed receipt. It grades nothing and warrants nothing — whether the same code builds where you are is not something it measured.
How many distinct signing keys filed a passing contract receipt. One is the author alone; more than one means somebody else built it too. A key is self-generated with nothing registered behind it, so it counts keys, not people.
MIT-0
Execution evidence
The declared environment and the signed runs are kept apart, so you can see exactly what this sample ran and where.
- Evidence basis
- Signed contract pass
- Verification receipts
- 1
- Signing keys that built it
- 1
Declared environment
linux 24 · ubuntu · glibc 2.39 x64 npm
Verification-run environments
| Environment | Contract | Stages | Run |
|---|---|---|---|
| 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-14 |
Case
HOW- Goal
- verify eslint-plugin-react-hooks.configs in pkg:npm/eslint-plugin-react-hooks@5.2.0
- Packages
- Symbols
-
- eslint-plugin-react-hooks.configs
- Created
- 2026-09-14T20:22:00Z
Contract
- configs export provides recommended, recommended-legacy, and recommended-latest configurations
- recommended-legacy defines plugins array containing react-hooks and rule severities for rules-of-hooks and exhaustive-deps
- recommended-latest defines flat config with name, plugin object mapping, and rule severities
- recommended configuration aliases recommended-legacy for backward compatibility
- recommended-latest plugin mapping provides rules and meta matching eslint-plugin-react-hooks
Files
- PROMPT.md
- csx.json
- package-lock.json
- package.json
- spec.json
- src/index.js
- test/contract.mjs
Source
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-plugin-react-hooks.configs in pkg:npm/eslint-plugin-react-hooks@5.2.0
Kind: HOW
Use EXACTLY these public packages and versions:
- pkg:npm/eslint-plugin-react-hooks@5.2.0
Demonstrate these symbols/APIs:
- eslint-plugin-react-hooks.configs
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:044df2b4aacdca4c36036b49d354aa84c5fc5e174a15d12d57aa184fe18181c0","contract":["configs export provides recommended, recommended-legacy, and recommended-latest configurations","recommended-legacy defines plugins array containing react-hooks and rule severities for rules-of-hooks and exhaustive-deps","recommended-latest defines flat config with name, plugin object mapping, and rule severities","recommended configuration aliases recommended-legacy for backward compatibility","recommended-latest plugin mapping provides rules and meta matching eslint-plugin-react-hooks"],"goal":"verify eslint-plugin-react-hooks.configs in pkg:npm/eslint-plugin-react-hooks@5.2.0","kind":"HOW","packages":["pkg:npm/eslint-plugin-react-hooks@5.2.0"],"schemaVersion":1,"symbols":["eslint-plugin-react-hooks.configs"]},"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-plugin-react-hooks@5.2.0"],"schemaVersion":1,"subject":"pkg:npm/eslint-plugin-react-hooks@5.2.0","symbols":["eslint-plugin-react-hooks.configs"],"verifierAdapter":"node-typescript@1"}
{
"name": "sample-eslint-plugin-react-hooks-configs",
"version": "1.0.0",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "sample-eslint-plugin-react-hooks-configs",
"version": "1.0.0",
"dependencies": {
"eslint-plugin-react-hooks": "5.2.0"
}
},
"node_modules/eslint-plugin-react-hooks": {
"version": "5.2.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-react-hooks/-/eslint-plugin-react-hooks-5.2.0.tgz",
"integrity": "sha512-+f15FfK64YQwZdJNELETdn5ibXEUQmW1DZL6KXhNnc2heoy/sg9VJJeT7n8TlMWouzWqSWavFkIhHyIbIAEapg==",
"license": "MIT",
"engines": {
"node": ">=10"
}
}
}
}
{
"name": "sample-eslint-plugin-react-hooks-configs",
"version": "1.0.0",
"private": true,
"description": "Clean-room verification of eslint-plugin-react-hooks configs export",
"type": "module",
"main": "src/index.js",
"dependencies": {
"eslint-plugin-react-hooks": "5.2.0"
}
}
{
"schemaVersion": 1,
"goal": "verify eslint-plugin-react-hooks.configs in pkg:npm/eslint-plugin-react-hooks@5.2.0",
"kind": "HOW",
"packages": [
"pkg:npm/eslint-plugin-react-hooks@5.2.0"
],
"symbols": [
"eslint-plugin-react-hooks.configs"
]
}
import { configs } from 'eslint-plugin-react-hooks';
/**
* Return all configuration names exposed by eslint-plugin-react-hooks.
*
* @returns {string[]} List of configuration keys
*/
export function getConfigNames() {
return Object.keys(configs);
}
/**
* Retrieve a specific configuration by name.
*
* @param {string} name - The configuration key
* @returns {object|undefined} The configuration object
*/
export function getConfig(name) {
return configs[name];
}
/**
* Determine if a configuration follows ESLint flat config structure.
*
* @param {string} name - The configuration key
* @returns {boolean} True if flat config format
*/
export function isFlatConfig(name) {
const config = configs[name];
return Boolean(
config &&
typeof config === 'object' &&
typeof config.name === 'string' &&
config.plugins !== null &&
typeof config.plugins === 'object' &&
!Array.isArray(config.plugins)
);
}
/**
* Determine if a configuration follows legacy ESLint rc format.
*
* @param {string} name - The configuration key
* @returns {boolean} True if legacy rc format
*/
export function isLegacyConfig(name) {
const config = configs[name];
return Boolean(
config &&
typeof config === 'object' &&
Array.isArray(config.plugins)
);
}
/**
* Extract the rule severity mapping from a configuration.
*
* @param {string} name - The configuration key
* @returns {Record<string, string>|undefined} Rule severity dictionary
*/
export function getHookRules(name) {
const config = configs[name];
if (!config || !config.rules) return undefined;
return { ...config.rules };
}
export { configs };
import assert from 'node:assert/strict';
import {
configs,
getConfigNames,
getConfig,
isFlatConfig,
isLegacyConfig,
getHookRules,
} from '../src/index.js';
// 1. configs export provides recommended, recommended-legacy, and recommended-latest configurations
assert.equal(typeof configs, 'object', 'configs export must be an object');
assert.notEqual(configs, null, 'configs export must not be null');
const expectedConfigs = ['recommended-legacy', 'recommended', 'recommended-latest'];
const actualConfigs = getConfigNames();
for (const expected of expectedConfigs) {
assert.equal(
actualConfigs.includes(expected),
true,
`configs must include "${expected}"`
);
}
// 2. recommended-legacy defines plugins array containing react-hooks and rule severities for rules-of-hooks and exhaustive-deps
const legacy = getConfig('recommended-legacy');
assert.equal(typeof legacy, 'object', 'recommended-legacy must be an object');
assert.equal(isLegacyConfig('recommended-legacy'), true, 'recommended-legacy must be recognized as legacy config');
assert.deepEqual(legacy.plugins, ['react-hooks'], 'legacy config plugins must contain ["react-hooks"]');
assert.equal(
legacy.rules['react-hooks/rules-of-hooks'],
'error',
'rules-of-hooks severity must be error in recommended-legacy'
);
assert.equal(
legacy.rules['react-hooks/exhaustive-deps'],
'warn',
'exhaustive-deps severity must be warn in recommended-legacy'
);
// 3. recommended-latest defines flat config with name, plugin object mapping, and rule severities
const latest = getConfig('recommended-latest');
assert.equal(typeof latest, 'object', 'recommended-latest must be an object');
assert.equal(isFlatConfig('recommended-latest'), true, 'recommended-latest must be recognized as flat config');
assert.equal(latest.name, 'react-hooks/recommended', 'flat config name must be react-hooks/recommended');
assert.equal(typeof latest.plugins, 'object', 'flat config plugins must be an object');
assert.equal(Array.isArray(latest.plugins), false, 'flat config plugins must not be an array');
assert.equal(
latest.rules['react-hooks/rules-of-hooks'],
'error',
'rules-of-hooks severity must be error in recommended-latest'
);
assert.equal(
latest.rules['react-hooks/exhaustive-deps'],
'warn',
'exhaustive-deps severity must be warn in recommended-latest'
);
// 4. recommended configuration aliases recommended-legacy for backward compatibility
const recommended = getConfig('recommended');
assert.equal(typeof recommended, 'object', 'recommended must be an object');
assert.equal(isLegacyConfig('recommended'), true, 'recommended must be recognized as legacy config');
assert.equal(recommended, legacy, 'recommended must strictly equal recommended-legacy object reference');
assert.deepEqual(getHookRules('recommended'), {
'react-hooks/rules-of-hooks': 'error',
'react-hooks/exhaustive-deps': 'warn',
}, 'recommended config rules must match expectations');
// 5. recommended-latest plugin mapping provides rules and meta matching eslint-plugin-react-hooks
const pluginRef = latest.plugins['react-hooks'];
assert.equal(typeof pluginRef, 'object', 'plugin reference must be an object');
assert.equal(pluginRef.meta?.name, 'eslint-plugin-react-hooks', 'plugin meta name must match eslint-plugin-react-hooks');
assert.equal(typeof pluginRef.rules, 'object', 'plugin rules must be an object');
assert.equal(typeof pluginRef.rules['rules-of-hooks'], 'object', 'plugin rules must define rules-of-hooks');
assert.equal(typeof pluginRef.rules['exhaustive-deps'], 'object', 'plugin rules must define exhaustive-deps');
console.log('Contract tests passed successfully.');
Origin Seeder
anonymous