-
Notifications
You must be signed in to change notification settings - Fork 1
Make the example successful #8
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
Merged
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ac5047e
Rename to ci.yml
dan-manges 4c62132
Update README
dan-manges 00dc860
fix all issues
dan-manges fc52abd
remove adminer from docker-compose
dan-manges f5f337c
add a push trigger
dan-manges 4fc3d29
Merge branch 'origin/main' into dan/cleanup
dan-manges File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,35 +1,33 @@ | ||
| const _ = require('lodash'); | ||
| // Calculate total price of items | ||
| function calculateTotal (items) { | ||
| let total = 0; | ||
|
|
||
| // This function has some intentional linting issues for demonstration | ||
| function calculateTotal(items) { | ||
| let total = 0 | ||
|
|
||
| const taxRate = 0.08 | ||
|
|
||
| for (let i = 0; i < items.length; i++) { | ||
| var item = items[i] | ||
| total += item.price * item.quantity | ||
| const item = items[i]; | ||
| total += item.price * item.quantity; | ||
| } | ||
| return total | ||
|
|
||
| return total; | ||
| } | ||
|
|
||
| // Function with logic error (will cause test failure when b is 0) | ||
| function divide(a, b) { | ||
| return a / b | ||
| function divide (a, b) { | ||
| if (b === 0) { | ||
| return 0; | ||
| } | ||
| return a / b; | ||
| } | ||
|
|
||
| function add(a, b) { | ||
| return a + b | ||
| function add (a, b) { | ||
| return a + b; | ||
| } | ||
|
|
||
| function multiply( a,b ){ | ||
| return a*b | ||
| function multiply (a, b) { | ||
| return a * b; | ||
| } | ||
|
|
||
| module.exports = { | ||
| calculateTotal, | ||
| divide, | ||
| add, | ||
| multiply | ||
| } | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,29 +1,30 @@ | ||
| function formatCurrency(amount) { | ||
| if (amount == null) { | ||
| return '$0.00' | ||
| function formatCurrency (amount) { | ||
| if (amount === null || amount === undefined) { | ||
| return '$0.00'; | ||
| } | ||
| return `$${amount.toFixed(2)},` | ||
|
|
||
| return `$${amount.toFixed(2)},`; | ||
| } | ||
|
|
||
| function validateEmail(email) { | ||
| function validateEmail (email) { | ||
| if (email && email.includes('@')) { | ||
| return true | ||
| return true; | ||
| } | ||
| return undefined; | ||
| } | ||
|
|
||
| function debugLog(message) { | ||
| console.log('DEBUG:', message) | ||
| function debugLog (message) { | ||
| // eslint-disable-next-line no-console | ||
| console.log('DEBUG:', message); | ||
| } | ||
|
|
||
| function isEven(number) { | ||
| // This logic is intentionally wrong - it returns true for odd numbers | ||
| return number % 2 === 1 | ||
| function isEven (number) { | ||
| return number % 2 === 0; | ||
| } | ||
|
|
||
| module.exports = { | ||
| formatCurrency, | ||
| validateEmail, | ||
| debugLog, | ||
| isEven | ||
| } | ||
| }; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Should we keep this? We generally recommend using it with
node-modulesThere 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.
I don't think it's always going to be intuitive to end users why it's there. Despite the fact that we generally recommend it, I think we need to gradually introduce users to concepts, so I don't think it should be in the quickstart guide.