@igorskyflyer/editorconfig
v1.0.0
Published
✍🏼 A CLI tool for adding an opinionated EditorConfig to any project. 🐭
Maintainers
Readme
Table of Contents
- ✨ Features
- 🕵🏼 Usage
- ⚙️ Implementation
- 🎯 Motivation
- 📝 Changelog
- 🪪 License
- 💖 Support
- 🧬 Related
- 👨🏻💻 Author
Features
- 🎨 Copies
.editorconfiginto the current project instantly - ⚠️ Detects existing
.editorconfigand prompts before overwriting - ⏭️ Skips safely on declined overwrite - no
destructivechanges - ✅ Clear success and error
feedbackfor every outcome - 🛡️ Zero dependencies - pure
Node.jsbuilt-ins only
Usage
Run it directly without installing:
npx @igorskyflyer/editorconfigOr install globally:
pnpm add -g @igorskyflyer/editorconfig
npm i -g @igorskyflyer/editorconfig
yarn global add @igorskyflyer/editorconfigThen run:
editorconfigAdding .editorconfig to a fresh project:
✅ .editorconfig added to the project!Running in a project that already has .editorconfig:
⚠️ .editorconfig already exists. Overwrite? (y/N) Accepting the overwrite:
✅ .editorconfig updated successfully!Declining the overwrite:
⏭️ Skipped.Implementation
The CLI resolves two paths at runtime:
- source - the
.editorconfigbundled inside the package - destination - the current working directory (
process.cwd())
If no .editorconfig exists at the destination, it is copied instantly. If one already exists, an overwrite prompt is shown before any changes are made. All errors are caught and displayed with a non-zero exit code, ensuring shell scripts and CI pipelines can detect failures.
Configuration Decisions
end_of_line = lf- Unix line endings are the cross-platform standard for source code. Git, Linux, and macOS all default toLF, and most tooling (ESLint, Prettier, Biome) expects it.*.{bat,cmd,ps1} = crlf- Windows scripting formats requireCRLF. The Windows script host and some parsers behave unexpectedly withLF-only line endings in these files.*.sh = lf- Shell scripts break onCRLF. The Unix shebang line (#!/bin/bash) must beLF-terminated or the interpreter fails to parse it.*.go = tab-gofmtenforces tabs. Fighting it is futile and breaks the whole Go toolchain.trim_trailing_whitespace = falsefor*.md- Markdown uses trailing spaces as intentional line breaks (\n). Trimming them silently breaks formatting.insert_final_newline = true- POSIX defines a text file as ending with a newline. Omitting it causes noisy diffs and warnings in many tools.
Motivation
Manually copying .editorconfig across projects is repetitive and error-prone. A shared, versioned config ensures every project stays consistent - one update propagates everywhere, just like all packages of the @igorskyflyer ecosystem do!
Changelog
Read about the latest changes in the CHANGELOG.
License
Licensed under the MIT license.
Support
Related
🧰 Determines whether a given value can be a valid file/directory name. 🏜
@igorskyflyer/windows-packages
💻 A package for reading the Packages registry key on Windows 10+. Useful for retrieving Windows 10+ installed Store applications. 📦
@igorskyflyer/astro-render-component
🤖 Astro component renderer. Zero configuration. Produces clean HTML strings directly in Node.js without any DOM environment. 🐬
🌟 A package that strongly types file paths! 🥊
🔦 Provides frequently used types for your TypeScript projects. 🦄
Author
Created by Igor Dimitrijević (@igorskyflyer).
