Skip to content

Utility for finding unused variables in a collection of SASS files

Notifications You must be signed in to change notification settings

robertknight/sass-unused

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

36 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sass-unused

Build Status

A utility for finding unused variables, mixins and functions in a collection of SASS files.

Usage

Command Line

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

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.

About

Utility for finding unused variables in a collection of SASS files

Resources

Stars

Watchers

Forks

Packages

No packages published