{"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,"search_vec":"'2020':37 'also':93 'altern':75 'ast':22,63 'august':36 'auto':4 'automat':10 'cli':7 'commit':73 'common':12 'complement':43 'config':67 'conform':27 'current':33 'custom':66 'defin':30 'deprec':85,95 'differenti':56 'effect':94 'favor':87 'file':68 'fix':5,11,78 'gonzal':61 'gonzales-p':60 'hook':74 'huski':70 'issu':16,58 'javascript':96 'key':55 'lint':3,15,46,83 'make':90 'manipul':64 'modifi':24 'node':25 'note':80 'pars':18 'pe':62 'pre':72 'pre-commit':71 'prettier':79 'resolv':57 'rule':29 'sass':2,14,45,53,82 'sass-lint':13,44,81 'sass-lint-auto-fix':1 'sass-lint.yml':32 'sass/scss':19 'scss':51 'sinc':41 'stylelint':48,76,89 'support':50,65 'syntax':54 'tool':8,92 'updat':40 'v0.21.2':35 'via':59","created_at":"2026-05-01T17:45:56.494504+00:00","updated_at":"2026-05-01T17:45:56.494504+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"sass-lint-auto-fix","cli_version":null,"type":"library","homepage":null,"github":"https://github.com/srowhani/sass-lint-auto-fix","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/sass-lint-auto-fix","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops","testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}