{"id":20318379,"url":"https://github.com/wmonk/css-dont-reassign","last_synced_at":"2026-05-26T23:33:29.984Z","repository":{"id":36603647,"uuid":"40909808","full_name":"wmonk/css-dont-reassign","owner":"wmonk","description":"A linter to help stop you reassigning your CSS selectors","archived":false,"fork":false,"pushed_at":"2015-08-20T14:28:46.000Z","size":184,"stargazers_count":3,"open_issues_count":3,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-04T09:24:00.174Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/css-dont-reassign","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wmonk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-08-17T16:21:36.000Z","updated_at":"2015-09-09T16:11:49.000Z","dependencies_parsed_at":"2022-09-05T02:51:23.690Z","dependency_job_id":null,"html_url":"https://github.com/wmonk/css-dont-reassign","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/wmonk/css-dont-reassign","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmonk%2Fcss-dont-reassign","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmonk%2Fcss-dont-reassign/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmonk%2Fcss-dont-reassign/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmonk%2Fcss-dont-reassign/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wmonk","download_url":"https://codeload.github.com/wmonk/css-dont-reassign/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wmonk%2Fcss-dont-reassign/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33543973,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"ssl_error","status_checked_at":"2026-05-26T15:22:15.568Z","response_time":63,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T18:39:14.621Z","updated_at":"2026-05-26T23:33:29.966Z","avatar_url":"https://github.com/wmonk.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# css-dont-reassign\nA linter to help stop you reassigning your CSS selectors\n\n## Motivation\nThis module has been heavily inspired by [Immutable CSS](http://csswizardry.com/2015/03/immutable-css/) and [Functional Programming, CSS, and your sanity](http://www.jon.gold/2015/07/functional-css/). Both ideas describe a style of writing CSS in which your (specified) classes should never be overwritten - go and read them though, as they describe it better than here!\n\n## Installation\n`$ npm i --save css-dont-reassign`\n\n## Usage\n```js\nvar dontReassign = require('css-dont-reassign');\n\ndontReassign(pathToCss /*, options */)\n    .then(function (result) { \n        console.log(result.toString());\n    });\n```\n\n`dontReassign()` takes two arguments, `pathToCss` should be a fully qualified path to a css file. `options` is an optional argument, covered in detail below.\n\n## Options\n### `classMatch (optional)` \n`(string|regex)`\n\nThis will allow you to specify a matching pattern for your selectors. E.g `.util-`, will only match selectors prefixed with `.util-`. This is described in the [Enforcing Immutability](http://csswizardry.com/2015/03/immutable-css/#enforcing-immutability) section on CSS Wizadry.\n\n## Result\nResult is an array of `issues`, and has a `toString` method.\n\n### Issue object\n```js\n{\n    selector: String,\n    line: Object, // { line: Number, column: Number }\n    from: String\n    rule: Rule\n}\n```\n#### `selector`\nThe selector that was defined or mutated.\n\n#### `line`\nAn object containing the line and column of the selector definition.\n\n#### `from`\nThe file path.\n\n#### `rule`\nThe raw [postcss](https://github.com/postcss/postcss/blob/master/docs/api.md#rule-node) class.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwmonk%2Fcss-dont-reassign","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwmonk%2Fcss-dont-reassign","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwmonk%2Fcss-dont-reassign/lists"}