{"id":27374,"library":"sass-lint-auto-fix","title":"sass-lint-auto-fix","description":"A CLI tool that automatically fixes common sass-lint issues by parsing Sass/SCSS into an AST and modifying nodes to conform to rules defined in .sass-lint.yml. Currently at v0.21.2 (August 2020) with no updates since. It complements sass-lint (not stylelint) and supports SCSS and Sass syntax. Key differentiators: resolves issues via gonzales-pe AST manipulation; supports custom config files and husky pre-commit hooks. Alternatives: stylelint with --fix, Prettier. Note: sass-lint is deprecated in favor of stylelint, making this tool also effectively deprecated.","status":"maintenance","version":"0.21.2","language":"javascript","source_language":"en","source_url":"https://github.com/srowhani/sass-lint-auto-fix","tags":["javascript"],"install":[{"cmd":"npm install sass-lint-auto-fix","lang":"bash","label":"npm"},{"cmd":"yarn add sass-lint-auto-fix","lang":"bash","label":"yarn"},{"cmd":"pnpm add sass-lint-auto-fix","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core linting rules that the auto-fix resolves","package":"sass-lint","optional":false}],"imports":[{"note":"Package is CommonJS only; no named exports. Use require().","wrong":"import * as sassLintAutoFix from 'sass-lint-auto-fix'","symbol":"sassLintAutoFix","correct":"const sassLintAutoFix = require('sass-lint-auto-fix')"},{"note":"If installed globally, the command is sass-lint-auto-fix. npx works for local installs.","wrong":"sass-lint-auto-fix \"**/*.scss\"","symbol":"CLI usage","correct":"npx sass-lint-auto-fix \"**/*.scss\""},{"note":"Configuration is loaded automatically through cosmiconfig, not exported.","wrong":"require('sass-lint-auto-fix').config","symbol":"Configuration import (cosmiconfig)","correct":"// uses .sass-lint-auto-fix.yml automatically"}],"quickstart":{"code":"// Install as dev dependency\nnpm install --save-dev sass-lint-auto-fix sass-lint\n\n// Add to package.json\n{\n  \"scripts\": {\n    \"lint\": \"sass-lint -v\",\n    \"lint:fix\": \"sass-lint-auto-fix\"\n  }\n}\n\n// Run\nnpm run lint:fix\n\n// Or with npx (no install)\nnpx sass-lint-auto-fix \"src/**/*.scss\" --config-sass-lint .sass-lint.yml","lang":"javascript","description":"Shows install, script configuration, and running the auto-fix via CLI or npx."},"warnings":[{"fix":"Migrate to stylelint and use stylelint --fix or prettier for formatting.","message":"sass-lint is deprecated; consider migrating to stylelint. sass-lint-auto-fix only works with sass-lint.","severity":"deprecated","affected_versions":">=0.18.0"},{"fix":"Ensure your configuration file is named .sass-lint-auto-fix.[yml|yaml|json|js] or specify custom path with --config.","message":"v0.21.0 changed config loading to use cosmiconfig; old config file paths may not work.","severity":"breaking","affected_versions":">=0.21.0"},{"fix":"Upgrade to v0.21.2 or later to get correct exit codes.","message":"The tool may exit with code 0 even if fixes were applied; fixed in v0.21.2.","severity":"gotcha","affected_versions":"<0.21.2"},{"fix":"Check the list of supported resolvers in the default config; unsupported rules must be fixed manually.","message":"Some rules like indentation are not supported as resolvers; they remain as 0 in config.","severity":"gotcha","affected_versions":"all"},{"fix":"Use alternatives like stylelint --fix, Prettier, or sass formatter.","message":"The package has had no releases since 2020 and is considered unmaintained.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run npm install --save-dev sass-lint","cause":"sass-lint is a peer dependency and must be installed separately.","error":"Error: Cannot find module 'sass-lint'"},{"fix":"Ensure the pattern is correct and quoted. For example: sass-lint-auto-fix \"src/**/*.scss\"","cause":"The glob pattern does not match any files, or the pattern is incorrectly quoted.","error":"Error: No files matched pattern: \"**/*.s+(a|c)ss\""},{"fix":"Only lint .scss and .sass files; convert .css to .scss or use a different tool.","cause":"The input file has an extension other than .scss or .sass, e.g., .css.","error":"Error: Unsupported syntax - only scss and sass supported"},{"fix":"Upgrade to latest version (0.21.2) or isolate the file and disable the problematic resolver.","cause":"A bug in the rule resolver or an AST inconsistency; often occurs on edge cases with custom syntax.","error":"TypeError: Cannot read property 'remove' of undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}