Let EditorConfig and Textlint works together.

Usage no npm install needed!

<script type="module">
  import textlintRuleEditorconfig from 'https://cdn.skypack.dev/textlint-rule-editorconfig';



textlint rule Gitter Build Status Coverage NPM Version

Let EditorConfig and Textlint work together.


See also Textlint's readme.



  "rules": {
    "editorconfig": true


  // ...
  "scripts": {
    "textlint": "textlint",
    "textlint:fix": "textlint --fix"
  // ...

Command line:

$ npm i -S textlint
$ npm i -S textlint-rule-editorconfig
$ npm run textlint
$ npm run textlint:fix


  • .editorconfig
    • Merge all .editorconfig files along the way, starting from nearest, until root = true fonud. If nothing found, provides a default configuration.
    • Priority: the nearer the higher between files, the later the higher in one file.
  • Glob (see match.js for details) based on minimatch, but retrieve a file's basename first, if no / found in the pattern.
  • Rules
    • indent_style: check all lines beginning with space or tab.
      • If indent_style = space, able to fix replacing each beginning tab to 2 spaces (or other, configurable via indent_size).
      • If indent_style = tab, unable to fix. Only warnings generated.
    • trim_trailing_whitespace: as you may expect. Fixable.
    • insert_final_newline: as you may expect. Fixable.
    • end_of_line: as you may expect. Fixable.
    • charset: based on jschardet. Not fixable, as it is kind of dangerous.


Feel free to open issues or send PRs.