0.1.2092 • Published 7 years ago

fix-indents v0.1.2092

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

7 years ago

0.1.2091

7 years ago

0.1.2090

7 years ago

0.1.2089

7 years ago

0.1.2088

7 years ago

0.1.2087

7 years ago

0.1.2086

7 years ago

0.1.2085

7 years ago

0.1.2084

7 years ago

0.1.2083

7 years ago

0.1.2082

7 years ago

0.1.2081

7 years ago

0.1.2080

7 years ago

0.1.2079

7 years ago

0.1.2078

7 years ago

0.1.2077

7 years ago

0.1.2076

7 years ago

0.1.2075

7 years ago

0.1.2074

7 years ago

0.1.2073

7 years ago

0.1.2072

7 years ago

0.1.2071

7 years ago

0.1.2070

7 years ago

0.1.2069

7 years ago

0.1.2068

7 years ago

0.1.2067

7 years ago

0.1.2066

7 years ago

0.1.2065

7 years ago

0.1.2064

7 years ago

0.1.2063

7 years ago

0.1.2062

7 years ago

0.1.2061

7 years ago

0.1.2060

7 years ago

0.1.2059

7 years ago

0.1.2058

7 years ago

0.1.2057

7 years ago

0.1.2056

7 years ago

0.1.2055

7 years ago

0.1.2054

7 years ago

0.1.2053

7 years ago

0.1.2052

7 years ago

0.1.2051

7 years ago

0.1.2050

7 years ago

0.1.2047

7 years ago

0.1.2046

7 years ago

0.0.1

7 years ago