DEPRECATED - feel free to use, but some known issues and the outdated state of this package do not warrant its use in pipelines or valid checks
A function that takes content (HTML/JS/etc) and CSS, and returns the validity of your unused selectors.
npm install useless-css-checker --save-dev
const uselessCssChecker = require('useless-css-checker')
module.exports.csscheck = () => {
const content = ['dist/lib/main.js', 'dist/lib/vendor.js']
const css = ['dist/lib/main.css', 'dist/lib/vendor.css']
const options = {
rejected: true,
validationOutput: true, // gives output on rejections
validationProcessExit: true, // determines if process.exit
whitelist: ['*white-list-testing*']
}
uselessCssChecker(content, css, options)
}