lint-staged-editorconfig

raw JSON →
0.1.0 verified Fri May 01 auth: no javascript

A lint-staged plugin that validates staged files are covered by .editorconfig rules. v0.1.0 is the only release (April 2020). It runs against all staged files and fails if any file is not matched by an editorconfig rule. Helps enforce consistent editor settings across a team. Alternative: manually checking editorconfig coverage, but this automates it as part of git hooks.

error No staged files match any editorconfig rule
cause Staged file is not covered by any pattern in .editorconfig or is excluded in .editorconfigignore
fix
Add a matching section to .editorconfig or add the file pattern to .editorconfigignore.
error Cannot find module 'lint-staged-editorconfig'
cause Package not installed or not in node_modules
fix
Install with 'yarn add -D lint-staged-editorconfig' or 'npm install --save-dev lint-staged-editorconfig'.
error lint-staged-editorconfig: .editorconfig file not found
cause No .editorconfig file in project root
fix
Create a .editorconfig file with at least one rule.
gotcha No files are excluded by default; if no .editorconfigignore exists, ALL staged files must match an editorconfig rule.
fix Create an .editorconfigignore file with patterns like 'vendor/' to ignore directories.
gotcha Package has not been updated since April 2020; may have compatibility issues with newer lint-staged or editorconfig packages.
fix Check node_modules for peer dependency conflicts; consider forking or alternatives.
deprecated The 'editorconfig' npm package (used as a dependency) may have breaking changes in future major versions.
fix Lock the 'editorconfig' version to 0.x to avoid breaking changes.
npm install lint-staged-editorconfig
yarn add lint-staged-editorconfig
pnpm add lint-staged-editorconfig

Configure lint-staged to run editorconfig checker on all staged files.

// .lintstagedrc.js or package.json lint-staged config
module.exports = {
  '*': 'lint-staged-editorconfig'
}