{"id":26576952,"url":"https://github.com/daveschumaker/scss-away","last_synced_at":"2025-08-23T15:43:28.640Z","repository":{"id":83488783,"uuid":"85127884","full_name":"daveschumaker/scss-away","owner":"daveschumaker","description":"A utility to examine a folder of React components, check corresponding scss files and show orphaned rules.","archived":false,"fork":false,"pushed_at":"2019-02-01T17:36:52.000Z","size":85,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-09T09:28:22.299Z","etag":null,"topics":["css","javascript","react","sass","scss"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/scss-away","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/daveschumaker.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2017-03-15T22:37:38.000Z","updated_at":"2019-02-01T17:36:53.000Z","dependencies_parsed_at":"2023-03-29T13:03:05.303Z","dependency_job_id":null,"html_url":"https://github.com/daveschumaker/scss-away","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/daveschumaker/scss-away","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daveschumaker%2Fscss-away","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daveschumaker%2Fscss-away/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daveschumaker%2Fscss-away/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daveschumaker%2Fscss-away/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/daveschumaker","download_url":"https://codeload.github.com/daveschumaker/scss-away/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/daveschumaker%2Fscss-away/sbom","scorecard":{"id":325643,"data":{"date":"2025-08-11","repo":{"name":"github.com/daveschumaker/scss-away","commit":"26533ade3bfbfdd65aedf7b5c59ee26549956673"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Code-Review","score":0,"reason":"Found 0/22 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"59 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-fjxv-7rqg-78g4","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c","Warn: Project is vulnerable to: GHSA-q42p-pg8m-cqh6","Warn: Project is vulnerable to: GHSA-w457-6q6x-cgp9","Warn: Project is vulnerable to: GHSA-62gr-4qp9-h98f","Warn: Project is vulnerable to: GHSA-f52g-6jhx-586p","Warn: Project is vulnerable to: GHSA-2cf5-4w76-r9qv","Warn: Project is vulnerable to: GHSA-3cqr-58rm-57f8","Warn: Project is vulnerable to: GHSA-g9r4-xpmj-mj65","Warn: Project is vulnerable to: GHSA-q2c6-c6pm-g3gh","Warn: Project is vulnerable to: GHSA-765h-qjxv-5f44","Warn: Project is vulnerable to: GHSA-f2jv-r9rf-7988","Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546","Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx","Warn: Project is vulnerable to: GHSA-896r-f27r-55mw","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-5947-m4fg-xhqg","Warn: Project is vulnerable to: GHSA-779f-wgxg-qr8f","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-9v62-24cr-58cx","Warn: Project is vulnerable to: GHSA-r8f7-9pfq-mjmv","Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp","Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6","Warn: Project is vulnerable to: GHSA-7mwh-4pqv-wmr8","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3","Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v","Warn: Project is vulnerable to: GHSA-c4w7-xm78-47vh","Warn: Project is vulnerable to: GHSA-p9pc-299p-vxgp"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-18T02:26:03.325Z","repository_id":83488783,"created_at":"2025-08-18T02:26:03.326Z","updated_at":"2025-08-18T02:26:03.326Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271755065,"owners_count":24815334,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-08-23T02:00:09.327Z","response_time":69,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":["css","javascript","react","sass","scss"],"created_at":"2025-03-23T03:34:54.330Z","updated_at":"2025-08-23T15:43:28.627Z","avatar_url":"https://github.com/daveschumaker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SCSS Away\n\n**SCSS Away** is a tool that analyzes `.js` or `.jsx` files within a folder (or series of subfolders) and searches for matching `.scss` files (by default, in the same folder but you can provide a flag for a different folder where `scss` files may be located).\n\nIt then compares the rules in order to find abandoned / orphaned attributes that might be lingering inside your stylesheets as well as provide a warning when nested selectors are found ([you might ask, why?](http://thesassway.com/intermediate/avoid-nested-selectors-for-more-modular-css)).\n\nTo install:\n\n```javascript\nnpm install scss-away --save-dev\n```\n\n## Overview\n\nWe run a fairly robust web app created with React. There are hundreds and hundreds of components and associated stylesheets inside our project. Ideally, when we add, update, or remove code in a React component, we should be doing the same thing in corresponding stylesheets. Sometimes life gets in the way and we forget to do this for some reason or another. Over time, this adds up to a lot of code bloat that gets added to our project.\n\nThis tool was created in order to quickly analyze a large project (containing hundreds of React components and corresponding stylesheets) in order to find orphaned CSS rules.\n\nRunning this in our own React project took 0.54 seconds, found 405 files that matched `jsx` or `js`, matched 226 corresponding stylesheets and found errors in 115 stylesheets. (We used to nest our scss and we've started slowly moving away from that).\n\n## How to start\n\n```javascript\nnpm install scss-away --save-dev\n```\n\nRun the script from your project folder. Providing an absolute path to your project folder as an argument. (Tip, you can get the absolute path of your current project by typing `pwd` in your terminal).\n\n```\nscss-away --path /user/dave/example-project/src/\n```\n\n(Depending on how Node is setup on your machine, you may have to invoke this script using `./node_modules/scss-away/bin/scss-away` )\n\n## How to use\n\nBy default, the running the script above will search for `scss` files inside `/user/dave/example-project/src/`.\n\nAs an example, this is the ideal sort of default folder structure for matching `js` / `jsx` and `scss` files:\n\n```\nprojectFolder/\n├── componentOne/\n│   ├── componentOne.jsx\n│   ├── componentOne.scss\n│   ├── childComponentOne.jsx\n│   ├── childComponentOne.scss\n│   └── anotherFolder/\n│       ├── anotherComponent.jsx\n│       └── anotherComponent.scss\n└── ComponentTwo/\n    ├── componentTwo.jsx\n    └── componentTwo.scss\n```\n\nYou can use an optional `--css` flag to point to a custom location where stylesheets may be stored.\n\n```\nscss-away --path /user/dave/example-project/src/ --css /user/dave/example-project/stylesheets/\n```\n\nThis will look for stylesheets inside `/user/dave/example-project/stylesheets/`. The internal folder structure should match the internal folder structure for the components path. For example:\n\n```\nprojectFolder/\n├── src/\n│   ├── componentOne.jsx\n│   ├── componentTwo.jsx\n│   └── childComponents/\n│       ├── childComponentOne.jsx\n│       └── childComponentTwo.jsx\n└── stylesheets/\n    ├── componentOne.scss\n    ├── componentTwo.scss\n    └── childComponents/\n        ├── childComponentOne.scss\n        └── childComponentTwo.scss\n```\n\nWhen an `scss` file is found, the contents are parsed in order to create a list rules to match against.\n\nThe `js` / `jsx` file is imported and any class names or ids are extracted and matched against the results from the `scss` file.\n\nA list of orphaned rules that aren't found in the `jsx` component are returned in the terminal.\n\nExample results:\n\n```\n/user/dave/example-project/src/App.scss\n[Error] Orphan Classes:\n    .App-Container\n    .App-Header\n\n/user/dave/example-project/src/Users.jsx\n[Error] Orphan Classes:\n    .user-name-bold\n[Error] Orphan Ids:\n    #user-id\n\n/user/dave/example-project/src/Users.scss\n[Error] Orphan Classes:\n    .user-email-address\n```\n\n## Exclude files, ids, or classes.\n\nYou can tell `scss-away` to exclude certain file types, class names, or ids by creating a json file named `scss-away.exclude.js` in the root folder of your project (typically whereever your `package.json` file is located). Format the exclusion file like below:\n\n```\n{\n    \"files\": [\n        \"/project/folder/src/AppTemplate.jsx\",\n        \"/project/folder/src/templates/UserPage.scss\"\n    ],\n    \"classes\": [\n        \"active\",\n        \"UserDashboardTemplate\"\n    ],\n    \"ids\": [\n        \"app-root\"\n    ]\n}\n```\n\n## Options\n\n```\n--path   // Absolute path to project folder\n--css    // (Optional) Absolute path to stylesheets folder.\n--ext    // (Optional) Look for stylsheets matching this extension rather than defaulting to 'scss'\n```\n\nExample usage:\n\n```\nscss-away --path /project/src --css /project/css --ext css\n```\n\n## Tests\n\n```\nnpm test\n```\n\n## Contribute\n\nIf you'd like to contribute to this project you can do so by following these rules:\n\n1.  Fork this project into your own repo.\n2.  Modify, improve, change, delete code.\n3.  Add or update any tests related to changes you've made.\n4.  Send a pull request.\n\nWrite a detailed comment and state your changes when creating the PR. Try to match existing code style and comments.\n\nContributions are much appreciated!\n\n## TODO / Wishlist\n\n* Ability to load some sort of exclusion list so certain class names (e.g., class names for icon fonts), ids or maybe even entire files can be ignored.\n* Create an MD5 hash of each rule so we can check if duplicate rulesets are being used in project.\n* More optional flags (e.g., ability to analyze `.html` files instead of just `.js` or `.jsx`.\n* Option to auto-delete orphaned rules (oh, dear God)?\n* More robust tests and examples, especially for `appUtils.js`.\n\n## Changelog\n\n* v0.3.3\n    * Bump node-sass version due to issue with running on Linux machines.\n* v0.3.2\n    * Update tests to cover more use cases.\n* v0.3.0\n\t* Add `--css` flag to look for stylesheets in a different location and ability to exclude certain files.\n* v0.2.1\n\t* Fix wrongly named bin property in `package.json`\n* v0.2.0\n\t* Add ability to check html component for orphaned attributes not found in its corresponding scss file.\n* v0.1.0\n\t* Initial release\n\n## License\n\nThe MIT License (MIT)\n\nCopyright (c) 2017 Dave Schumaker\n\nPermission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the \"Software\"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaveschumaker%2Fscss-away","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdaveschumaker%2Fscss-away","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdaveschumaker%2Fscss-away/lists"}