1

I am building a linter, in order to have consistency between the team, for our legacy codebase which is vanilla JS with a file combiner (concatenates all JS files into one).

I want all javascript files to start with a semicolon. If you want to know the reason, check this: What does the leading semicolon in JavaScript libraries do?. Do you know any plugin that ensures semicolon at the beginning of a file?

I also want to keep no-extra-semi option from eslint:recommended, any suggestions about how to do it?

Sujal Patel
  • 2,444
  • 1
  • 19
  • 38
laltin
  • 1,134
  • 12
  • 20
  • 3
    Your *bundler* (I think thats what you are calling a "file combiner") should already create a valid bundle and there should be no need to manually add (unnecessary) semicolons somewhere. – Jonas Wilms Jun 27 '19 at 13:09
  • Our bundler just combines files nothing smart, that's why I called it combiner. I think semicolons in the beginning of file is a good practice that's why I need it. – laltin Jun 27 '19 at 13:12
  • @JonasWilms I've worked with some in-house bundler that didn't. And that wasn't the only issue with it, either. It was...rather unpleasant. Basically, you're saying "[bunblder] should" but that's not necessarily the case. I do understand that's not an argument to keep it - it's actually an argument to ditch it (one I couldn't win back then) but it might explain where OP is coming from. – VLAZ Jun 27 '19 at 13:13
  • @laltin ah, sounds like the in-house monstrosity I dealt with. It would do a glorified copy/past of the contents of the file through a rather convoluted means... – VLAZ Jun 27 '19 at 13:15
  • @VLAZ not exactly in-house thing, actually it is a framework. in the worst case I will create my own plugin for that – laltin Jun 27 '19 at 13:25

0 Answers0