
Editorconfig
- 98 installs
- 2 repo stars
- Updated August 3, 2026
- fandhe-ai/agent-reference-skills
Helps with ai & agent building tasks.
About
editorconfig is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.
- editorconfig
- AI & Agent Building
- AI-coding skill
Editorconfig by the numbers
- 98 all-time installs (skills.sh)
- Ranked #4,439 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
- Data as of Aug 3, 2026 (Skillselion catalog sync)
npx skills add https://github.com/fandhe-ai/agent-reference-skills --skill editorconfigAdd your badge
Show developers this skill is listed on Skillselion. Paste this into your README.
| Installs | 98 |
|---|---|
| repo stars | ★ 2 |
| Last updated | August 3, 2026 |
| Repository | fandhe-ai/agent-reference-skills ↗ |
What it does
Helps with ai & agent building tasks.
Files
EditorConfig リファレンス
EditorConfig ファイルフォーマットの全ドキュメントを網羅したスキル。 ユーザーのタスクに応じて適切なリファレンスファイルを読むこと。
ディレクトリ構成
skills/editorconfig/
SKILL.md
references/
README.md
specification.md
properties.md
glob-patterns.md
best-practices.md
samples/
README.md
basic-setup.md
web-project.md
python-project.md
go-project.md
multi-language-project.md
nested-editorconfig.md
unset-override.md
glob-patterns.md
scripts/
README.md
install.md
cli.md
validate.md
generate.md
editor-plugins.md探索手順
タスクからカテゴリを引き、カテゴリの README.md で目的のページを特定する:
1. 下記マッピング表でタスクに対応するカテゴリを探す 2. そのカテゴリの README.md を参照して目的のページを特定する 3. 該当ページの .md を Read して詳細を確認する
タスク → カテゴリ マッピング
| タスク | カテゴリ | 参照 README |
|---|---|---|
| プロパティの意味・値・設定方法を知りたい | references | references/README.md |
| ファイルマッチングパターン・ワイルドカードを知りたい | references | references/README.md |
| ファイル検索順・優先順位・パース仕様を知りたい | references | references/README.md |
| よくある設定例・FAQ・ベストプラクティスを知りたい | references | references/README.md |
| 典型的な .editorconfig の使い方・プロジェクト別設定例を知りたい | samples | samples/README.md |
| インストール・CLI コマンド・バリデーション方法を知りたい | scripts | scripts/README.md |
EditorConfig ベストプラクティス
.editorconfig の設定例、FAQ、よくあるパターン。
基本的な設定例
# プロジェクトルート
root = true
# デフォルト設定(全ファイル)
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 2言語別の設定パターン
Web 開発(JavaScript / TypeScript)
root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false
[Makefile]
indent_style = tabPython
root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
[*.py]
indent_style = space
indent_size = 4
[*.{yml,yaml}]
indent_style = space
indent_size = 2
[Makefile]
indent_style = tabGo
root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
[*.go]
indent_style = tab
indent_size = 4
[*.{yml,yaml,json}]
indent_style = space
indent_size = 2
[Makefile]
indent_style = tabJava / Kotlin
root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 4
[*.{xml,gradle,kts}]
indent_size = 4
[*.{yml,yaml,json}]
indent_size = 2
[Makefile]
indent_style = tabよくあるパターン
Markdown の末尾空白を保持
Markdown では行末の2つのスペースが改行を意味するため、trim_trailing_whitespace を無効にする。
[*.md]
trim_trailing_whitespace = falseMakefile はタブ必須
Makefile のレシピ行はハードタブが必須。
[Makefile]
indent_style = tab特定プロパティの無効化
unset を使ってプロパティの効果を打ち消し、エディタのデフォルトに戻す。
[*.generated.*]
indent_size = unset
indent_style = unset複数ファイルタイプをまとめて設定
波括弧で複数の拡張子をグループ化できる。
[*.{json,yml,yaml,toml}]
indent_style = space
indent_size = 2
[*.{ts,tsx,js,jsx}]
indent_style = space
indent_size = 2FAQ
Q: EditorConfig は既存ファイルを自動リフォーマットする?
A: しない。 EditorConfig プラグインは新しく入力された行にのみ設定を適用する。既存コードのリフォーマットには別ツール(eclint, editorconfig-checker 等)が必要。
Q: EditorConfig とフォーマッター(Prettier, Biome 等)は競合する?
A: 通常は競合しない。 多くのフォーマッターは .editorconfig を自動で読み取る。Prettier は indent_style, indent_size, end_of_line を .editorconfig から取得する。設定が異なる場合はフォーマッター側の設定が優先されることがある。
Q: .editorconfig を CI で検証するには?
A: 以下のツールが利用可能:
- editorconfig-checker — 最も広く使われている検証ツール
- eclint — EditorConfig ルールに基づくリンター
- editorconfig-maven-plugin — Maven プロジェクト向け
- editorconfig-gradle-plugin — Gradle プロジェクト向け
Q: Windows で .editorconfig ファイルを作成するには?
A: エクスプローラーで .editorconfig.(末尾にドット)を入力すると、自動的に .editorconfig にリネームされる。
Q: indent_size = tab とは?
A: indent_size を tab_width の値と同じにする特殊値。tab_width が未指定の場合はエディタのデフォルトタブ幅が使用される。
関連
- specification — 正式仕様
- properties — 全プロパティ詳細
- glob-patterns — グロブパターン
EditorConfig グロブパターン
.editorconfig のセクション名で使用するグロブ(ワイルドカード)パターンの仕様。
特殊文字一覧
| 文字 | 説明 |
|---|---|
* | パス区切り(/)以外 の任意の文字列にマッチ |
** | パス区切りを 含む 任意の文字列にマッチ |
? | パス区切り(/)以外 の任意の1文字にマッチ |
[seq] | seq 内の任意の1文字にマッチ |
[!seq] | seq 内に 含まれない 任意の1文字にマッチ |
{s1,s2,s3} | 列挙された文字列のいずれかにマッチ(ネスト可能) |
{num1..num2} | num1 〜 num2 の範囲の整数にマッチ(正負両対応) |
\ | 次の文字のエスケープ(特殊文字を文字通りに扱う) |
パス区切りルール
/ を含まないパターン
.editorconfig が配置されたディレクトリ およびその全サブディレクトリ でマッチする。
# *.js → 全サブディレクトリの .js ファイルにマッチ
[*.js]
indent_size = 2/ を含むパターン
.editorconfig が配置されたディレクトリを基準とした 相対パス としてマッチする。
# src/ 直下の .ts ファイルのみ
[src/*.ts]
indent_size = 2
# src/ 配下の全 .ts ファイル(サブディレクトリ含む)
[src/**.ts]
indent_size = 2先頭の /
パターン中間に既に / がある場合、先頭の / は冗長。以下は同じ結果になる:
[subdir/*.c]
[/subdir/*.c]末尾の /
末尾が / で終わるセクション名は どのファイルにもマッチしない。
実用例
ファイル拡張子でマッチ
# すべての JavaScript ファイル
[*.js]
# すべての TypeScript ファイル(.ts と .tsx)
[*.{ts,tsx}]
# すべての画像ファイル
[*.{png,jpg,gif,svg}]特定ファイル名でマッチ
# Makefile(拡張子なし)
[Makefile]
# package.json
[package.json]
# 複数の特定ファイル
[{package.json,tsconfig.json,.prettierrc}]ディレクトリでマッチ
# lib ディレクトリ直下のファイル
[lib/*]
# lib 配下の全ファイル(再帰)
[lib/**]
# src 配下の全 .ts ファイル(再帰)
[src/**.ts]数値範囲でマッチ
# 数字付きファイル(01〜12)
[file{1..12}.txt]文字クラスでマッチ
# a, b, c のいずれかで始まるファイル
[[abc]*.txt]
# 数字で始まらないファイル
[[!0-9]*.txt]波括弧の注意点
{s1}(要素1つ)はリテラルとしてマッチ(展開されない){num1..num2}ではnum1 < num2が必要(正負両対応)- 有効例:
{1..3},{-1..4} - 無効例:
{-4..-5}(降順のため無効),{3..1}(降順のため無効) - ネスト可能:
{*.{js,ts},Makefile}
セクション名の長さ制約
- EditorConfig コアは 1024 文字 までのセクション名を受理する必要がある
- それ以上は実装依存
関連
- specification — ファイルフォーマット仕様
- properties — 全プロパティ詳細
- best-practices — 設定例
EditorConfig プロパティ
EditorConfig で使用可能な全プロパティの詳細。
universally supported プロパティ
全エディタプラグインでサポートされるプロパティ。
root
| 項目 | 値 |
|---|---|
| 値 | true |
| 配置 | プリアンブルのみ(セクション外) |
| 説明 | true に設定すると、それ以上親ディレクトリの .editorconfig を検索しない |
# これ以上上位を検索しない
root = trueindent_style
| 項目 | 値 |
|---|---|
| 値 | tab, space |
| 説明 | インデントスタイル。tab はハードタブ、space はソフトタブ |
tab の場合、可能な限りハードタブで埋め、残りをスペースで埋める。
indent_size
| 項目 | 値 |
|---|---|
| 値 | 正の整数、または tab |
| 説明 | インデント1レベルあたりの列数、およびソフトタブの幅 |
tabに設定した場合、tab_widthの値が使用される(tab_width未指定ならエディタのデフォルト)
tab_width
| 項目 | 値 |
|---|---|
| 値 | 正の整数 |
| デフォルト | indent_size の値 |
| 説明 | タブ文字の表示幅(列数) |
通常は indent_size から自動設定されるため、明示的な指定は不要な場合が多い。
end_of_line
| 項目 | 値 |
|---|---|
| 値 | lf, cr, crlf |
| 説明 | 改行コード |
| 値 | 改行コード | 主な使用 OS |
|---|---|---|
lf | \n | Linux, macOS |
cr | \r | 旧 Mac OS |
crlf | \r\n | Windows |
charset
| 項目 | 値 |
|---|---|
| 値 | latin1, utf-8, utf-8-bom, utf-16be, utf-16le |
| 説明 | ファイルの文字エンコーディング |
utf-8-bom の使用は非推奨。
trim_trailing_whitespace
| 項目 | 値 |
|---|---|
| 値 | true, false |
| 説明 | true で改行前の末尾空白を除去 |
適用タイミング
- ファイルオープン時: 適用しない
- ファイル保存時: エディタ組み込み設定を適用
insert_final_newline
| 項目 | 値 |
|---|---|
| 値 | true, false |
| 説明 | true でファイル末尾に改行を保証、false で改行がないことを保証 |
適用タイミング
- ファイルオープン時: 適用しない
- ファイル保存時: エディタ組み込み設定を適用
注意点
- 空ファイルの保存時、
insert_final_newline = trueでも改行を挿入してはならない
limited support プロパティ
一部エディタのみでサポートされるプロパティ。
max_line_length
| 項目 | 値 |
|---|---|
| 値 | 正の整数、または unset |
| 説明 | 指定文字数での強制改行 |
| サポート | Emacs, Vim, Neovim, Atom, ReSharper, Rider, IntelliJ IDEA, PhpStorm, PyCharm, RubyMine, WebStorm, Kakoune, Prettier |
このプロパティは正式仕様(spec.editorconfig.org)には含まれず、wiki で定義された limited support プロパティ。
spelling_language
| 項目 | 値 |
|---|---|
| 値 | ss または ss-TT 形式 |
| 長さ | 2文字または5文字のみ有効 |
| 説明 | スペルチェック言語 |
ss: ISO 639 の2文字言語コード(例:en)TT: ISO 3166 の2文字地域コード(例:US)- 例:
en,en-US,ja - 1つの言語のみ指定可能。デフォルト値なし
- charset とは独立したプロパティ(文字エンコーディングは
charsetで設定する)
共通ルール
大文字小文字
- プロパティ名と値はすべて 大文字小文字を区別しない
- パース後に小文字化される
unset
任意のプロパティで値に unset を設定すると、そのプロパティの効果を無効化し、エディタのデフォルト設定が使用される。
[*.md]
indent_size = unset未知のプロパティ
- EditorConfig コアは仕様に定義されていないキーバリューペアも受理・報告する
- エディタプラグインは未知のキーや無効な値を 無視 する
プロパティ適用タイミング一覧
| プロパティ | オープン時 | 保存時 |
|---|---|---|
| indent_style | 適用 | - |
| indent_size | 適用 | - |
| tab_width | 適用 | - |
| end_of_line | 適用 | 適用 |
| charset | 適用 | 適用 |
| trim_trailing_whitespace | - | 適用 |
| insert_final_newline | - | 適用 |
関連
- specification — 正式仕様
- glob-patterns — グロブパターン
- best-practices — 設定例・FAQ
references
| Name | Description | Path |
|---|---|---|
| EditorConfig ベストプラクティス | .editorconfig の設定例、FAQ、よくあるパターン。 | best-practices.md |
| EditorConfig グロブパターン | .editorconfig のセクション名で使用するグロブ(ワイルドカード)パターンの仕様。 | glob-patterns.md |
| EditorConfig プロパティ | EditorConfig で使用可能な全プロパティの詳細。 | properties.md |
| EditorConfig 仕様 | EditorConfig ファイルフォーマットの正式仕様(v0.17.2)。 | specification.md |
EditorConfig 仕様
EditorConfig ファイルフォーマットの正式仕様(v0.17.2)。
仕様バージョン
- 現行バージョン: v0.17.2
- Semantic Versioning 2.0.0 に準拠
- 正式仕様: https://spec.editorconfig.org/
ファイル発見アルゴリズム
1. 開いたファイルのディレクトリから .editorconfig を検索 2. 親ディレクトリを順に遡って検索を続行 3. 以下のいずれかで停止:
root = trueを含む.editorconfigを発見- ファイルシステムのルートに到達
優先順位
- 近いファイルが優先: 開いたファイルに近い
.editorconfigのルールが優先 - 後のルールが優先: 同一ファイル内では後に記述されたルールが優先
- ファイルは上から下へ読まれる
ケース感度
- 大文字小文字を区別しないファイルシステムでは、大文字小文字の異なるファイル名も
.editorconfigとして受理される場合がある
ファイルフォーマット
エンコーディング
- UTF-8 エンコーディング必須
- 行区切りは LF または CRLF
行の種類
| 種類 | 説明 |
|---|---|
| 空行 | 何も含まない行。無視される |
| コメント | ; または # で始まる行。無視される |
| セクションヘッダー | [ で始まり ] で終わる行。グロブパターンを定義 |
| キーバリューペア | = で区切られたキーと値 |
| 無効行 | 上記のいずれにも該当しない行 |
インラインコメント
; や # は 行頭にある場合のみ コメントとして扱われる。行中の ; や # はテキストの一部。
ファイル構造
# プリアンブル(最初のセクションヘッダーより前)
root = true
# セクション
[*.js]
indent_style = space
indent_size = 2- プリアンブル: 最初のセクションヘッダーより前の部分。
rootキーのみここに配置可能 - セクション名:
[と]の間の文字列(グロブパターン) - セクション: セクションヘッダーから次のセクションヘッダーまたはファイル末尾まで
キーバリューペアの解析
- キー: 最初の
=より前の部分 - 値: 最初の
=より後の部分(=がない場合は空文字列) - キーと値の前後の空白はトリム、中間の空白は保持
- キーは 大文字小文字を区別しない(パース後に小文字化)
- 値も 大文字小文字を区別しない(lowercased after parsing)
長さ制約
| 要素 | 最小受理長 |
|---|---|
| セクション名 | 1024 文字 |
| キー | 1024 文字 |
| 値 | 4096 文字 |
unset 値
任意のプロパティで unset を値に設定すると、そのプロパティの効果を無効化できる。
[*.md]
indent_size = unset空ファイル
空の .editorconfig(空行とコメント行のみ)は root = false のみを含むファイルと等価。
関連
- properties — 全プロパティ詳細
- glob-patterns — グロブパターン仕様
- best-practices — 設定例・FAQ
Basic Setup
Minimal .editorconfig for a project with Unix line endings and UTF-8 encoding.
# EditorConfig is awesome: https://editorconfig.org
# top-most EditorConfig file
root = true
# Apply to all files
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 2Notes
- Place this file at the repository root alongside
.git/ root = truestops EditorConfig from searching parent directoriestrim_trailing_whitespaceandinsert_final_newlineare applied on save, not on open- Most editors require a plugin; VS Code, JetBrains IDEs, and Neovim have built-in support
Glob Pattern Examples
Common glob patterns for targeting specific files and directories in .editorconfig.
root = true
# All files in any directory (no slash = recursive)
[*]
end_of_line = lf
# Multiple extensions via brace expansion
[*.{ts,tsx,js,jsx}]
indent_size = 2
# Exact filenames (no wildcards)
[{package.json,tsconfig.json,.prettierrc}]
indent_size = 2
# Files under a specific directory (recursive with **)
[src/**.ts]
indent_size = 2
# Files directly under lib/ only (single *)
[lib/*.js]
indent_size = 4
# Numeric range: file01.txt through file12.txt
[file{1..12}.txt]
charset = utf-8
# Exclude files starting with a digit
[[!0-9]*.sh]
indent_style = spaceNotes
*does not cross directory boundaries;**does- A pattern without
/matches in the.editorconfig's directory and all subdirectories - A pattern with
/is anchored to the.editorconfigfile's directory {s1}(single element brace) matches the literal string, not as a glob expansion- A section name ending with
/matches no files
Go Project Configuration
.editorconfig for a Go project (tabs for Go source, spaces for config files).
root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
# Go standard: hard tabs, displayed as 4 columns
[*.go]
indent_style = tab
indent_size = 4
# Config and data files: 2-space
[*.{yml,yaml,json}]
indent_style = space
indent_size = 2
[Makefile]
indent_style = tabNotes
gofmtenforces tabs; this configuration aligns editors to the same convention beforegofmtrunsindent_size = 4on a tab section setstab_width(display width), not the number of spacestab_widthdefaults toindent_sizewhen not specified separately
Multi-Language Project Configuration
.editorconfig for a monorepo or project mixing multiple languages, each with distinct conventions.
# EditorConfig is awesome: https://editorconfig.org
root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
# Web: JS/TS/CSS/HTML — 2-space
[*.{js,jsx,ts,tsx,css,html}]
indent_style = space
indent_size = 2
# Python — 4-space (PEP 8)
[*.py]
indent_style = space
indent_size = 4
# Go — hard tabs
[*.go]
indent_style = tab
indent_size = 4
# Java/Kotlin — 4-space
[*.{java,kt,kts}]
indent_style = space
indent_size = 4
# Config/data files — 2-space
[*.{json,yml,yaml,toml}]
indent_style = space
indent_size = 2
# Markdown
[*.md]
trim_trailing_whitespace = false
# Makefile
[Makefile]
indent_style = tabNotes
- Sections are applied in order; later sections override earlier ones for the same property
- Brace expansion
{ext1,ext2}keeps the file concise when multiple extensions share settings - Files not matched by any filetype section still receive settings from
[*]
Nested .editorconfig Files
Override root settings for a subdirectory by placing a second .editorconfig inside it.
project/
├── .editorconfig # root = true, indent_size = 2
└── legacy/
├── .editorconfig # overrides for legacy code
└── old-module.jsRoot .editorconfig:
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
insert_final_newline = truelegacy/.editorconfig (no root = true):
[*.js]
indent_size = 4When legacy/old-module.js is opened, EditorConfig applies: 1. legacy/.editorconfig → indent_size = 4 2. project/.editorconfig → indent_style = space, end_of_line = lf, insert_final_newline = true
Notes
- Without
root = truein the nested file, the search continues up to the root.editorconfig - The closer file wins:
legacy/.editorconfigoverridesindent_sizefrom the root file - Adding
root = trueto the nested file would stop the search there and discard root settings entirely
Python Project Configuration
.editorconfig for a Python project following PEP 8 (4-space indentation).
root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
# PEP 8: 4-space indentation
[*.py]
indent_style = space
indent_size = 4
# YAML/TOML config files use 2-space
[*.{yml,yaml,toml}]
indent_style = space
indent_size = 2
# Makefile requires hard tabs
[Makefile]
indent_style = tabNotes
[*.py]overrides onlyindent_styleandindent_size; other properties inherit from[*]- PEP 8 mandates 4 spaces per indentation level; this configuration enforces it across all editors
[*.{yml,yaml,toml}]uses brace expansion to match multiple extensions in one section
Samples
| Name | Description | Path |
|---|---|---|
| Basic Setup | Minimal .editorconfig for a project with Unix line endings and UTF-8 encoding. | basic-setup.md |
| Glob Pattern Examples | Common glob patterns for targeting specific files and directories in .editorconfig. | glob-patterns.md |
| Go Project Configuration | .editorconfig for a Go project (tabs for Go source, spaces for config files). | go-project.md |
| Multi-Language Project Configuration | .editorconfig for a monorepo or project mixing multiple languages, each with… | multi-language-project.md |
| Nested .editorconfig Files | Override root settings for a subdirectory by placing a second .editorconfig inside… | nested-editorconfig.md |
| Python Project Configuration | .editorconfig for a Python project following PEP 8 (4-space indentation). | python-project.md |
| Unset Property Override | Use unset to cancel an inherited property and restore the editor's default behavior. | unset-override.md |
| Web Project Configuration | .editorconfig for a JavaScript/TypeScript web project with per-filetype overrides. | web-project.md |
Unset Property Override
Use unset to cancel an inherited property and restore the editor's default behavior.
root = true
[*]
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
# Generated files: do not enforce indentation
[*.generated.*]
indent_size = unset
indent_style = unset
# Binary-adjacent files: skip whitespace trimming
[*.{patch,diff}]
trim_trailing_whitespace = unsetNotes
unsetremoves the EditorConfig constraint; the editor falls back to its own default for that property- Use it for generated files, vendored code, or patch files where reformatting would corrupt content
unsetis different from omitting the property: it actively cancels a value inherited from a broader glob section
Web Project Configuration
.editorconfig for a JavaScript/TypeScript web project with per-filetype overrides.
root = true
[*]
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
charset = utf-8
indent_style = space
indent_size = 2
# Markdown: preserve trailing spaces (two spaces = line break)
[*.md]
trim_trailing_whitespace = false
# Makefile requires hard tabs
[Makefile]
indent_style = tabNotes
- The
[*]section establishes project-wide defaults; per-filetype sections only need to specify overrides - Markdown trailing spaces are intentional (
=<br>), sotrim_trailing_whitespace = falseprevents data loss - Prettier reads
indent_style,indent_size, andend_of_linefrom.editorconfigautomatically
CLI
editorconfig コアコマンドおよび editorconfig-checker の CLI 操作。
ファイルのプロパティ取得(editorconfig-core-js)
editorconfig [OPTIONS] FILEPATH1 [FILEPATH2 FILEPATH3 ...]stdin からパスを読み込む場合はハイフン - を指定する。
単一ファイルのプロパティ取得
editorconfig /path/to/file.js単一パスの場合は key=value 形式で出力される。複数パスの場合は INI 形式で出力される。
設定に寄与したファイルの表示(editorconfig-core-js)
editorconfig --files /path/to/file.jsバージョン表示(editorconfig-core-js)
editorconfig --versionヘルプ表示(editorconfig-core-js)
editorconfig --help代替設定ファイルを指定してプロパティ取得
editorconfig -f /path/to/.editorconfig /path/to/file.js互換性バージョン指定(editorconfig-core-js)
editorconfig -b 0.9.0 /path/to/file.js開発者がバージョン互換性テストに使用する。
Python Core でのプロパティ取得
editorconfig.py /path/to/file.mdeditorconfig-python-core をインストールすると editorconfig.py コマンドがパスに追加される。
Editor Plugins
エディタープラグインのインストール。ネイティブサポート済みエディター(VS Code, Vim, Neovim, IntelliJ IDEA 等)はプラグイン不要。
Vim プラグインのインストール(Vim 8 組み込みパッケージ)
mkdir -p ~/.vim/pack/local/start
cd ~/.vim/pack/local/start
git clone https://github.com/editorconfig/editorconfig-vim.gitVim プラグインのインストール(Vundle)
.vimrc に以下を追加する。
Plugin 'editorconfig/editorconfig-vim'その後 Vim 内で実行する。
:PluginInstallVim プラグインのインストール(vim-plug)
.vimrc に以下を追加する。
Plug 'editorconfig/editorconfig-vim'その後 Vim 内で実行する。
:source $MYVIMRC
:PlugInstallVim プラグインのドキュメント参照
:help editorconfig:helptags ALLGenerate
設定ファイルの生成。
editorconfig-checker 初期設定ファイルの生成
editorconfig-checker -initプロジェクトルートに .editorconfig-checker.json を生成する。
Install
EditorConfig コアライブラリおよびチェックツールのインストール。
editorconfig-core-js のインストール(npm)
npm install editorconfigeditorconfig-core-js のグローバルインストール(npm)
npm install -g editorconfigeditorconfig-checker のインストール(npm・開発依存)
npm install --save-dev editorconfig-checkereditorconfig-checker のインストール(Yarn・開発依存)
yarn add --dev editorconfig-checkereditorconfig-checker のインストール(Go)
go install github.com/editorconfig-checker/editorconfig-checker/v3/cmd/editorconfig-checker@latesteditorconfig-checker のインストール(Homebrew)
brew install editorconfig-checkereditorconfig-checker のインストール(Nix)
nix-env -iA nixpkgs.editorconfig-checkereditorconfig-checker のインストール(Arch Linux)
pacman -S editorconfig-checkereditorconfig-checker のインストール(mise)
mise use -g editorconfig-checker@latesteditorconfig-checker のインストール(PHP Composer・開発依存)
composer require --dev editorconfig-checkereditorconfig-checker(Python・pip)
pip install editorconfig-checkerscripts
| Name | Description | Path |
|---|---|---|
| CLI | editorconfig コアコマンドおよび editorconfig-checker の CLI 操作。 | cli.md |
| Editor Plugins | エディタープラグインのインストール。ネイティブサポート済みエディター(VS Code, Vim, Neovim, IntelliJ IDEA 等)はプラグイン不要。 | editor-plugins.md |
| Generate | 設定ファイルの生成。 | generate.md |
| Install | EditorConfig コアライブラリおよびチェックツールのインストール。 | install.md |
| Validate | editorconfig-checker を使ったファイルの検証(.editorconfig ルールへの準拠確認)。 | validate.md |
Validate
editorconfig-checker を使ったファイルの検証(.editorconfig ルールへの準拠確認)。
プロジェクト全体の検証(git 管理ファイルが対象)
editorconfig-checkerec は editorconfig-checker のエイリアス。git リポジトリルートから追跡ファイルを対象に実行する。
エイリアスで実行
ec特定ファイルの検証
editorconfig-checker FILE1 FILE2ファイルパターンを除外して検証
editorconfig-checker --exclude node_modules --exclude myBinary正規表現で除外パターンを指定して検証
editorconfig-checker -exclude "\.md$"デフォルト除外パターンを無視して検証
editorconfig-checker --ignore-defaults検証対象ファイル一覧の表示(実際のチェックなし)
editorconfig-checker --dry-runカスタム設定ファイルを使って検証
editorconfig-checker -config .editorconfig-checker.json詳細ログを出力して検証
editorconfig-checker -verbose行末チェックを無効にして検証
editorconfig-checker -disable-end-of-lineインデントチェックを無効にして検証
editorconfig-checker -disable-indentation末尾空白チェックを無効にして検証
editorconfig-checker -disable-trim-trailing-whitespace最終改行チェックを無効にして検証
editorconfig-checker -disable-insert-final-newlinenpm script として実行
npm run lint:editorconfigpackage.json に以下を追加した場合に使用する。
"scripts": {
"lint:editorconfig": "editorconfig-checker"
}Docker で実行
docker run --rm --volume=$PWD:/check mstruebing/editorconfig-checkerバージョン表示(editorconfig-checker)
editorconfig-checker --versionヘルプ表示(editorconfig-checker)
editorconfig-checker --helpGitHub Actions 形式で出力
editorconfig-checker -format github-actions-format オプションの値: default, codeclimate, gcc, github-actions