sass-lint-vue

raw JSON →
0.4.0 verified Fri May 01 auth: no javascript maintenance

Command line tool to lint Sass/SCSS styles inside Vue single file components by extracting <style> blocks and feeding them to sass-lint. Version 0.4.0 is the latest stable release (last updated 2017). No longer actively maintained; users should migrate to stylelint with stylelint-scss and Vue-specific plugins. Key differentiator: leverages the legacy sass-lint engine, which is deprecated in favor of stylelint.

error Error: Cannot find module 'sass-lint'
cause Missing peer dependency; sass-lint-vue does not install it automatically.
fix
Run 'npm install sass-lint' alongside sass-lint-vue.
error Error: No configuration found. Please create a .sass-lint.yml file.
cause sass-lint requires an explicit config file even for defaults.
fix
Create .sass-lint.yml in project root with at least 'options: {}'.
error SyntaxError: Unexpected token import (while requiring sass-lint-vue)
cause Trying to use ESM import on a CommonJS-only module.
fix
Replace 'import ...' with 'const ... = require(...)'.
error Error: ENOENT: no such file or directory, scandir 'node_modules/node-sass'
cause sass-lint depends on node-sass which requires native compilation; may fail on newer Node.
fix
Use Node.js 10 or 8, or switch to stylelint.
deprecated Package is unmaintained since 2017; sass-lint itself is deprecated.
fix Migrate to stylelint + stylelint-scss and @stylelint/vue-syntax.
breaking Requires Node.js <12; newer Node versions may fail to install due to native module dependencies of sass-lint.
fix Use Node 10 or lower, or switch to a modern linter like stylelint.
gotcha Only lints <style lang="scss"> or <style lang="sass"> blocks; plain <style> (CSS) is ignored.
fix Ensure your Vue components use lang="scss" or lang="sass". For plain CSS, use stylelint directly.
gotcha Does not support Vue single file components with multiple <style> blocks; only first one is linted.
fix Combine all styles into one <style> block per component, or use stylelint.
deprecated sass-lint configuration (.sass-lint.yml) is different from stylelint; no migration path provided.
fix Rewrite rules using stylelint-scss conventions.
npm install sass-lint-vue
yarn add sass-lint-vue
pnpm add sass-lint-vue

Shows CLI usage and programmatic API for linting Sass in Vue components.

// Install: npm install sass-lint-vue
// Create .sass-lint.yml (sass-lint config)
// Run CLI on a .vue file:
// npx sass-lint-vue components/MyComponent.vue

// Programmatic usage:
const { lintFiles } = require('sass-lint-vue');
const results = lintFiles('src/**/*.vue');
console.log(results);