{"id":18774,"library":"sass-lint","title":"Sass Lint","description":"A Node-only Sass linter for both .sass and .scss syntax, providing over 70 configurable rules for code quality and consistency. Current stable version is 1.13.1, which reverts breaking changes from the mistakenly released 1.13.0 (which introduced a new AST parser and disabled-next-line feature). Development has slowed significantly since 2019, with no recent releases. Key differentiators include extensive configurability via YAML/JSON, a migration tool from SCSS-Lint, and performance-focused cache options. However, it has known issues with modern Sass syntax and is largely superseded by stylelint with scss plugins.","status":"maintenance","version":"1.13.1","language":"javascript","source_language":"en","source_url":"https://github.com/sasstools/sass-lint","tags":["javascript","Sass","SCSS","lint"],"install":[{"cmd":"npm install sass-lint","lang":"bash","label":"npm"},{"cmd":"yarn add sass-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add sass-lint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Custom fork of gonzales-pe CSS parser used for AST parsing (v1.12.1+).","package":"gonzales-pe-sl","optional":false},{"reason":"Underlying linter engine (v2.x in v1.10.2, but may vary).","package":"eslint","optional":false}],"imports":[{"note":"Package is CJS-only, no ESM exports. Use require().","wrong":"import sassLint from 'sass-lint';","symbol":"sassLint","correct":"const sassLint = require('sass-lint');"},{"note":"Named export available via CJS destructuring.","wrong":"import { lintFiles } from 'sass-lint';","symbol":"lintFiles","correct":"const { lintFiles } = require('sass-lint');"},{"note":"Use named export for inline linting.","wrong":"import lintText from 'sass-lint';","symbol":"lintText","correct":"const { lintText } = require('sass-lint');"},{"note":"Same pattern, but ensure destructuring matches.","wrong":"const outputResults = require('sass-lint').outputResults;","symbol":"outputResults","correct":"const { outputResults } = require('sass-lint');"}],"quickstart":{"code":"const { lintFiles, lintText } = require('sass-lint');\n\n// Lint a file\nconst results = lintFiles('path/to/file.scss', {\n  configFile: '.sass-lint.yml',\n  options: { formatter: 'stylish' }\n});\n\n// Lint a string\nconst textResults = lintText('.class { color: red; }', {\n  filename: 'inline.scss',\n  options: { syntax: 'scss' }\n}, (err, data) => {\n  if (err) throw err;\n  console.log(data.warningCount + ' warnings');\n});\n\n// Output results\nconst { outputResults } = require('sass-lint');\noutputResults(results, 'stylish');","lang":"javascript","description":"Basic example showing how to lint files and inline text using the Node API, with callback and output formatting."},"warnings":[{"fix":"Use v1.13.1 or later, and ensure config does not rely on any 1.13.0-specific features (e.g., disable-next-line may not work as expected).","message":"v1.13.0 was mistakenly released with breaking changes (new AST parser) and should have been a major version. v1.13.1 reverts to match v1.12.1 behavior.","severity":"breaking","affected_versions":"1.13.0"},{"fix":"Migrate to stylelint with stylelint-scss plugin for ongoing support.","message":"Package is effectively unmaintained since 2019; no bug fixes or Sass syntax updates for newer features like @use, @forward, or module system.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Run with command: sass-lint --no-exit -q -c .sass-lint.yml","message":"The CLI does not exit with non-zero code on warnings by default unless --no-exit flag is omitted; use --no-exit -q to suppress errors.","severity":"gotcha","affected_versions":">=1.10.1"},{"fix":"Disable problematic rules in config or adjust file patterns to exclude known edge cases.","message":"Some rules (e.g., indentation) may produce false positives with nested @at-root or advanced selector patterns.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Update to v1.12.1+ or configure the rule to ignore custom properties.","message":"Rule 'no-color-keywords' flags custom properties containing color names (e.g., --blue) as errors. This was fixed in v1.12.0 but still may have edge cases.","severity":"deprecated","affected_versions":"<1.12.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run: npm install gonzales-pe-sl@1.0.0 --save-dev","cause":"Missing dependency after npm install due to package.json not including it in dependencies explicitly (it's a fork).","error":"Error: Cannot find module 'gonzales-pe-sl'"},{"fix":"Use stylelint with stylelint-scss instead, or avoid unsupported syntax and downgrade to Sass 3.x.","cause":"sass-lint's parser does not support certain modern Sass syntax (e.g., @use, @forward, slash-division).","error":"Unexpected token: ... at line X, col Y (SCSS parsing error)"},{"fix":"Move 'formatter' inside 'options' block in the config file or use CLI flag: sass-lint -f stylish","cause":"Invalid config key; the correct key is 'options.formatter' not top-level 'formatter'.","error":"SassLint: Unknown option: 'formatter' in config"},{"fix":"Check that the glob pattern is correct and files exist. Example: files.include: '**/*.s+(a|c)ss'","cause":"Glob pattern in 'files.include' does not match any files or is misconfigured.","error":"sass-lint: No files to lint"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}