DEV Community

Cover image for Use this NPM script to create your EditorConfig files
Douglas Moura
Douglas Moura

Posted on • Edited on • Originally published at douglasmoura.dev

2 2

Use this NPM script to create your EditorConfig files

Have you ever needed to create an EditorConfig to your programming projects but can never remember all the options you can use? Worry no more: just type npx create-editorconfig -y in your terminal and have one generated for you. Those are the default options:

# editorconfig.org
root = true

[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
Enter fullscreen mode Exit fullscreen mode

If you want to customize the settings or even add more for a different set of files (by defining a glob pattern), just ommit the -y argument in the terminal and answer the prompted questions.

What is EditorConfig?

EditorConfig is a configuration file (the .editorconfig) that defines the coding styles that a given code editor (such as VS Code) should apply in the files. You can even set a different set of rules for the files of your project according to your their extension or directory, by using a glob pattern.

My code editor is not applying the EditorConfig settings

To apply your .editorconfig rules, your code editor should have a plugin or have EditorConfig rule parsing implemented natively (if you are using VS Code, you must install this extension.

EditorConfig extension on VS Code Marketplace

How can I contribute to create-editorconfig?

Please, go to the official GitHub repository and open an issue.

Image of Timescale

🚀 pgai Vectorizer: SQLAlchemy and LiteLLM Make Vector Search Simple

We built pgai Vectorizer to simplify embedding management for AI applications—without needing a separate database or complex infrastructure. Since launch, developers have created over 3,000 vectorizers on Timescale Cloud, with many more self-hosted.

Read more →

Top comments (0)

Sentry image

See why 4M developers consider Sentry, “not bad.”

Fixing code doesn’t have to be the worst part of your day. Learn how Sentry can help.

Learn more