Registry / testing / git-style-lint

git-style-lint

JSON →
library1.1.14jsnpmunverified

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.

npm install git-style-lint
INSTALL
IMPORT
SIG · GIT-STYLE-LINT
G
git-style-lint
testingjavascriptv1.1.14
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import gitStyleLint from 'git-style-lint'
const gitStyleLint = require('git-style-lint')
Package provides a default export function; CJS require works but ESM recommended for Node >=12
lintStaged
import { lintStaged } from 'git-style-lint'
Named export for linting staged files; available in ESM and CJS
getChangedLines
import { getChangedLines } from 'git-style-lint'
Utility to get changed lines from git diff; internal but exported
type Options
import type { Options } from 'git-style-lint'
import { Options } from 'git-style-lint'
Options is a TypeScript type; use type import to avoid runtime error

Shows basic usage: import package, configure with stylelint, lint changed lines in SCSS files.

import gitStyleLint from 'git-style-lint'; import stylelint from 'stylelint'; const result = await gitStyleLint({ files: ['src/**/*.scss'], linter: stylelint.lint, config: { extends: 'stylelint-config-standard-scss' } }); console.log('Lint results:', result);
git-style-lint --version
Debug
Known issues
breakingRequires Node.js v8+; earlier versions unsupported.
fix
Upgrade Node.js to v8 or higher.
affects: >=1.0.0
gotchaOnly supports *.scss files currently, not CSS or other preprocessors.
fix
Ensure files are .scss or extend package to support other formats.
affects: >=1.0.0
deprecatedVersion for Node.js v6.x was planned but never released; use v8+.
fix
Use Node.js >=8.
affects: >=1.0.0
Errors
Common errors & fixes
Error: Cannot find module 'stylelint'
stylelint not installed as a peer dependency
fix
npm install stylelint --save-dev
SyntaxError: Unexpected token import
Node.js version <8 doesn't support ES modules
fix
Use CommonJS: const gitStyleLint = require('git-style-lint') or upgrade Node.
Upgrade
Version history
1.1.14latest on npm
Audit
Dependencies
stylelintrequiredlinting engine for SCSS
gitoptionalgit commands to detect changed lines
Agent activity
2 hits · last 30 days
node
2
Resources
git-style-lint — npm install git-style-lint · libregistry