{"_id":"@actioneer/ads-lint","_rev":"3-c58ecba3bdc9ca540fcb9663d20e43c5","name":"@actioneer/ads-lint","dist-tags":{"latest":"0.2.0"},"versions":{"0.1.0":{"name":"@actioneer/ads-lint","version":"0.1.0","_id":"@actioneer/ads-lint@0.1.0","maintainers":[{"name":"axnr-sv","email":"sashank@actioneer.com"}],"bin":{"ads-lint":"bin/ads-lint.mjs"},"dist":{"shasum":"4dd6217e3c2fe0e170998b57ab30188957208685","tarball":"https://registry.npmjs.org/@actioneer/ads-lint/-/ads-lint-0.1.0.tgz","fileCount":9,"integrity":"sha512-EelGKle23rlGv9jwig5fEpxVro6xCF5blXX2SYQIuyVn4px12/kbHvuwbXmt68cUvpVw/9nWJD2m2g7lA6rDIQ==","signatures":[{"sig":"MEYCIQDVEexMQxKuJ63q4opAl2SDs2XKt2n6Im7sA1s1mowP0QIhAPZFBepb0Xl0zJuNb1tIqSoh1OUYZcvCUweuVjMlZ6YO","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28712},"type":"module","engines":{"node":">=18"},"exports":{".":"./src/index.mjs","./config":"./src/config.mjs"},"gitHead":"0dee7ba884f7750d33f9734c75b1f47ce989206c","scripts":{"test":"node --test"},"_npmUser":{"name":"axnr-sv","email":"sashank@actioneer.com"},"_npmVersion":"11.12.1","description":"Design linter for the Actioneer Design System (ADS 1.0). Flags deviations from ADS principles on changed files.","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"typescript":">=5"},"peerDependenciesMeta":{"typescript":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ads-lint_0.1.0_1784170180436_0.49388994714718204","host":"s3://npm-registry-packages-npm-production"}},"0.2.0":{"name":"@actioneer/ads-lint","version":"0.2.0","_id":"@actioneer/ads-lint@0.2.0","maintainers":[{"name":"axnr-sv","email":"sashank@actioneer.com"}],"bin":{"ads-lint":"bin/ads-lint.mjs"},"dist":{"shasum":"7f42333a96a689d45ebc4bf6d476e85e708eb5f6","tarball":"https://registry.npmjs.org/@actioneer/ads-lint/-/ads-lint-0.2.0.tgz","fileCount":9,"integrity":"sha512-7PUewllBsIhvfm2q3VL6tHQ/r141lNXywIhr8VSpXnFShNiTyT1M/mjODBF3eVyjrbfosMfXplN5DnLxjbVLXA==","signatures":[{"sig":"MEUCIFH4hSiLKq6mCJTnHN1nP6sPJ/8wkrOJ7ZeDgafLTJ0rAiEAibwo7tMnMSmQMNE53DMW1u3llJhIHAKD3XsnMcTw2SE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":28712},"type":"module","engines":{"node":">=18"},"exports":{".":"./src/index.mjs","./config":"./src/config.mjs"},"gitHead":"0dee7ba884f7750d33f9734c75b1f47ce989206c","scripts":{"test":"node --test"},"_npmUser":{"name":"axnr-sv","email":"sashank@actioneer.com"},"_npmVersion":"11.12.1","description":"Design linter for the Actioneer Design System (ADS 1.0). Flags deviations from ADS principles on changed files.","directories":{},"_nodeVersion":"24.15.0","publishConfig":{"access":"public"},"_hasShrinkwrap":false,"peerDependencies":{"typescript":">=5"},"peerDependenciesMeta":{"typescript":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/ads-lint_0.2.0_1784170742061_0.8336197217448285","host":"s3://npm-registry-packages-npm-production"}}},"time":{"created":"2026-07-16T02:49:40.282Z","modified":"2026-07-21T14:56:39.363Z","0.1.0":"2026-07-16T02:49:40.585Z","0.2.0":"2026-07-16T02:59:02.194Z"},"description":"Design linter for the Actioneer Design System (ADS 1.0). Flags deviations from ADS principles on changed files.","maintainers":[{"email":"sashank@actioneer.com","name":"axnr-sv"},{"email":"himanshu@actioneer.com","name":"zyhim"}],"readme":"# @actioneer/ads-lint\n\nA design linter for the **Actioneer Design System (ADS 1.0)**. It flags\ndeviations from ADS principles on changed files, so any repo that consumes ADS\nstays on-system without a human catching every stray hex or icon import in review.\n\nIt runs in two tiers: the **TypeScript compiler API** when `typescript` is\nresolvable (exact import analysis), degrading to a **regex parser** when it\nisn't — so it works in a fresh repo before `npm i`.\n\n## What it checks\n\n| Rule | Severity | Principle |\n|---|---|---|\n| `external-ui-import` — importing radix/mui/assistant-ui/etc. directly | error | P7 ADS-first |\n| `deep-import` — reaching past the barrel (`@actioneer/ads/button`) | error | P7 |\n| `barrel-default-import` / `-namespace-import` / `-aliased-import` | error | P7 |\n| `icon-package-import` — importing `@hugeicons`/`lucide` outside the registry | error | P4 icons |\n| `hardcoded-hex` — a raw `#rrggbb` in code | error | tokens-only |\n| `arbitrary-color` — `bg-[#fff]` / `text-[rgb(...)]` | error | tokens-only |\n| `arbitrary-dimension` — `w-[13px]` / `gap-[1.5rem]` | warn | tokens-only |\n| Motion: `unbounded-transition`, `sluggish-easing`, `zero-scale-entrance`, `undersized-zoom-entrance`, `hardcoded-duration`, `layout-property-transition`, `layout-keyframe-disclosure` | error | P3 motion |\n\nErrors fail the run (exit 1); warnings don't unless `--strict`.\n\n## Usage\n\n```bash\nads-lint [files...]        # lint specific files (what lint-staged passes)\nads-lint --staged          # files staged for commit (pre-commit hook)\nads-lint --diff origin/main  # files changed vs a ref (CI on a PR)\nads-lint --all             # everything under the configured root\nads-lint --strict          # fail on warnings too\n```\n\n## Config — `ads-lint.config.mjs` at the repo root\n\nDeep-merged over the defaults. A **consumer** repo needs almost nothing — just\npoint at the published package:\n\n```js\nexport default {\n  imports: { libraryPackage: \"@actioneer/ads\" }, // libraryRoot stays null\n};\n```\n\nThe ADS library repo itself runs in **library-dev mode** (see this repo's\n`ads-lint.config.mjs`): `libraryRoot: \"src/components\"` exempts the library's own\ninternals, and `libraryPackage: \"@/components\"` matches the local alias.\n\n## Wiring into a consumer repo\n\n**Pre-commit (lint-staged)** — lint only what's staged:\n\n```jsonc\n// package.json\n\"lint-staged\": {\n  \"src/**/*.{ts,tsx,css}\": \"ads-lint\"\n}\n```\n\n**CI (GitHub Actions)** — lint only the PR diff, so legacy code doesn't block.\n`--diff` diffs from the merge-base, so the base branch must be present — set\n`fetch-depth: 0` (the default shallow clone omits it):\n\n```yaml\n- uses: actions/checkout@v4\n  with: { fetch-depth: 0 }\n- run: npx ads-lint --diff origin/${{ github.base_ref }}\n```\n\n## Programmatic API\n\n```js\nimport { loadConfig, resolveFiles, lintFiles } from \"@actioneer/ads-lint\";\nconst cfg = await loadConfig();\nconst { findings } = lintFiles(resolveFiles({ files: myFiles }, cfg, cwd), cfg, cwd);\n```\n","readmeFilename":"README.md"}