Coder Social home page Coder Social logo

textlint-rule-editorconfig's Introduction

textlint-rule-editorconfig

textlint rule Gitter Build Status Coverage NPM Version

Let EditorConfig and Textlint work together.

Usage

See also Textlint's readme.

TL;DR

.textlintrc

{
  "rules": {
    "editorconfig": true
  }
}

package.json

{
  // ...
  "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

Strategy

  • .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.

Contribute

Feel free to open issues or send PRs.

textlint-rule-editorconfig's People

Contributors

arrowrowe avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.