Class: Beautifiers

Defined in: src/beautifiers/index.coffee
Inherits: EventEmitter

Overview

Register all supported beautifiers

Variables Summary

beautifierNames =
['uncrustify', 'autopep8', 'coffee-formatter', 'coffee-fmt', 'clang-format', 'crystal', 'dfmt', 'elm-format', 'htmlbeautifier', 'csscomb', 'gherkin', 'gofmt', 'latex-beautify', 'fortran-beautifier', 'js-beautify', 'jscs', 'lua-beautifier', 'ocp-indent', 'perltidy', 'php-cs-fixer', 'phpcbf', 'prettydiff', 'pug-beautify', 'puppet-fix', 'remark', 'rubocop', 'ruby-beautify', 'rustfmt', 'sass-convert', 'sqlformat', 'stylish-haskell', 'tidy-markdown', 'typescript-formatter', 'vue-beautifier', 'yapf', 'erl_tidy', 'marko-beautifier', 'formatR']

List of beautifier names

To register a beautifier add its name here

beautifiers =
null

List of loaded beautifiers

Autogenerated in constructor from beautifierNames

options =
null

All beautifier options

Autogenerated in constructor

findFileResults =
{}

Instance Method Summary

Constructor Details

# (void) constructor()

Constructor

Instance Method Details

# (void) getBeautifiers(language)

# (void) getBeautifierForLanguage(language)

# (void) getLanguage(grammar, filePath)

# (void) getOptionsForLanguage(allOptions, language)

# (void) transformOptions(beautifier, languageName, options)

# (void) trackEvent(payload)

# (void) trackTiming(payload)

# (void) track(type, payload)

# (void) beautify(text, allOptions, grammar, filePath, {onSave} = {})

# (void) getUserHome()

CLI

# (void) verifyExists(fullPath)

# (void) findFile(name, dir, upwards = true)

Storage for memoized results from find file Should prevent lots of directory traversal & lookups when liniting an entire project

# (void) findConfig(config, file, upwards = true)

Tries to find a configuration file in either project directory or in the home directory. Configuration files are named '.jsbeautifyrc'.

@returns {string} a path to the config file

Parameters:

  • config ( string ) name of the configuration file
  • file ( string ) path to the file to be linted
  • upwards ( boolean ) should recurse upwards on failure? (default: true)

# (void) getConfigOptionsFromSettings(langs)

# (void) getConfig(startPath, upwards = true)

Look for .jsbeautifierrc in file and home path, check env variables

# (void) getOptionsForPath(editedFilePath, editor)

# (void) isNestedOptions(currOptions)

# (void) getOptions(selections, allOptions) Bound

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: