{"_id":"@crescware/eslint-plugin-crescware-const-no-upper-snake-case","name":"@crescware/eslint-plugin-crescware-const-no-upper-snake-case","dist-tags":{"latest":"0.0.3"},"versions":{"0.0.3":{"name":"@crescware/eslint-plugin-crescware-const-no-upper-snake-case","version":"0.0.3","type":"module","main":"dist/index.js","exports":{".":"./dist/index.js"},"publishConfig":{"access":"public"},"scripts":{"build":"rimraf dist && tsgo -p tsconfig.build.json","check":"pnpm run check:types && pnpm run check:lint && pnpm run check:knip && pnpm run test","check:knip":"knip","check:lint":"oxlint && oxfmt --check","check:types":"tsgo -p tsconfig.json --noEmit","exec:fixtures":"oxlint -c fixtures/oxlintrc.fixtures.json --no-ignore -f json fixtures/","format":"oxlint --fix && oxfmt","prepublishOnly":"pnpm run build","test":"vitest run"},"devDependencies":{"@types/node":"24.12.2","@typescript/native-preview":"7.0.0-dev.20260422.1","knip":"6.7.0","oxfmt":"0.47.0","oxlint":"1.62.0","rimraf":"6.1.3","vitest":"4.1.5"},"packageManager":"pnpm@10.33.2","gitHead":"17f5bf73d584f3cf149e3152c76e53a3837013bd","types":"./dist/index.d.ts","_id":"@crescware/eslint-plugin-crescware-const-no-upper-snake-case@0.0.3","description":"ESLint plugin that forbids `const` declaration bindings named in SCREAMING_SNAKE_CASE. lowerCamelCase is preferred and PascalCase is allowed for components and classes. It ships as a standard ESLint plugin and is dogfooded on its own source through [oxlin","_nodeVersion":"24.15.0","_npmVersion":"11.12.1","dist":{"integrity":"sha512-aYQL9r1b1YTssqKzLqnjTb/Zp+wVEhgqhi8J3rqnW1ueDt2cOk7rrm8NNP95UVVRZ08pWvAFNcPwtpbVyBqxQQ==","shasum":"be9e9085557d012dae01f1af59c40045b100234d","tarball":"https://registry.npmjs.org/@crescware/eslint-plugin-crescware-const-no-upper-snake-case/-/eslint-plugin-crescware-const-no-upper-snake-case-0.0.3.tgz","fileCount":4,"unpackedSize":8895,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQCd0YdRdDQ+pYRp/8Tb8JLN+yVBuNIQn73KAmngScS+WQIhAJ7mdqHTX8wfZylJJDcrbZuEfE2h6VjZMwCuUjL6ErlT"}]},"_npmUser":{"name":"crescware","email":"okunokentaro+npm@crescware.com"},"directories":{},"maintainers":[{"name":"crescware","email":"okunokentaro+npm@crescware.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eslint-plugin-crescware-const-no-upper-snake-case_0.0.3_1780629950642_0.6523314052724134"},"_hasShrinkwrap":false}},"time":{"created":"2026-06-05T03:25:50.482Z","0.0.3":"2026-06-05T03:25:50.779Z","modified":"2026-06-05T03:25:51.055Z"},"maintainers":[{"name":"crescware","email":"okunokentaro+npm@crescware.com"}],"description":"ESLint plugin that forbids `const` declaration bindings named in SCREAMING_SNAKE_CASE. lowerCamelCase is preferred and PascalCase is allowed for components and classes. It ships as a standard ESLint plugin and is dogfooded on its own source through [oxlin","readme":"# @crescware/eslint-plugin-crescware-const-no-upper-snake-case\n\nESLint plugin that forbids `const` declaration bindings named in\nSCREAMING_SNAKE_CASE. lowerCamelCase is preferred and PascalCase is allowed for\ncomponents and classes. It ships as a standard ESLint plugin and is dogfooded on\nits own source through [oxlint](https://oxc.rs/docs/guide/usage/linter)'s JS\nplugin support.\n\n## Rule: `crescware-const-no-upper-snake-case/const-no-upper-snake-case`\n\nOnly SCREAMING_SNAKE_CASE binding names are rejected. A name is rejected when\nevery character is an uppercase letter, a digit or an underscore and the first\ncharacter is an uppercase letter — that is, it contains no lowercase letter at\nall:\n\n- Rejected: `NAME_MAX_LENGTH`, `ERROR_KEY`, `ANSWER`, `URL`, and a single\n  uppercase letter such as `X`.\n- Allowed: lowerCamelCase (`fooBar`, `getUrl`) and PascalCase (`Foo`,\n  `BazComponent`, `QuxContext`) for components and classes.\n- A leading underscore (`_keys`, `_`) is allowed: the first character is not an\n  uppercase letter.\n- Any name containing at least one lowercase letter is allowed, because the\n  rejection pattern admits no lowercase character.\n\n### What is checked\n\nEvery binding introduced by a `const` declaration, including:\n\n- simple bindings (`const fooBar = 1`)\n- object / array destructuring (`const { a } = o`, `const [b] = arr`)\n- renamed destructuring — the local binding, not the source key\n  (`const { id: userId } = o` checks `userId`)\n- nested patterns, default values and rest elements\n- `for (const … of …)` / `for (const … in …)` loop variables\n\n### What is not checked\n\n`let` / `var`, function parameters, object property keys, type names, type\nparameters and import bindings are out of scope.\n\n```ts\nconst fooBar = 1; // ok (lowerCamelCase)\nconst Foo = 1; // ok (PascalCase, e.g. a component or class)\nconst ANSWER = 1; // error: must not be SCREAMING_SNAKE_CASE\nconst { ERROR_KEY } = resp; // error on `ERROR_KEY`\nlet LOOSE_NAME = 1; // ok (not a const)\n```\n\n## Usage (as a published ESLint plugin)\n\n```sh\npnpm add -D @crescware/eslint-plugin-crescware-const-no-upper-snake-case\n```\n\n```js\nimport constNoUpperSnakeCase from \"@crescware/eslint-plugin-crescware-const-no-upper-snake-case\";\n\nexport default [\n  {\n    plugins: {\n      \"crescware-const-no-upper-snake-case\": constNoUpperSnakeCase,\n    },\n    rules: {\n      \"crescware-const-no-upper-snake-case/const-no-upper-snake-case\": \"error\",\n    },\n  },\n];\n```\n\n## Stack\n\n- **Runtime**: Node.js 24 (via [mise](https://mise.jdx.dev/))\n- **Package manager**: pnpm (via corepack)\n- **Language**: TypeScript ([native preview](https://github.com/nicolo-ribaudo/tc39-proposal-type-annotations))\n- **Test**: [Vitest](https://vitest.dev/)\n- **Lint**: [oxlint](https://oxc.rs/docs/guide/usage/linter)\n- **Format**: [oxfmt](https://github.com/nicolo-ribaudo/oxfmt)\n- **Unused code**: [Knip](https://knip.dev/)\n\n## How it is built and verified\n\n- `src/index.ts` is the plugin: a self-contained ESLint rule with no runtime\n  dependencies. `pnpm build` compiles it to `dist/` (with `.d.ts`) via\n  `tsconfig.build.json`.\n- `.oxlintrc.json` loads the plugin through `jsPlugins: [\"./src/index.ts\"]` and\n  enables the rule on this repository's own source, so the plugin lints itself\n  (no `const` in `src/` is SCREAMING_SNAKE_CASE).\n- `fixtures/*.ts` are lint fixtures: `ng-*.ts` must produce diagnostics and\n  `ok-*.ts` must produce none. They are linted with the separate\n  `fixtures/oxlintrc.fixtures.json` (all built-in categories off, only this\n  rule on) and are excluded from the main lint via `ignorePatterns`.\n- `fixtures/integration.test.ts` runs oxlint over the fixtures once and asserts\n  the exact per-file diagnostic messages.\n\n## Setup\n\n```sh\nmise install\ncorepack enable\npnpm install\n```\n\n## Scripts\n\n| Command              | Description                                    |\n| -------------------- | ---------------------------------------------- |\n| `pnpm build`         | Compile `src/index.ts` to `dist/` with `.d.ts` |\n| `pnpm check`         | Run all checks (types, lint, knip, test)       |\n| `pnpm check:types`   | Type check                                     |\n| `pnpm check:lint`    | Lint (incl. self-dogfooding) and format check  |\n| `pnpm check:knip`    | Unused files/exports check                     |\n| `pnpm exec:fixtures` | Print raw fixture diagnostics as JSON          |\n| `pnpm test`          | Run the fixture integration test               |\n| `pnpm format`        | Fix lint and format                            |\n","readmeFilename":"README.md","_rev":"1-78de79a98a85f8ace2857377ceaf649c"}