0.1.2092 • Published 9 years ago

fix-indents v0.1.2092

Weekly downloads
27
License
ISC
Repository
github
Last release
9 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

9 years ago

0.1.2091

9 years ago

0.1.2090

9 years ago

0.1.2089

9 years ago

0.1.2088

9 years ago

0.1.2087

9 years ago

0.1.2086

9 years ago

0.1.2085

9 years ago

0.1.2084

9 years ago

0.1.2083

9 years ago

0.1.2082

9 years ago

0.1.2081

9 years ago

0.1.2080

9 years ago

0.1.2079

9 years ago

0.1.2078

9 years ago

0.1.2077

9 years ago

0.1.2076

9 years ago

0.1.2075

9 years ago

0.1.2074

9 years ago

0.1.2073

9 years ago

0.1.2072

9 years ago

0.1.2071

9 years ago

0.1.2070

9 years ago

0.1.2069

9 years ago

0.1.2068

9 years ago

0.1.2067

9 years ago

0.1.2066

9 years ago

0.1.2065

9 years ago

0.1.2064

9 years ago

0.1.2063

9 years ago

0.1.2062

9 years ago

0.1.2061

9 years ago

0.1.2060

9 years ago

0.1.2059

9 years ago

0.1.2058

9 years ago

0.1.2057

9 years ago

0.1.2056

9 years ago

0.1.2055

9 years ago

0.1.2054

9 years ago

0.1.2053

9 years ago

0.1.2052

9 years ago

0.1.2051

9 years ago

0.1.2050

9 years ago

0.1.2047

9 years ago

0.1.2046

9 years ago

0.0.1

9 years ago