https://github.com/robertknight/sass-unused
Utility for finding unused variables in a collection of SASS files
https://github.com/robertknight/sass-unused
Last synced: 14 days ago
JSON representation
Utility for finding unused variables in a collection of SASS files
- Host: GitHub
- URL: https://github.com/robertknight/sass-unused
- Owner: robertknight
- Created: 2016-07-18T13:51:43.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2022-12-30T20:29:53.000Z (over 2 years ago)
- Last Synced: 2025-03-29T06:51:17.416Z (about 1 month ago)
- Language: JavaScript
- Size: 215 KB
- Stars: 13
- Watchers: 3
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
sass-unused
===========[](https://travis-ci.org/robertknight/sass-unused)
A utility for finding unused variables, mixins and functions in a collection of
SASS files.## Usage
### Command Line
```sh
npm install -g sass-unused
sass-unused 'src/**/*.scss'
```This will parse all SASS files in 'src' and print a list of identifiers of
variables, functions and mixins which are declared but not referenced
elsewhere.### Library
```js
var { findUnused } = require('sass-unused')// "unused" is an object with keys for different types of SASS item
// (variable, mixin, function etc.) listing unused items of that type.
const unused = findUnused('src/**/*.scss');
console.log('unused items', unused);
```## Caveats
This tool is quite dumb in that it assumes that all variables, functions and mixins
live in the same namespace and can be identified uniquely via their
identifiers. As a result, this tool may fail to report some unused identifiers.