{"id":26445,"library":"stylelint-sass-render-errors","title":"stylelint-sass-render-errors","description":"A Stylelint plugin (v4.1.3) that displays Sass render errors and deprecations as lint errors. It integrates the Sass compiler (Dart Sass) into Stylelint, treating deprecations as errors to encourage code modernization. Unlike other Sass linting tools, it operates per file and supports modern Sass APIs (`compile`, `compileString`) with options for sync/async rendering, custom Sass options, and undefined function checking. Requires Node >=18.12, Stylelint >=14, and Dart Sass (peer dependency). Released actively with monthly or quarterly updates.","status":"active","version":"4.1.3","language":"javascript","source_language":"en","source_url":"https://github.com/niksy/stylelint-sass-render-errors","tags":["javascript","stylelint","sass","render","error","deprecation","warning","stylelint-plugin"],"install":[{"cmd":"npm install stylelint-sass-render-errors","lang":"bash","label":"npm"},{"cmd":"yarn add stylelint-sass-render-errors","lang":"bash","label":"yarn"},{"cmd":"pnpm add stylelint-sass-render-errors","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency: the plugin requires Stylelint 14, 15, or 16 to register rules and report errors.","package":"stylelint","optional":false},{"reason":"Implied peer dependency: Dart Sass is used for rendering; the plugin does not bundle it.","package":"sass","optional":false}],"imports":[{"note":"In Stylelint config, reference the package name directly; no explicit import required in JS files.","wrong":"plugins: ['stylelint-sass-render-errors/index.js']","symbol":"stylelint-sass-render-errors (plugin)","correct":"plugins: ['stylelint-sass-render-errors']"},{"note":"Rule names must be prefixed with 'plugin/' as per Stylelint plugin convention.","wrong":"rules: { 'sass-render-errors': true }","symbol":"rule 'plugin/sass-render-errors'","correct":"rules: { 'plugin/sass-render-errors': true }"},{"note":"Since v4.0.0, the package is ESM-only; CommonJS require() will fail.","wrong":"const stylelintSassRenderErrors = require('stylelint-sass-render-errors');","symbol":"ESM import (if used programmatically)","correct":"import stylelintSassRenderErrors from 'stylelint-sass-render-errors';\nstylelint.createPlugin(stylelintSassRenderErrors);"}],"quickstart":{"code":"// .stylelintrc.json\n{\n  \"plugins\": [\"stylelint-sass-render-errors\"],\n  \"rules\": {\n    \"plugin/sass-render-errors\": [true, {\n      \"sync\": false,\n      \"sassOptions\": { \"style\": \"expanded\" },\n      \"checkUndefinedFunctions\": true,\n      \"disallowedKnownCssFunctions\": [\"lighten\", \"darken\"],\n      \"additionalKnownCssFunctions\": []\n    }]\n  }\n}\n\n// Example SCSS that triggers an error:\n// _test.scss\n@use 'sass:color';\n.foo {\n  color: color.invert(1); // passing number to invert() is deprecated\n}\n\n// Run stylelint on the file:\n// npx stylelint _test.scss","lang":"typescript","description":"Configures the plugin to catch Sass deprecations and undefined functions, then lint an SCSS file."},"warnings":[{"fix":"Use import syntax or update Node.js to >=18.12 and ensure your project uses ESM.","message":"v4.0.0 dropped CommonJS support; only ESM is supported.","severity":"breaking","affected_versions":">=4.0.0 <5.0.0"},{"fix":"Upgrade Node to >=18.12 and Dart Sass to >=1.75.","message":"v4.0.0 dropped support for Node <18.12 and Dart Sass <1.75.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Ensure your Sass options are compatible with the new API; see Sass docs.","message":"v4.0.0 uses the new Sass JS API (compile/compileString) instead of the deprecated render.","severity":"breaking","affected_versions":">=4.0.0"},{"fix":"Use the new API; no action needed if using the plugin as-is.","message":"The 'render' method is deprecated in Dart Sass 1.75+ and removed in later versions; plugin v4+ uses 'compile'.","severity":"deprecated","affected_versions":">=4.0.0"},{"fix":"Switch to Sass modules (@use/@forward) for better isolation.","message":"Global @import statements are not supported; the plugin operates per file.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Set checkUndefinedFunctions: true in plugin options.","message":"Undefined function checking is off by default; you must explicitly enable checkUndefinedFunctions.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Use ES module import syntax or convert your project to ESM.","cause":"Using CommonJS require() with ESM-only package (v4+).","error":"Error: You gave us a `require` call, but this is an ES module. Please use `import` instead."},{"fix":"Use `import stylelintSassRenderErrors from 'stylelint-sass-render-errors'` (default import) or use plugin config as string.","cause":"Incorrect import syntax when using the plugin programmatically.","error":"SyntaxError: Named export 'default' not found. The requested module 'stylelint-sass-render-errors' is a CommonJS module; it may need a default import."},{"fix":"Add the plugin to the `plugins` array in .stylelintrc: `\"plugins\": [\"stylelint-sass-render-errors\"]`.","cause":"Plugin not loaded in Stylelint config.","error":"Unknown rule: plugin/sass-render-errors"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}