2.1.3 • Published 3 years ago

prettignore v2.1.3

Weekly downloads
21
License
MIT
Repository
github
Last release
3 years ago

CLI

Run prettignore --help for details

Configuration

Make a .prettignorerc.json file in the root of your project.

The config should have the following structure:

interface PrettignoreConfig {
  files: string[];
  endOfLine?: 'lf' | 'crlf' | 'cr' | 'auto';
}

API

formatLine(line: string): string

formatLine(line);

formatFile(content: string, config: PrettignoreConfig): string

formatFile(content, { endOfLine: 'lf' });

Examples

Adds spaces after comments

#just a nice comment!

Becomes:

# just a nice comment!

Removes trailing and leading spaces and lines

        dist
              build

Becomes:

dist
build

Removes line gaps larger than one line

dist



build

Becomes:

dist

build

E v e r y t h i n g

dist      

    .ignored*



    #comment


  # another comment

  build/

  .secretfile.json



  

Becomes:

dist

.ignored*

# comment

# another

build/

.secretfile.json
2.1.3

3 years ago

2.0.3

3 years ago

2.0.2

3 years ago

2.0.1

3 years ago

2.0.0

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago