Skip to content
This repository has been archived by the owner on Oct 4, 2020. It is now read-only.

eclint only indents comments #160

Open
stillwondering opened this issue May 22, 2019 · 1 comment
Open

eclint only indents comments #160

stillwondering opened this issue May 22, 2019 · 1 comment

Comments

@stillwondering
Copy link

stillwondering commented May 22, 2019

Description

eclint only indents comments in a JS file, everything else is kept as it is.

How to reproduce

Example JS file:

/*
 * Some comment on the module.
 */
var driver = (function() {
  
  /*
   * This is some property.
   */
  var property = null;

  /*
   * Get the property.
   */
  var getProperty = function() {
    return property;
  };

  return {
    getProperty: getProperty
  };
})();

.editorconfig in use:

root = true

[*]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
trim_trailing_whitespace = false
$ eclint fix app.js

The result of this command is:

/*
 * Some comment on the module.
 */
var driver = (function() {

  /*
    * This is some property.
    */
  var property = null;

  /*
    * Get the property.
    */
  var getProperty = function() {
    return property;
  };

  return {
    getProperty: getProperty
  };
})();

As we see, the only thing that's changed are the comments inside of the closure (which are not properly indented, either). The property and the method are not changed. I'd expect the file to be indented using four spaces.

Version

$ eclint --version
2.8.1
@jednano
Copy link
Owner

jednano commented May 22, 2019

Have you considered using Prettier? It's what I use nowadays.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants