{"_id":"@allons-y/stylelint-header","_rev":"3-070fc7815be057e7eb557607fcd24011","name":"@allons-y/stylelint-header","dist-tags":{"latest":"4.0.2"},"versions":{"4.0.0":{"name":"@allons-y/stylelint-header","version":"4.0.0","keywords":["css","header","linter","stylelint","stylelint-plugin"],"author":{"url":"https://allons-y.studio","name":"Cassondra Roberts","email":"castastrophe@users.noreply.github.com"},"license":"MPL-2.0","_id":"@allons-y/stylelint-header@4.0.0","maintainers":[{"name":"castastrophe","email":"castastrophe+npm@hey.com"}],"homepage":"https://github.com/allonsy-studio/stylelint-header#readme","bugs":{"url":"https://github.com/allonsy-studio/stylelint-header/issues"},"dist":{"shasum":"e72fe977112272b107a2b17c36ea427d50a31918","tarball":"https://registry.npmjs.org/@allons-y/stylelint-header/-/stylelint-header-4.0.0.tgz","fileCount":5,"integrity":"sha512-/zlbDLoRe2eEHWNNJd7jopdGxItti656mH6Aclt8xjqVwlxsNuA6xFqjYKznXEFcDfEFv0yRWtWI6aSCYNWuBw==","signatures":[{"sig":"MEQCIEEiUuUUswcmYlMSwzr6GFFP3jDbIJFBDU6nqyHySu8RAiAEXhCgOsAzmUYBYB3VG47ctwh0sutRGWoBo5CiMT0Btw==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":29803},"jest":{"preset":"jest-preset-stylelint"},"type":"module","module":"index.js","engines":{"node":">=24"},"exports":"./index.js","funding":[{"url":" https://github.com/sponsors/castastrophe","type":"github"},{"url":"https://www.buymeacoffee.com/castastrophe","type":"buymeacoffee"}],"gitHead":"77f308bd4b0b3a786e4973ee4995f57972a7768c","scripts":{"lint":"eslint --no-error-on-unmatched-pattern --no-warn-ignored --cache '**/*'","test":"cross-env NODE_OPTIONS=--experimental-vm-modules jest","watch":"yarn test --watch","format":"yarn lint --fix","prepack":"pinst --disable","prepare":"husky && envoy || true","coverage":"yarn test --coverage --coverageReporters=cobertura","postpack":"pinst --enable","changeset":"changeset","prepublish":"yarn test"},"_npmUser":{"name":"castastrophe","email":"castastrophe+npm@hey.com"},"repository":{"url":"git+https://github.com/allonsy-studio/stylelint-header.git","type":"git"},"_npmVersion":"11.12.1","description":"A stylelint plugin that checks for a file header.","directories":{},"lint-staged":{"*":["eslint --fix --format stylish","prettier --write --ignore-unknown --no-error-on-unmatched-pattern --no-warn-ignored"],".github/renovate.json":"npx --yes --package renovate -- renovate-config-validator --strict"},"_nodeVersion":"24.15.0","dependencies":{"lodash-es":"4.18.1","string-similarity":"4.0.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"yarn@4.17.1","devDependencies":{"jest":"30.3.0","husky":"9.1.7","pinst":"3.0.0","eslint":"^10.4.1","globals":"^17.6.0","prettier":"^3.8.3","cross-env":"10.1.0","stylelint":"17.9.1","@eslint/js":"^10.0.1","lint-staged":"^17.0.4","@eslint/json":"^1.2.0","@eslint/compat":"^1.4.1","@allons-y/envoy":"^1.1.0","@changesets/cli":"^2.31.0","@eslint/markdown":"^8.0.2","eslint-plugin-jest":"^29.15.4","eslint-plugin-node":"^11.1.0","eslint-plugin-jsonc":"^3.2.0","jest-preset-stylelint":"9.1.0","eslint-config-prettier":"^10.1.8","@stylistic/eslint-plugin":"^2.13.0","@changesets/get-github-info":"^0.8.0"},"peerDependencies":{"stylelint":"17.x"},"_npmOperationalInternal":{"tmp":"tmp/stylelint-header_4.0.0_1784169144512_0.43685589798153335","host":"s3://npm-registry-packages-npm-production"}},"4.0.1":{"name":"@allons-y/stylelint-header","version":"4.0.1","keywords":["css","header","linter","stylelint","stylelint-plugin"],"author":{"url":"https://allons-y.studio","name":"Cassondra Roberts","email":"castastrophe@users.noreply.github.com"},"license":"MPL-2.0","_id":"@allons-y/stylelint-header@4.0.1","maintainers":[{"name":"castastrophe","email":"castastrophe+npm@hey.com"}],"homepage":"https://github.com/allonsy-studio/stylelint-header#readme","bugs":{"url":"https://github.com/allonsy-studio/stylelint-header/issues"},"dist":{"shasum":"40bec0fbd6cff8bb227b1048810f37bfff6ea46b","tarball":"https://registry.npmjs.org/@allons-y/stylelint-header/-/stylelint-header-4.0.1.tgz","fileCount":5,"integrity":"sha512-xvRfimjdYz4Ur3EQu5U2QoVtim1WHNKkqLcMokuHPILlwRvzJvzFEh9+BuPrK9/4nIQHNghPCXaR2bvN2hEZ2w==","signatures":[{"sig":"MEUCIBXg90Ddy6fdjoyCI8CqKTinlVk3KqOExd+62IRKQnoLAiEAgAaslP91GyMztkqNPIF/v47cS+3/aEmcskfhH0hkPKk=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@allons-y%2fstylelint-header@4.0.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":34929},"jest":{"preset":"jest-preset-stylelint"},"type":"module","module":"index.js","engines":{"node":">=24"},"exports":"./index.js","funding":[{"url":" https://github.com/sponsors/castastrophe","type":"github"},{"url":"https://www.buymeacoffee.com/castastrophe","type":"buymeacoffee"}],"gitHead":"7809ec6ce5c89040c3a7d14cd7b3dfade115bf4e","scripts":{"lint":"eslint --no-error-on-unmatched-pattern --no-warn-ignored --cache '**/*'","test":"cross-env NODE_OPTIONS=--experimental-vm-modules jest","watch":"yarn test --watch","format":"yarn lint --fix","prepack":"pinst --disable","prepare":"husky && envoy || true","coverage":"yarn test --coverage --coverageReporters=cobertura","postpack":"pinst --enable","changeset":"changeset","prepublish":"yarn test","release:version":"changeset version && node scripts/stamp-changelog-date.js"},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:4aae6f4c-9a2a-4a90-982c-46f23f443ab1"}},"repository":{"url":"git+https://github.com/allonsy-studio/stylelint-header.git","type":"git"},"_npmVersion":"12.0.1","description":"A stylelint plugin that checks for a file header.","directories":{},"lint-staged":{"*":["eslint --fix --format stylish","prettier --write --ignore-unknown --no-error-on-unmatched-pattern --no-warn-ignored"],".github/renovate.json":"npx --yes --package renovate -- renovate-config-validator --strict"},"_nodeVersion":"24.18.0","dependencies":{"lodash-es":"4.18.1","string-similarity":"4.0.4"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"packageManager":"yarn@4.17.1","devDependencies":{"jest":"30.3.0","husky":"9.1.7","pinst":"3.0.0","eslint":"^10.4.1","globals":"^17.6.0","prettier":"^3.8.3","cross-env":"10.1.0","stylelint":"17.9.1","@eslint/js":"^10.0.1","lint-staged":"^17.0.4","@eslint/json":"^1.2.0","@eslint/compat":"^1.4.1","@allons-y/envoy":"^1.1.0","@changesets/cli":"^2.31.0","@eslint/markdown":"^8.0.2","eslint-plugin-jest":"^29.15.4","eslint-plugin-node":"^11.1.0","eslint-plugin-jsonc":"^3.2.0","jest-preset-stylelint":"9.1.0","eslint-config-prettier":"^10.1.8","@stylistic/eslint-plugin":"^2.13.0","@changesets/get-github-info":"^0.8.0"},"peerDependencies":{"stylelint":"17.x"},"_npmOperationalInternal":{"tmp":"tmp/stylelint-header_4.0.1_1784319796263_0.7580702540658513","host":"s3://npm-registry-packages-npm-production"}},"4.0.2":{"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"name":"@allons-y/stylelint-header","version":"4.0.2","description":"A stylelint plugin that checks for a file header.","license":"MPL-2.0","author":{"name":"Cassondra Roberts","email":"castastrophe@users.noreply.github.com","url":"https://allons-y.studio"},"funding":[{"type":"github","url":" https://github.com/sponsors/castastrophe"},{"type":"buymeacoffee","url":"https://www.buymeacoffee.com/castastrophe"}],"repository":{"type":"git","url":"git+https://github.com/allonsy-studio/stylelint-header.git"},"bugs":{"url":"https://github.com/allonsy-studio/stylelint-header/issues"},"type":"module","exports":"./index.js","module":"index.js","scripts":{"changeset":"changeset","coverage":"yarn test --coverage --coverageReporters=cobertura","format":"yarn lint --fix","lint":"eslint --no-error-on-unmatched-pattern --no-warn-ignored --cache '**/*'","postpack":"pinst --enable","prepack":"pinst --disable","prepare":"husky && envoy || true","prepublish":"yarn test","release:version":"changeset version && node scripts/stamp-changelog-date.js","test":"cross-env NODE_OPTIONS=--experimental-vm-modules jest","watch":"yarn test --watch"},"dependencies":{"lodash-es":"4.18.1","string-similarity":"4.0.4"},"peerDependencies":{"stylelint":"17.x"},"devDependencies":{"@allons-y/envoy":"^1.1.0","@changesets/cli":"^2.31.0","@changesets/get-github-info":"^0.8.0","@eslint/compat":"^1.4.1","@eslint/js":"^10.0.1","@eslint/json":"^1.2.0","@eslint/markdown":"^8.0.2","@stylistic/eslint-plugin":"^2.13.0","cross-env":"10.1.0","eslint":"^10.4.1","eslint-config-prettier":"^10.1.8","eslint-plugin-jest":"^29.15.4","eslint-plugin-jsonc":"^3.2.0","eslint-plugin-node":"^11.1.0","globals":"^17.6.0","husky":"9.1.7","jest":"30.3.0","jest-preset-stylelint":"9.1.0","lint-staged":"^17.0.4","pinst":"3.0.0","prettier":"^3.8.3","stylelint":"17.9.1"},"keywords":["css","header","linter","stylelint","stylelint-plugin"],"engines":{"node":">=24"},"jest":{"preset":"jest-preset-stylelint"},"lint-staged":{"*":["eslint --fix --format stylish","prettier --write --ignore-unknown --no-error-on-unmatched-pattern --no-warn-ignored"],".github/renovate.json":"npx --yes --package renovate -- renovate-config-validator --strict"},"packageManager":"yarn@4.17.1","gitHead":"0ae546e926a8e102029daa2ab91564f597c5589e","_id":"@allons-y/stylelint-header@4.0.2","homepage":"https://github.com/allonsy-studio/stylelint-header#readme","_nodeVersion":"24.18.0","_npmVersion":"12.0.1","dist":{"integrity":"sha512-4oJVihCu3JhDDICOT54oVsA0jeaR43GmThwtrsUt0aAtuBLegEYTPinPqDysHVIwDs19hqaOMfjdN0tzgqlJMg==","shasum":"d2dea230ee1b0c163607672b0ee961f2afd7fe0e","tarball":"https://registry.npmjs.org/@allons-y/stylelint-header/-/stylelint-header-4.0.2.tgz","fileCount":5,"unpackedSize":35388,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@allons-y%2fstylelint-header@4.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDfMcfNJMSIGhqwe3psXvJMhwvaEzt+/o7LIpoPVA3l0wIgaQqKL9g33UkBDZCRqctPLu6+jW9GMFYEBljIl163IGA="}]},"_npmUser":{"name":"GitHub Actions","email":"npm-oidc-no-reply@github.com","trustedPublisher":{"id":"github","oidcConfigId":"oidc:4aae6f4c-9a2a-4a90-982c-46f23f443ab1"}},"directories":{},"maintainers":[{"name":"castastrophe","email":"castastrophe+npm@hey.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/stylelint-header_4.0.2_1784349098366_0.6434375457588184"},"_hasShrinkwrap":false}},"time":{"created":"2026-07-16T02:32:24.410Z","modified":"2026-07-18T04:31:38.853Z","4.0.0":"2026-07-16T02:32:24.713Z","4.0.1":"2026-07-17T20:23:16.398Z","4.0.2":"2026-07-18T04:31:38.495Z"},"bugs":{"url":"https://github.com/allonsy-studio/stylelint-header/issues"},"author":{"name":"Cassondra Roberts","email":"castastrophe@users.noreply.github.com","url":"https://allons-y.studio"},"license":"MPL-2.0","homepage":"https://github.com/allonsy-studio/stylelint-header#readme","keywords":["css","header","linter","stylelint","stylelint-plugin"],"repository":{"type":"git","url":"git+https://github.com/allonsy-studio/stylelint-header.git"},"description":"A stylelint plugin that checks for a file header.","maintainers":[{"name":"castastrophe","email":"castastrophe+npm@hey.com"}],"readme":"<!-- weaver:header:START -->\n<!-- auto-generated by Weaver — do not edit between these markers -->\n\n<p align=\"center\">\n<a href=\"https://allons-y.studio\">\n    <img id=\"user-content-logo\" src=\"https://raw.githubusercontent.com/allonsy-studio/.github/main/assets/png/oss-banner.png\" alt=\"Brought to you by Allons-y Studio\" width=\"1500\">\n</a>\n</p>\n\n<h1 align=\"center\" border=\"none\">stylelint-header</h1>\n\n<p align=\"center\">\n  <img src=\"https://github.com/allonsy-studio/.github/blob/main/assets/tag-rule.gif\" alt=\"\" height=\"30\" />\n</p>\n\n<p align=\"center\"><b>Enforce a header comment on every stylesheet.</b></p>\n\n<p align=\"center\">\n  <a href=\"https://github.com/allonsy-studio/stylelint-header/actions/workflows/testing.yml\">\n    <img src=\"https://github.com/allonsy-studio/stylelint-header/actions/workflows/testing.yml/badge.svg?branch=main\" alt=\"Tests\" height=\"20\" />\n  </a>\n  <a href=\"https://www.npmjs.com/package/@allons-y/stylelint-header\">\n    <img src=\"https://img.shields.io/npm/v/@allons-y/stylelint-header.svg\" alt=\"NPM version\" height=\"20\" />\n  </a>\n  <a href=\"https://github.com/allonsy-studio/stylelint-header/blob/main/LICENSE\">\n    <img src=\"https://img.shields.io/github/license/allonsy-studio/stylelint-header.svg\" alt=\"License\" height=\"20\" />\n  </a>\n  <a href=\"https://allons-y.studio\">\n    <img src=\"https://github.com/allonsy-studio/.github/blob/main/assets/svg/badge.svg\" alt=\"Brought to you by Allons-y Studio\" height=\"20\" />\n  </a>\n</p>\n\n<!-- weaver:header:END -->\n\nA [stylelint](https://github.com/stylelint/stylelint) custom rule that asserts every file begins with a configured header comment — typically a copyright or licence notice. When the header is missing, the rule reports an error; with `--fix`, it prepends the header for you.\n\n## The problem\n\nCopyright and licence headers are easy to add and easy to forget. A pre-commit lint check is the natural place to enforce them, but stylelint doesn't ship a header rule out of the box. **stylelint-header bridges the gap** — point it at a string or a file and every CSS/SCSS/Less file in your project picks up the same header, formatted consistently, with `--fix` doing the boring work.\n\n## Features\n\n- **Template-driven** — pass a string or a path to a file; supports [`lodash.template`](https://lodash.com/docs/4.17.15#template) syntax for variables\n- **Fuzzy matching** — uses [`string-similarity`](https://www.npmjs.com/package/string-similarity) so cosmetic edits (whitespace, year bumps) don't trigger false positives\n- **Auto-fixable** — missing headers are prepended on `--fix`, preserving the rest of the file\n- **Minifier-friendly** — opt into `/*!` syntax so the header survives tools like cssnano\n- **Built-in variables** — `YEAR`, `FILE_NAME`, and `FILE_PATH` are filled in automatically; bring your own as needed\n\n## Installation\n\n```sh\nyarn add --dev @allons-y/stylelint-header\nnpm install --save-dev @allons-y/stylelint-header\npnpm add --save-dev @allons-y/stylelint-header\nbun add --dev @allons-y/stylelint-header\n```\n\n## Usage\n\nAdd the plugin to your stylelint config and enable the `header/header` rule, passing either a string template or a path to a file containing the template. To toggle the rule off, set the value to `null`.\n\n### With a template file\n\n```json\n{\n\t\"plugins\": [\"@allons-y/stylelint-header\"],\n\t\"rules\": {\n\t\t\"header/header\": [\"./COPYRIGHT\"]\n\t}\n}\n```\n\n### With an inline template string\n\n```js\n{\n  \"plugins\": [\"@allons-y/stylelint-header\"],\n  \"rules\": {\n    \"header/header\": [\n      \"Copyright <%= YEAR %>. <%= company %>\",\n      {\n        templateVariables: {\n          company: \"AI Overlords Inc.\",\n        },\n        nonMatchingTolerance: 0.8,\n      },\n    ],\n  },\n}\n```\n\n## Options\n\n### `templateVariables`\n\n**Type:** `object` &nbsp;&nbsp;**Default:** `{}`\n\nKey/value pairs used to substitute variables in the header template. Given a template like:\n\n```js\n(c) <%= YEAR %> <%= company %>\n```\n\nand a config of:\n\n```js\n{\n  templateVariables: {\n    company: \"AI Overlords Inc.\",\n  },\n}\n```\n\nthe resulting header becomes:\n\n```css\n/*!\n * (c) 2026 AI Overlords Inc.\n */\n```\n\n`YEAR` was substituted automatically — it doesn't need to appear in `templateVariables`. The following variables are always available:\n\n| Variable    | Value                            |\n| ----------- | -------------------------------- |\n| `YEAR`      | The current year                 |\n| `FILE_NAME` | The basename of the linted file  |\n| `FILE_PATH` | The directory of the linted file |\n\nTemplates use [`lodash.template`](https://lodash.com/docs/4.17.15#template) — see the lodash docs for the full syntax.\n\n### `nonMatchingTolerance`\n\n**Type:** `number` between `0` and `1` &nbsp;&nbsp;**Default:** `0.98`\n\nMinimum similarity (per [`string-similarity`](https://www.npmjs.com/package/string-similarity)) between the comment found at the top of the file and the configured header. Lower the value when you want to allow small drift (e.g. a stale year); raise it to enforce an exact match.\n\n### `isRemovable`\n\n**Type:** `boolean` &nbsp;&nbsp;**Default:** `false`\n\nWhen `true`, generated headers begin with `/*` rather than `/*!`. The `/*!` prefix is preserved by most CSS minifiers (e.g. cssnano) — leave the default in place if you want the header to survive minification, set to `true` if you don't.\n\n## Requirements\n\n- Node.js >= 24\n- stylelint 17.x\n\n## Contributing\n\nContributions are welcome — see [CONTRIBUTING.md](./CONTRIBUTING.md) for the full workflow, and [CODE_OF_CONDUCT.md](./CODE_OF_CONDUCT.md) for community expectations. For bugs and ideas, please open an [issue](https://github.com/allonsy-studio/stylelint-header/issues/new).\n\n<!-- weaver:license:START -->\n<!-- auto-generated by Weaver — do not edit between these markers -->\n\n<h2>License</h2>\n\nThis project is licensed under the MPL-2.0 License - see the [LICENSE](LICENSE) file for details. This means you can use this freely, modify as needed; changes to MPL-licensed files should be shared back under the same license.\n\n<!-- weaver:license:END -->\n\n<!-- weaver:funding:START -->\n<!-- auto-generated by Weaver — do not edit between these markers -->\n\n<h2>Funding ☕️</h2>\n\nIf you find this plugin useful and would like to buy me a coffee/beer as a small thank you, I would greatly appreciate it!\n\n<a href=\"https://www.buymeacoffee.com/castastrophe\">\n    <img src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" height=\"40\"/>\n</a>\n\n<!-- weaver:funding:END -->\n\n<!-- weaver:footer:START -->\n<!-- auto-generated by Weaver — do not edit between these markers -->\n\n<p align=\"center\">\n<a href=\"https://allons-y.studio\">\n    <picture>\n        <source media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/allonsy-studio/.github/main/assets/png/oss-footer-dark.png\">\n        <source media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/allonsy-studio/.github/main/assets/png/oss-footer-light.png\">\n        <img id=\"user-content-logo\" src=\"https://raw.githubusercontent.com/allonsy-studio/.github/main/assets/png/oss-footer-light.png\" alt=\"Brought to you by Allons-y Studio\" width=\"400\">\n    </picture>\n</a>\n</p>\n\n<!-- weaver:footer:END -->\n","readmeFilename":"README.md"}