-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Implement _check #21
Implement _check #21
Conversation
Thank you for the submission, @carlosadames! I'll review your code shortly, hang tight. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great attempt @carlosadames, you're almost there!
I've marked a few style guide violations with inline comments. Please review the comments below and make the appropriate changes. Remember, you can check your code's style locally with npm run lint
.
After you make these changes locally, commit and push them back up to your fork. When you push your changes, I'll come back for another review.
src/calculator.js
Outdated
// Then, invoke this function inside each of the others | ||
// HINT: you can invoke this function with exports._check() | ||
}; | ||
exports._check = (x, y) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block must not be padded by blank lines.
See http://eslint.org/docs/rules/padded-blocks for details about this rule
src/calculator.js
Outdated
}; | ||
exports._check = (x, y) => { | ||
|
||
if (typeof x !== 'number') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 2 spaces but found 4.
See http://eslint.org/docs/rules/indent for details about this rule
src/calculator.js
Outdated
throw new TypeError(`${x} is not a number`); | ||
} | ||
|
||
if (typeof y !== 'number') { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Expected indentation of 2 spaces but found 4.
See http://eslint.org/docs/rules/indent for details about this rule
src/calculator.js
Outdated
throw new TypeError(`${y} is not a number`); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block must not be padded by blank lines.
See http://eslint.org/docs/rules/padded-blocks for details about this rule
src/calculator.js
Outdated
throw new TypeError(`${y} is not a number`); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing semicolon.
See http://eslint.org/docs/rules/semi for details about this rule
src/calculator.js
Outdated
return x - y; | ||
|
||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block must not be padded by blank lines.
See http://eslint.org/docs/rules/padded-blocks for details about this rule
src/calculator.js
Outdated
return x * y; | ||
|
||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block must not be padded by blank lines.
See http://eslint.org/docs/rules/padded-blocks for details about this rule
src/calculator.js
Outdated
return x * y; | ||
|
||
}; | ||
|
||
exports.divide = (x, y) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block must not be padded by blank lines.
See http://eslint.org/docs/rules/padded-blocks for details about this rule
src/calculator.js
Outdated
if (typeof y !== 'number') { | ||
throw new TypeError(`${y} is not a number`); | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing spaces not allowed.
See http://eslint.org/docs/rules/no-trailing-spaces for details about this rule
src/calculator.js
Outdated
return x / y; | ||
|
||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Block must not be padded by blank lines.
See http://eslint.org/docs/rules/padded-blocks for details about this rule
I'm reviewing your changes now, @carlosadames. Let's get this merged soon! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All of the tests are passing and the code is clean.
This is a huge improvment for our codebase's maintainability. The team is going to be stoked to see your contribution when they get back from vacation.
Well done, @carlosadames 👏
🎉 You did it! 🎉You're an open source contributor now! Whether this was your first pull request, or you’re just looking for new ways to contribute, I hope you’re inspired to take action. Don't forget to say thanks when a maintainer puts effort into helping you, even if a contribution doesn't get accepted. Open source is made by people like you: one issue, pull request, comment, and +1 at a time. What's next?Find your next project:
Learn from other great community members:
Elevate your Git game:
Questions? Comments? Concerns?I'm always open to feedback. If you had a good time with the exercise, or found some room for improvement, please let me know on twitter or email. Want to start over? Just delete your fork. |
Hello again, @carlosadames! I want to congratulate you again for completing this challenge. Hopefully you've started to get out there and apply your knowledge to another project. Since you haven't pushed a commit in a while, I'm going to delete your branch in order to make room for others actively particiating. You'll still have access to your fork, but you won't be able to submit anymore pull requests to this branch. Don't worry though! If you decide that you do want a new branch, you can delete your fork and re-fork the original project. Happy Hacking! |
This pull request is from issue #1
Optimized export._check() function by deleting duplicate code.