0

Should I use JSLint on my CoffeeScript project when I'm already running CoffeeLint on all the files? I don't think this question is subjective. Here would be objective reasons not to:

  1. Does CoffeeLint already run JSLint? If yes, that would make JSLint redundant
  2. Does CoffeeScript generate code that will make JSLint fail in ways that I have no control over? If yes, JSLint will just get in my way
  3. Does CoffeeScript automatically generate code that is JSLinted? That would make running JSLint a waste of time.
fracz
  • 20,536
  • 18
  • 103
  • 149
Daniel Kaplan
  • 62,768
  • 50
  • 234
  • 356

1 Answers1

2

No, there is no benefit to running JSLint against JavaScript produced from CoffeeScript.

The output of CoffeeScript's compilation isn't under your control, and it isn't meant to pass any form of linting, so there is absolutely no value to running JSLint against it. You can't fix any problems you find, and there will be a lot of problems.

Linters are for catching human-induced errors in source code, not for finding bugs in transcompilers like CoffeeScript's.

Does CoffeeLint already run JSLint? If yes, that would make JSLint redundant

No

Does CoffeeScript generate code that will make JSLint fail in ways that I have no control over? If yes, JSLint will just get in my way

This, exactly

Does CoffeeScript automatically generate code that is JSLinted? That would make running JSLint a waste of time.

No

user229044
  • 232,980
  • 40
  • 330
  • 338
  • I do have *some* control. For example, I can choose between saying `if x` and `if x is undefined` in CoffeeScript. Hypothetically, if JSLint sees the former and says, "`if x` will return false on 0", I can do something about that. But for all I know, there will be 1000 other complaints I can't do anything about. Are you speaking from experience? – Daniel Kaplan Apr 17 '14 at 18:53
  • I'm speaking from experience, but also common sense. The JavaScript output by CoffeeScript is *compiled code*. It's not source code anymore. It has been subject to any number of transformations and optimizations. It is no longer meant to pass any form of linting. – user229044 Apr 17 '14 at 18:54