google / closure-linter

Automatically exported from code.google.com/p/closure-linter
Apache License 2.0
109 stars 37 forks source link

Functions as variables not working #107

Closed alexandrestein closed 7 years ago

alexandrestein commented 7 years ago

I trued to update the package with pip. It looks like my version is: closure-linter==2.3.19.

If I make a file like this:

(function() {
  'use strict';

  let func1 = function anonymous(b) {},
  func2 = function anonymous() {},
  func3 = function() {};
})();

When I run the command: fixjsstyle --strict file.js

The resulting file is:

(function() {
  'use strict';

  let func1 = function anonymous(b) {};,
  func2 = function anonymous() {};,
  func3 = function() {};
})();

It's the same with var:

(function() {
  'use strict';

  var func1 = function anonymous(b) {},
  func2 = function anonymous() {},
  func3 = function() {};
})();

Which gives:

(function() {
  'use strict';

  var func1 = function anonymous(b) {};,
      func2 = function anonymous() {};,
      func3 = function() {};
})();

It's maybe not the best way to define functions. But it supposes to works so I guess this is a bug.

By the way, what about to indentation which is not the same with var and let.

Thanks

rumpeltux commented 7 years ago

Unfortunately this project is deprecated (see https://github.com/google/closure-linter/blob/master/README.md) You can probably try --jslint_error=NO_MISSING_SEMICOLON as a workaround if you still need to use this tool.