ozdemirburak / morse-code-translator

Translate text to Morse code and vice versa, with the option to play Morse code audio.
https://morsecodetranslator.com
MIT License
216 stars 57 forks source link

Transpose ES5 => ES6 #4

Closed thatrobotdev closed 6 years ago

thatrobotdev commented 6 years ago

Fixes #3

thatrobotdev commented 6 years ago

It looks like the build with this PR fails unexpectedly. I don't know why. I want to be able to try some local testing, but cannot because I am not on my developing machine. I will try to update the JS and try some more solutions.

ozdemirburak commented 6 years ago

Hello James!

Thanks for your pull request. It would be great if you can check tests and update if needed, as you can see the error log from the details.

./src/morsify.js: line 1, col 1, Use the function form of "use strict".
./src/morsify.js: line 3, col 70, Invalid typeof value 'symbol'
./src/morsify.js: line 13, col 38, Unmatched '{'.

Also, you may use arrow functions and replace var declarations with const or let.

Thank you.

thatrobotdev commented 6 years ago

I’m heading out soon, but I will fix these issues ASAP!

ozdemirburak commented 6 years ago

It is OK, thank you :)

thatrobotdev commented 6 years ago

I was wondering, where are you finding this additional error information?

ozdemirburak commented 6 years ago

First, click details on the area where you see "All checks have failed" here on this pull request.

continuous-integration/travis-ci/pr — The Travis CI build failed Details

Then you will see node versions in there, 3 rows, click one of them, it will show you something like this.

Or run the tests on your local machine.

thatrobotdev commented 6 years ago

Thank you!

thatrobotdev commented 6 years ago

Ok, Travis CI build is passing! I'll go add some arrow functions! (also, I'm not sure if any of the variables are changed globally, or need to be changed at all. Which ones should be const vs let?)

I'm planning on doing this later tonight, or in the afternoon tomorrow! Hope that works for you! :D

thatrobotdev commented 6 years ago

I reverted what I did because they were throwing errors. I don't know much about arrow functions, but I'll research them later when I have the time so I can help convert some of the functions. Tests should be passing now.

ozdemirburak commented 6 years ago

What you changed was OK actually, you need to make those changes again, however, you also need to configure the project so that it will pass the tests.

See this log line for instance.

./src/morsify.js: line 12, col 3, 'const' is available in ES6 (use 'esversion: 6') or Mozilla JS extensions (use moz).

You need to declare that you are using ES6, to do that, add a JSHint file, .jshintrc, with the contents.

{  
  "esversion": 6 
}
ozdemirburak commented 6 years ago

Sorry James, someone has done all the changes here before you, thank you for all of your efforts.

thatrobotdev commented 6 years ago

Glad that it worked out!