Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Started using new code style. #111

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Started using new code style. #111

wants to merge 1 commit into from

Conversation

martinheidegger
Copy link
Contributor

@ccarruitero the recent dependency update made a breaking change of making workshopper-adventure only compatible with Node > 8.

The linting doesn't fail but a few other things might. So I am opening this PR in the hopes that someone finds time to add tests to it.

@workshopper/javascripting-leads Maybe you want to take a look at this?

@itzsaga
Copy link
Member

itzsaga commented Jan 21, 2020

@martinheidegger I can see if I can do it. My current full time job wants me spending 5-10% of my time on OSS/community stuff. I'm not sure exactly what needs to happen so if you can help point me in the right direction I'll do my best 😃.

@ccarruitero
Copy link
Contributor

@itzsaga we are using tape for tests. You can see the test for an example, also take a look into tape repository

@martinheidegger I was trying to add a test, but the package is broken with these changes right now. Seems to be something with commandico, but not sure how to solve. https://gist.github.com/ccarruitero/02cce7e55a515d2a2248594f2ea6907d

Also, we are introducing a breaking change exporting a class instead a function.
I prefer to not introduce that kind of breaking changes for now, since more workshoppers will become out of date.

return '[WorkshopperFileError: ' + id + ' @ ' + error.exerciseFile + ']'
}
return error
function fileError (id, exerciseFile) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this could be changed to arrow function too

const fileError = (id, exerciseFile) => {

Comment on lines +156 to +157
var i18n = this.i18n
var buffer = []
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these variables could be updated to const

getFile: getFsObject.bind(null, 'file')
}
exports.getDir = (file, base) => getFsObject('dir', file, base)
exports.getFile = (file, base) => getFsObject('file', file, base)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I prefer to declare all exports at final, so is more easy to know what is exported.

But could use the object shorthand

module.exports = {
  idFromName,
  dirFromName,
  ...
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants