Class: Beautifiers

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

Variables Summary

beautifierNames =
['uncrustify', 'align-yaml', 'autopep8', 'brittany', 'coffee-formatter', 'coffee-fmt', 'cljfmt', 'clang-format', 'crystal', 'dfmt', 'elm-format', 'hh_format', 'htmlbeautifier', 'csscomb', 'gherkin', 'gn', 'gofmt', 'goimports', 'latex-beautify', 'fortran-beautifier', 'hindent', 'vhdl-beautifier', 'js-beautify', 'jscs', 'eslint', 'lua-beautifier', 'nginx-beautify', 'ocp-indent', 'perltidy', 'php-cs-fixer', 'phpcbf', 'prettier', 'prettydiff', 'pybeautifier', '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', 'beautysh', 'terraformfmt', 'verilog-mode']

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) loadOptions()

# (void) getBeautifiers(language)

# (void) getBeautifierForLanguage(language)

# (void) getExtension(filePath)

# (void) getLanguages(grammar, filePath)

# (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, language} = {})

# (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: