0.1.2092 • Published 8 years ago

fix-indents v0.1.2092

Weekly downloads
27
License
ISC
Repository
github
Last release
8 years ago

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

OptionDescription
countSpacesPrefered amount of spaces for formatting
ignoreInsideIgnore multiline comment and multiline strings

Example for LiveScript:

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

8 years ago

0.1.2091

8 years ago

0.1.2090

8 years ago

0.1.2089

8 years ago

0.1.2088

8 years ago

0.1.2087

8 years ago

0.1.2086

8 years ago

0.1.2085

8 years ago

0.1.2084

8 years ago

0.1.2083

8 years ago

0.1.2082

8 years ago

0.1.2081

8 years ago

0.1.2080

8 years ago

0.1.2079

8 years ago

0.1.2078

8 years ago

0.1.2077

8 years ago

0.1.2076

8 years ago

0.1.2075

8 years ago

0.1.2074

8 years ago

0.1.2073

8 years ago

0.1.2072

8 years ago

0.1.2071

8 years ago

0.1.2070

8 years ago

0.1.2069

8 years ago

0.1.2068

8 years ago

0.1.2067

8 years ago

0.1.2066

8 years ago

0.1.2065

8 years ago

0.1.2064

8 years ago

0.1.2063

8 years ago

0.1.2062

8 years ago

0.1.2061

8 years ago

0.1.2060

8 years ago

0.1.2059

8 years ago

0.1.2058

8 years ago

0.1.2057

8 years ago

0.1.2056

8 years ago

0.1.2055

8 years ago

0.1.2054

8 years ago

0.1.2053

8 years ago

0.1.2052

8 years ago

0.1.2051

8 years ago

0.1.2050

8 years ago

0.1.2047

8 years ago

0.1.2046

8 years ago

0.0.1

8 years ago