{"id":27013,"library":"git-style-lint","title":"git-style-lint","description":"A tool that runs stylelint (currently for *.scss files) only on changed lines in a git repository, designed for pre-commit hooks. Version 1.1.14 requires Node.js v8.x or higher, with version for 6.x in progress. It differs from full-file linters by focusing only on modified lines, providing faster feedback in pre-commit workflows, and is specifically tailored for SCSS files.","status":"active","version":"1.1.14","language":"javascript","source_language":"en","source_url":null,"tags":["javascript","lint","stylelint","pre-commit","git","scss"],"install":[{"cmd":"npm install git-style-lint","lang":"bash","label":"npm"},{"cmd":"yarn add git-style-lint","lang":"bash","label":"yarn"},{"cmd":"pnpm add git-style-lint","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"linting engine for SCSS","package":"stylelint","optional":false},{"reason":"git commands to detect changed lines","package":"git","optional":true}],"imports":[{"note":"Package provides a default export function; CJS require works but ESM recommended for Node >=12","wrong":"const gitStyleLint = require('git-style-lint')","symbol":"default","correct":"import gitStyleLint from 'git-style-lint'"},{"note":"Named export for linting staged files; available in ESM and CJS","wrong":null,"symbol":"lintStaged","correct":"import { lintStaged } from 'git-style-lint'"},{"note":"Utility to get changed lines from git diff; internal but exported","wrong":null,"symbol":"getChangedLines","correct":"import { getChangedLines } from 'git-style-lint'"},{"note":"Options is a TypeScript type; use type import to avoid runtime error","wrong":"import { Options } from 'git-style-lint'","symbol":"type Options","correct":"import type { Options } from 'git-style-lint'"}],"quickstart":{"code":"import gitStyleLint from 'git-style-lint';\nimport stylelint from 'stylelint';\n\nconst result = await gitStyleLint({\n  files: ['src/**/*.scss'],\n  linter: stylelint.lint,\n  config: {\n    extends: 'stylelint-config-standard-scss'\n  }\n});\n\nconsole.log('Lint results:', result);","lang":"typescript","description":"Shows basic usage: import package, configure with stylelint, lint changed lines in SCSS files."},"warnings":[{"fix":"Upgrade Node.js to v8 or higher.","message":"Requires Node.js v8+; earlier versions unsupported.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Ensure files are .scss or extend package to support other formats.","message":"Only supports *.scss files currently, not CSS or other preprocessors.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use Node.js >=8.","message":"Version for Node.js v6.x was planned but never released; use v8+.","severity":"deprecated","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":"npm install stylelint --save-dev","cause":"stylelint not installed as a peer dependency","error":"Error: Cannot find module 'stylelint'"},{"fix":"Use CommonJS: const gitStyleLint = require('git-style-lint') or upgrade Node.","cause":"Node.js version <8 doesn't support ES modules","error":"SyntaxError: Unexpected token import"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}