npm.io
0.1.0 • Published 8 years agoCLI

@orbit-tech/sass-unused

Licence
ISC
Version
0.1.0
Deps
2
Size
10 kB
Vulns
0
Weekly
0

sass-unused

Build Status

A utility for finding unused variables, mixins and functions in a collection of SASS files, built on the gonzales-pe parser.

Usage

Command Line

npm install -g @orbit-tech/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 sassUnused = require('@orbit-tech/sass-unused')

sassUnused.findUnused('src/**/*.scss')
  .forEach(ident => console.log(ident))

Caveats

This tool is quite dumb, it assumes that all variables, functions and mixins live in the same namespace and can be identified uniquely via their identifiers.