Skip to content

Commit

Permalink
Merge branch 'master' into fix-importers-modern-api
Browse files Browse the repository at this point in the history
  • Loading branch information
alexander-akait committed May 17, 2022
2 parents aed92f9 + 58ffb68 commit a4584e5
Show file tree
Hide file tree
Showing 5 changed files with 470 additions and 412 deletions.
10 changes: 3 additions & 7 deletions src/SassError.js
Expand Up @@ -3,8 +3,6 @@ class SassError extends Error {
super();

this.name = "SassError";
// TODO remove me in the next major release
this.originalSassError = sassError;

if (
typeof sassError.line !== "undefined" ||
Expand All @@ -18,13 +16,11 @@ class SassError extends Error {

// Keep original error if `sassError.formatted` is unavailable
this.message = `${this.name}: ${
typeof this.originalSassError.message !== "undefined"
? this.originalSassError.message
: this.originalSassError
typeof sassError.message !== "undefined" ? sassError.message : sassError
}`;

if (this.originalSassError.formatted) {
this.message = `${this.name}: ${this.originalSassError.formatted.replace(
if (sassError.formatted) {
this.message = `${this.name}: ${sassError.formatted.replace(
/^Error: /,
""
)}`;
Expand Down
4 changes: 1 addition & 3 deletions src/utils.js
Expand Up @@ -153,9 +153,7 @@ async function getSassOptions(
: content;

if (!options.logger) {
// TODO set me to `true` by default in the next major release
const needEmitWarning = loaderOptions.warnRuleAsWarning === true;

const needEmitWarning = loaderOptions.warnRuleAsWarning !== false;
const logger = loaderContext.getLogger("sass-loader");
const formatSpan = (span) =>
`${span.url || "-"}:${span.start.line}:${span.start.column}: `;
Expand Down

0 comments on commit a4584e5

Please sign in to comment.