@sheplu/editorconfig
v0.8.5
Published
A small CLI to manage a **consistent `.editorconfig`** across your projects.
Downloads
41
Maintainers
Readme
editorconfig
A small CLI to manage a consistent .editorconfig across your projects.
- ✅ Generate a sane default
.editorconfigin seconds - ✅ Check if your existing file matches the target setup
- 🔜 Propose updates (with confirmation) instead of blindly overwriting
- 🔜 Compare your file against the recommended template
Why?
Keeping .editorconfig aligned across multiple repositories is boring and error-prone:
- Some repos have no
.editorconfig - Some have outdated or partial settings
- People copy–paste from “somewhere” and drift over time
This CLI aims to provide a single source of truth for your preferred .editorconfig, and a few helpers to keep it in sync.
Installation
You can use it without installing, via npx:
npx @sheplu/editorconfig --mode=writeOr install it globally:
npm install -g @sheplu/editorconfig
editorconfigOr as a dev dependency:
npm install -D @sheplu/editorconfigQuick Start
From the root of your project:
npx @sheplu/editorconfig --mode=writeThis will:
- Create a
.editorconfigfile if it doesn’t exist - (Current behavior) Write the default template
- (Future behavior) Ask before overwriting an existing file
Current Features
write
npx @sheplu/editorconfig --mode=writeCreates a base .editorconfig file in the current directory.
Typical content (example):
root = true
[*]
indent_style = tab
indent_size = 4
tab_width = 4
end_of_line = lf
charset = utf-8
spelling_language = en
trim_trailing_whitespace = true
insert_final_newline = true
quote_type = single
spaces_around_operators = truecheck
npx @sheplu/editorconfig --mode=checkValidates your existing .editorconfig and reports any drift from the target configuration.
This command will:
- Read your existing .editorconfig
- Compare it against the tool’s canonical template
- Exit with:
0if everything matches1if differences are found
Planned / Upcoming Features
1. Interactive update / replace
npx @sheplu/editorconfig --mode=fix2. Compare with target setup
npx @sheplu/editorconfig --mode=diffRoadmap
- [ ] Add diff logic and
diffcommand - [ ] Add interactive
fix/updatecommand - [ ] Expose presets or configuration options
- [ ] Add tests and CI examples
Additional properties can be found on the editorconfig wiki.
