Skip to content

flyber-net/fix-indents

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Logo

Fix Indents in Indented Languages like SASS, Pug, CoffeeScript, LiveScript, Haskell, Ocaml, F#, Python, Bash, etc.

Demo

Demo

Other Examples

Example

SASS Example

Motivation

  • Developer puts different amount of indents during development. This tools allows to refactor indents into one consistent and accurate indented style.
  • Sometimes Developer need to add top level block. It forces to move all nested tree.
  • SASS will throw the error for inconsistent indents

Install

#Install Nodejs
npm install fix-indents -g

Use in Command Line

fix-indents ./style.sass

Use with NodeJs

fixIndents = require("fix-indents");

fixedCode = fixIndents("PUT CODE HERE", { /*options*/ });

console.log(fixedCode);

Options

Option Description
countSpaces Prefered amount of spaces for formatting
ignoreInside Ignore multiline comment and multiline strings

Example for LiveScript:

{ 
  
  "countSpaces": 2,
  "ignoreInside": [
     ["'''", "'''"],
     ["/*" , "*/" ],
     ["\"\"\"", "\"\"\""]
  ]

About

Code Formatter for indented languages like SASS, CoffeeScript, LiveScript, Python, Ocaml, F#, Haskell, etc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published