d4nyll / smartscroll

jQuery plugin for scrolljacking and auto-hashing
https://d4nyll.github.io/smartscroll/
MIT License
257 stars 45 forks source link

So many warnings it breaks my Gulp build #33

Closed calluna closed 7 years ago

calluna commented 7 years ago

I can't build Gulp, all the warnings in your plugin break my build...

d4nyll commented 7 years ago

@calluna How have you set up Gulp? What warnings do you get? Smartscroll is just a jQuery plugin, with generates a single file. I'll need more information that that to help you.

Also, this might help - http://blog.npmjs.org/post/112064849860/using-jquery-plugins-with-npm

calluna commented 7 years ago

Just simple warnings like "missing semicolon" and "invalid space" but also a bit more complicated warnings like "variable out of scope". When I go to production Gulp does not want the warnings and aborts.

d4nyll commented 7 years ago

Right, I should use a linter and get that fixed.

petermakowski commented 7 years ago

Hey @d4nyll First of all - thanks a lot for your great work with smartscroll and lethargy. Would you like me to help fixing these javascript errors? I'm happy to do that ( following for example https://github.com/airbnb/javascript/tree/es5-deprecated/es5 unless you've got other suggestions) and create a pull request.

d4nyll commented 7 years ago

I've added ESLint to the project on the lint branch

@calluna Please try it now to see if it works?

@petermakowski Thank you very much for the offer. I've only applied basic rules to the project, and have not actually tested that the library works as before. I'd very much appreciate your help in improving the code style and checking that I didn't make an error when formatting my code. If you think it's OK, let me know and I'll merge it into the master branch.

In the long run, if I ever find the time, I'll probably port the existing code to ES6/7/8 etc and then transpile it back to ES5, but that's for later!

d4nyll commented 7 years ago

Thanks to @petermakowski for the help! A new version has now been released!