node-dmx / dmx

DMX controller library for node.js
MIT License
297 stars 96 forks source link

Modernize code and enforcing eslint rules #70

Closed Fensterbank closed 5 years ago

Fensterbank commented 5 years ago

One of the things that bothered me over time is the fact that many of the files have different formatting and in almost every pull request it becomes apparent that contributors (and IDEs) have their problems with it.

This pull request modernizes our very old code base by using the latest EcmaScript syntax and enforces some wideley used lint rules. For linting I used most of the rules from https://github.com/krasimir/webpack-library-starter, these are also the rules I use within my company and I assume these are the rules most modern JS developer are familiar with, even if they completeley differ from the code style (e.g. indentation, casing and quotes) we had before.

Initially I planned more for this PR (e.g. restructuring some files and folders), but since it's already a big change I want to bring it first into discussion. Therefore this PR does not change or improve any code logic.

This PR changes the minimum Node version to version 10. Since version 10 is LTS and it's not recommended to use older versions, I do not see a problem with it, but feel free to bring your opinions.

Fensterbank commented 5 years ago

Thanks, I'm glad you like the change. I still have a few things to do and I'll continue working on it on 35C3 in Leipzig. Merry Christmas! 🎄

Fensterbank commented 5 years ago

I fixed the package.json, added babel-eslint (which is needed to transform the code in a version which eslint understands) to devDependencies and fixed some issues in the animations which wasn't tested.

Should work out of the box now as before. Can you confirm this?

wiedi commented 5 years ago

Yeah it works now, thanks.

There is now a warning for demo.js - which makes sense considering how that file is structured. With the upcomming library/web split we can probably create an examples/ folder or something like that and split that file into a few smaller demos.

For now I think this is fine an can be merged. I did not look at everything in detail but the places I looked were fine.

Thanks for all the work!