Skip to content

[heft] @rushstack/heft-sass-plugin: ignoreDeprecationsInDependencies is a silent no-op (never wired to Sass quietDeps) #5816

@cmalonzo

Description

@cmalonzo

@rushstack/heft-sass-plugin: ignoreDeprecationsInDependencies is a silent no-op (never wired to Sass quietDeps)

Summary

@rushstack/heft-sass-plugin documents and schema-validates a Sass config option ignoreDeprecationsInDependencies, but the option has no effect. It is declared in the JSON schema, in the ISassProcessorOptions interface, and in the README — but it is never read from the config file and never forwarded to the Sass compiler. Setting it to true passes validation and does nothing.

The option is clearly intended to map to the Sass compiler's quietDeps flag, which suppresses deprecation warnings originating from dependency stylesheets (files reached via importers / @use / @import) while keeping warnings in the project's own authored SCSS visible. Today the only working lever is the blunt, global silenceDeprecations, which also hides deprecations in first-party code that developers actually need to fix.

Versions

  • @rushstack/heft-sass-plugin: 1.4.1
  • @rushstack/heft: 1.2.17
  • sass-embedded: 1.85.1

Root cause

The value is dropped at two points along the path sass.jsonSassPlugin.tsSassProcessor.ts → sass compiler options:

  1. src/SassPlugin.ts — the config interface ISassConfigurationJson does not declare ignoreDeprecationsInDependencies. It is not destructured from the loaded sassConfigurationJson, and it is never copied into the ISassProcessorOptions object passed to new SassProcessor(...). (Only silenceDeprecations is plumbed through.)

  2. src/SassProcessor.ts — the constructor destructures only { silenceDeprecations, excludeFiles }, and the this._scssOptions object literal sets silenceDeprecations but never sets quietDeps. The string quietDeps does not appear anywhere in the package.

The schema (src/schemas/heft-sass-plugin.schema.json), the ISassProcessorOptions interface, and the README all declare/document the option — which is exactly why it appears supported while silently doing nothing.

Steps to reproduce

  1. Use @rushstack/heft-sass-plugin on a project whose SCSS @uses/@imports a dependency (e.g. from node_modules) that emits a Sass deprecation warning (e.g. import, global-builtin, or color-functions).
  2. In config/sass.json, set:
    { "ignoreDeprecationsInDependencies": true }
  3. Build.

Expected: deprecation warnings coming from the dependency are suppressed, while deprecations in the project's own SCSS still appear.

Actual: the option is ignored entirely; dependency deprecation warnings are still printed. The only way to silence them is global silenceDeprecations, which also hides first-party deprecations.

Suggested fix

Forward the option to the Sass compiler's quietDeps flag:

  • In src/SassPlugin.ts: add ignoreDeprecationsInDependencies?: boolean to ISassConfigurationJson, include it in the destructure of the loaded config, and pass it into the ISassProcessorOptions given to new SassProcessor(...).
  • In src/SassProcessor.ts: destructure ignoreDeprecationsInDependencies from options and add quietDeps: ignoreDeprecationsInDependencies to the this._scssOptions object literal (alongside the existing silenceDeprecations). The two are independent and should compose.

quietDeps is a standard sass-embedded option (boolean | undefined), so passing the optional value through is type-safe and requires no schema change.

Related

Originally surfaced via SharePoint/sp-dev-docs#10834

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    Status
    Needs triage

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions