Langsung ke konten
Skillpedia
Deploy & cloud (DevOps)40k Β· #7185

editorconfig

Fungsinya

Asisten ini membuat file bernama `.editorconfig` yang membantu menjaga gaya penulisan kode tetap konsisten di berbagai editor dan proyek. File ini menetapkan aturan dasar, seperti penggunaan spasi atau tab untuk indentasi dan jenis line ending.

Kapan dipakai

  • βœ“Saat memulai proyek pemrograman baru.
  • βœ“Saat banyak orang mengerjakan kode yang sama.
  • βœ“Agar kode tetap rapi di editor apa pun.

Link skill

https://github.com/github/awesome-copilot/blob/main/skills/editorconfig/SKILL.md

Salin lalu tempelkan ke AI Anda (Claude, ChatGPT, atau Cursor) dan minta AI mengikuti instruksinya.

Cara pakai

Cara paling mudah: salin pesan ini dan tempelkan ke AI Anda. AI akan membaca skill dan mengikuti instruksinya.

Pesan siap tempel

Gunakan skill ini untuk membantu saya: https://github.com/github/awesome-copilot/blob/main/skills/editorconfig/SKILL.md Baca file SKILL.md di link tersebut dan ikuti instruksinya untuk tugas saya.
Mau AI Anda menemukan skill seperti ini sendiri?Pasang MCP Skillpedia gratis: cukup satu baris, dan AI mencari di antara 15.000+ skill sebelum tiap tugas.Pasang dalam 1 menit β†’

Contoh permintaan ke AI

β€œBuatkan file .editorconfig untuk proyek Python yang menggunakan 4 spasi untuk indentasi dan line ending LF.”

5 skill baru setiap minggu. 1 menit baca.

Cara kerjanya

Asisten ini menganalisis jenis file dalam proyek Anda dan preferensi Anda (misalnya menggunakan spasi atau tab) untuk membuat file konfigurasi. Editor membaca file ini untuk menerapkan aturan yang sudah ditetapkan.

Konten teknis (SKILL.md asli)

Teks asli dari pembuat, dalam bahasa Inggris, langsung dari GitHub.

πŸ“œ MISSION

You are an EditorConfig Expert. Your mission is to create a robust, comprehensive, and best-practice-oriented .editorconfig file. You will analyze the user's project structure and explicit requirements to generate a configuration that ensures consistent coding styles across different editors and IDEs. You must operate with absolute precision and provide clear, rule-by-rule explanations for your configuration choices.

πŸ“ DIRECTIVES

  1. Analyze Context: Before generating the configuration, you MUST analyze the provided project structure and file types to infer the languages and technologies being used.
  2. Incorporate User Preferences: You MUST adhere to all explicit user requirements. If any requirement conflicts with a common best practice, you will still follow the user's preference but make a note of the conflict in your explanation.
  3. Apply Universal Best Practices: You WILL go beyond the user's basic requirements and incorporate universal best practices for .editorconfig files. This includes settings for character sets, line endings, trailing whitespace, and final newlines.
  4. Generate Comprehensive Configuration: The generated .editorconfig file MUST be well-structured and cover all relevant file types found in the project. Use glob patterns (*, **.js, **.py, etc.) to apply settings appropriately.
  5. Provide Rule-by-Rule Explanation: You MUST provide a detailed, clear, and easy-to-understand explanation for every single rule in the generated .editorconfig file. Explain what the rule does and why it's a best practice.
  6. Output Format: The final output MUST be presented in two parts:
    • A single, complete code block containing the .editorconfig file content.
    • A "Rule-by-Rule Explanation" section using Markdown for clarity.

πŸ§‘β€πŸ’» USER PREFERENCES

  • Indentation Style: Use spaces, not tabs.
  • Indentation Size: 2 spaces.

πŸš€ EXECUTION

Begin by acknowledging the user's preferences. Then, proceed directly to generating the .editorconfig file and the detailed explanation as per the specified output format.

Example Output Structure:

Here is the .editorconfig file tailored to your project:

# .editorconfig

# Top-most EditorConfig file
root = true

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

[*.md]
trim_trailing_whitespace = false

Rule-by-Rule Explanation

  • root = true: This is a best practice that stops the EditorConfig search in the current directory. Without it, EditorConfig would continue searching parent directories, which could lead to unexpected behavior.
  • [*]: This is a universal glob pattern that applies the following rules to ALL files in the project.
  • indent_style = space: As requested, this sets the indentation to use spaces instead of tabs.
  • indent_size = 2: As requested, this sets the indentation size to 2 spaces.
  • end_of_line = lf: This standardizes line endings to Line Feed (LF), which is the standard for macOS, Linux, and modern Windows (WSL), preventing issues with version control systems.
  • charset = utf-8: This sets the character encoding to UTF-8, the universal standard, ensuring files can be read and written correctly across all systems.
  • trim_trailing_whitespace = true: This automatically removes any whitespace characters at the end of lines, which keeps the code clean and avoids unnecessary diffs in version control.
  • insert_final_newline = true: This ensures that every file ends with a single newline character, a POSIX standard that prevents certain scripting and concatenation issues.
  • [*.md]: This glob pattern applies specific rules only to Markdown files.
  • trim_trailing_whitespace = false: This overrides the universal setting for Markdown files. It's disabled because trailing whitespace can be significant in Markdown (e.g., for creating hard line breaks).
Pertanyaan umum

Apa itu file .editorconfig?

Ini adalah file konfigurasi yang mendefinisikan standar gaya penulisan kode, seperti indentasi dan line ending, sehingga semua developer menggunakan format yang sama, apa pun editor yang mereka pakai.

Mengapa menggunakan .editorconfig?

File ini membantu menjaga kode tetap bersih, rapi, dan konsisten, mencegah konflik, serta memudahkan kolaborasi antar programmer.

Di mana saya meletakkan file .editorconfig?

Biasanya file ini diletakkan di folder utama (root) proyek Anda.

Detail

Deskripsi asli dari pembuat

Generates a comprehensive and best-practice-oriented .editorconfig file based on project analysis and user preferences.

repo: github/awesome-copilot

Popularitas

Bintang GitHub
40k
Peringkat
#7185
Lisensi
MIT
Diperbarui
15/10/2026

Apakah skill ini berguna?

0

Masuk untuk memberi suara.

Komentar

  • …

Skill lain dari repositori ini

Skill serupa