Skip to content

Commit

Permalink
Introduce a custom module to silence dart sass warnings
Browse files Browse the repository at this point in the history
With this change, we have defined a custom SassWarningSupressor module that
overrides the warn method so that we can ignore messages containing 'sass'
or 'dart-sass' only.

This is needed so that we can avoid sass warnings in downstream projects.
  • Loading branch information
marcotranchino committed Oct 8, 2024
1 parent daec63f commit 19962c3
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions lib/govuk_tech_docs.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,18 @@
require "govuk_tech_docs/warning_text_extension"
require "govuk_tech_docs/api_reference/api_reference_extension"

module SassWarningSupressor
def warn(message)
if message.to_s.match?(/Sass|dart-sass/i)
# suppress dart sass warnings
else
super
end
end
end

Warning.extend(SassWarningSupressor)

module GovukTechDocs
# Configure the tech docs template
#
Expand Down

0 comments on commit 19962c3

Please sign in to comment.