Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions build/lint-vars.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,15 +44,15 @@ function findUnusedVars(dir) {
// Array of all Sass variables
const variables = sassFilesString.match(/(^\$[a-zA-Z0-9_-]+[^:])/gm)

console.log(`There's a total of ${variables.length} variables.`)
console.log(`Found ${variables.length} total variables.`)

// Loop through each variable
variables.forEach((variable) => {
const re = new RegExp(regExpQuote(variable), 'g')
const count = (sassFilesString.match(re) || []).length

if (count === 1) {
console.log(`Variable "${variable}" is only used once!`)
console.log(`Variable "${variable}" is not being used.`)
unusedVarsFound = true
globalSuccess = false
}
Expand Down