Skip to content
This repository was archived by the owner on May 14, 2021. It is now read-only.

Handle caught 'SyntaxError' errors #163

Closed
wants to merge 2 commits into from
Closed
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: 4 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,11 +38,15 @@ module.exports = options => ({
)
return extractedCSS
} catch (e) {
const name = e.name
// incorrect interpolations will throw CssSyntaxError and they'll be handled by stylelint
if (e.name === 'CssSyntaxError') {
errorWasThrown[absolutePath] = true
throw e
}
if (name === 'SyntaxError') {
return input
}
return ''
}
},
Expand Down