Registry / devops / lint-only

lint-only

JSON →
library0.1.0jsnpmunverified

A small utility (v0.1.0) that runs linting (e.g., ESLint) only on lines changed since a git baseline, saving time on large codebases. Released as an early alpha with occasional updates. Differentiates from other lint-staged tools by focusing only on changed lines rather than changed files, reducing noise and false positives. Currently limited to ESLint and git-based projects.

npm install lint-only
INSTALL
IMPORT
SIG · LINT-ONLY
L
lint-only
devopsjavascriptv0.1.0
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 lintOnly from 'lint-only'
const lintOnly = require('lint-only')
Package is ESM-only; no default export in CJS.
runLintOnChangedLines
import { runLintOnChangedLines } from 'lint-only'
const { runLintOnChangedLines } = require('lint-only')
Named export is also ESM-only.
LintOnlyConfig
import type { LintOnlyConfig } from 'lint-only'
const { LintOnlyConfig } = require('lint-only')
Type-only import for TypeScript usage.

Runs ESLint only on lines changed since HEAD~1, returning matched errors.

import lintOnly from 'lint-only'; const result = await lintOnly({ eslintConfig: { extends: ['eslint:recommended'], rules: { 'no-console': 'error' } }, gitRef: 'HEAD~1', // compare against previous commit files: ['src/**/*.js'], }); console.log(result); // { changedLines: [...], errors: [...] }
Debug
Known issues
gotchaPackage expects git repository root as cwd; otherwise throws an unclear error.
fix
Run from repo root or set cwd option correctly.
affects: 0.1.0
breakingv0.1.0 does not support CJS require; only ESM imports work.
fix
Use ES modules (type: 'module' in package.json or .mjs extension).
affects: 0.1.0
deprecatedold configuration key 'eslintRc' deprecated in favor of 'eslintConfig'.
fix
Rename 'eslintRc' to 'eslintConfig'.
affects: <0.1.0
gotchaRequires ESLint as a peer dependency; missing ESLint leads to runtime error.
fix
Install ESLint as a project dependency.
affects: 0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'eslint'
Missing peer dependency 'eslint'.
fix
npm install eslint --save-dev
TypeError: lintOnly is not a function
Using CommonJS require instead of ESM import.
fix
Use import lintOnly from 'lint-only'; or convert to ES module.
Error: Not a git repository or any parent of it
Command executed outside of a git repository.
fix
Ensure the current working directory is inside a git repository.
Upgrade
Version history
0.1.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency — linting engine required for core functionality
Agent activity
4 hits · last 30 days
node
4
Resources
lint-only — npm install lint-only · libregistry