Create .editorconfig for consistent coding styles
✓Works with OpenClaudeYou are a developer setting up project-wide code style consistency. The user wants to create a .editorconfig file that enforces uniform indentation, line endings, and formatting rules across all file types.
What to check first
- Verify your project root directory — .editorconfig must be placed there
- Check if your editor/IDE has EditorConfig plugin installed (most modern editors support it natively)
- Run
ls -la | grep editorconfigto confirm no .editorconfig file already exists
Steps
- Create a .editorconfig file in your project root using
touch .editorconfig - Define the root property with
root = trueto signal this is the top-level config (prevents searching parent directories) - Add a wildcard section
[*]for all files with base rules: charset, end_of_line, insert_final_newline, trim_trailing_whitespace - Add language-specific sections:
[*.js],[*.py],[*.json]with indent_size matching each language convention - Set indent_style to either
spaceortab— spaces are standard for most projects (2 or 4 spaces typical) - Add a
[*.md]section and settrim_trailing_whitespace = false(markdown requires double-space line breaks) - Include
[Makefile]section withindent_style = tab(Makefiles require tabs, not spaces) - Commit .editorconfig to version control so the entire team uses identical rules
Code
# EditorConfig helps maintain consistent coding styles
# across multiple developers and editors
# See https://editorconfig.org for documentation
root = true
# All files
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
# JavaScript/TypeScript
[*.{js,jsx,ts,tsx}]
indent_style = space
indent_size = 2
max_line_length = 100
# Python
[*.py]
indent_style = space
indent_size = 4
max_line_length = 88
# JSON
[*.{json,jsonc}]
indent_style = space
indent_size = 2
# YAML
[*.{yml,yaml}]
indent_style = space
indent_size = 2
# Markdown
[*.md]
indent_style = space
indent_size = 2
trim_trailing_whitespace = false
# Shell scripts
[*.{sh,bash}]
indent_style = space
indent_size = 2
end_of_line = lf
# Makefiles (MUST use tabs)
[Makefile]
indent_style = tab
# CSS/SCSS
[*.{css,scss,less}]
indent_style = space
indent_size = 2
# HTML
[*.{html,htm}]
indent_style = space
indent_
Note: this example was truncated in the source. See the GitHub repo for the latest full version.
Common Pitfalls
- Treating this skill as a one-shot solution — most workflows need iteration and verification
- Skipping the verification steps — you don't know it worked until you measure
- Applying this skill without understanding the underlying problem — read the related docs first
When NOT to Use This Skill
- When a simpler manual approach would take less than 10 minutes
- On critical production systems without testing in staging first
- When you don't have permission or authorization to make these changes
How to Verify It Worked
- Run the verification steps documented above
- Compare the output against your expected baseline
- Check logs for any warnings or errors — silent failures are the worst kind
Production Considerations
- Test in staging before deploying to production
- Have a rollback plan — every change should be reversible
- Monitor the affected systems for at least 24 hours after the change
Related Scaffolding Skills
Other Claude Code skills in the same category — free to download.
Next.js Starter
Scaffold Next.js project with common setup
Express Starter
Scaffold Express.js project with structure
React Starter
Scaffold React project with Vite
TypeScript Config
Set up TypeScript configuration
ESLint Config
Configure ESLint with custom rules
Prettier Config
Set up Prettier configuration
Monorepo Setup
Set up monorepo with Turborepo/Nx
Jest Config
Configure Jest testing framework
Want a Scaffolding skill personalized to YOUR project?
This is a generic skill that works for everyone. Our AI can generate one tailored to your exact tech stack, naming conventions, folder structure, and coding patterns — with 3x more detail.