-
-
Notifications
You must be signed in to change notification settings - Fork 98
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
Updated/Removed todos in Codebase Best Practices page #552
base: main
Are you sure you want to change the base?
Updated/Removed todos in Codebase Best Practices page #552
Conversation
- Removed todo comment about practice that is already implemented. - Fixed mistakes - Removed todo comment about store-related practice as it is not applicable.
--- | ||
title: Codebase Best Practices | ||
--- | ||
# Codebase Best Practices | ||
|
||
import { Steps } from '@astrojs/starlight/components'; |
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.
isn't this needed for the astro build?
|
||
## Styling a component | ||
|
||
We recommend styling components using our [design style guide](https://design-style-guide.freecodecamp.org/). | ||
We recommend styling components using our [`design style guide`](https://design-style-guide.freecodecamp.org/). |
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.
We recommend styling components using our [`design style guide`](https://design-style-guide.freecodecamp.org/). | |
We recommend styling components using our [design style guide](https://design-style-guide.freecodecamp.org/). |
@@ -20,13 +17,13 @@ We are striving to support right-to-left (RTL) layout in the codebase for langua | |||
|
|||
- Don't use `float` properties | |||
- Use Flexbox and Grid layouts instead, as they have RTL support already built-in, and those will be easier to maintain and review. | |||
- Don't define the direction while using `margin` and `padding`: it may seem harmless to use `padding-right` and `margin-left`, but these directions aren't mirrored when the layout changes to RTL, and adding counter values for them in the RTL file makes maintaining the codebase harder. | |||
- Don't define the direction while using `margin` and `padding` it may seem harmless to use `padding-right` and `margin-left`, but these directions aren't mirrored when the layout changes to RTL, and adding counter values for them in the RTL file makes maintaining the codebase harder. |
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.
- Don't define the direction while using `margin` and `padding` it may seem harmless to use `padding-right` and `margin-left`, but these directions aren't mirrored when the layout changes to RTL, and adding counter values for them in the RTL file makes maintaining the codebase harder. | |
- Don't define the direction while using `margin` and `padding`: it may seem harmless to use `padding-right` and `margin-left`, but these directions aren't mirrored when the layout changes to RTL, and adding counter values for them in the RTL file makes maintaining the codebase harder. |
why did you remove the colon?
- Use logical properties for them: You can add the same spacing by using `padding-inline-end` and `margin-inline-start`, and you won't need to worry about RTL layout, as they follow where the line starts and ends, and you won't need to add any extra values in the RTL files, so people won't need to remember to change the same values in two files. | ||
- Don't use `!important` in `font-family`: RTL layout uses different fonts compared to the LTR layout, when you add `!important` in the `font-family` property it affects the RTL layout too. | ||
- Don't use `!important` in `font-family` RTL layout uses different fonts compared to the LTR layout, when you add `!important` in the `font-family` property it affects the RTL layout too. |
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.
- Don't use `!important` in `font-family` RTL layout uses different fonts compared to the LTR layout, when you add `!important` in the `font-family` property it affects the RTL layout too. | |
- Don't use `!important` in `font-family`: RTL layout uses different fonts compared to the LTR layout, when you add `!important` in the `font-family` property it affects the RTL layout too. |
same here, why?
|
||
## General JavaScript | ||
|
||
In most cases, our [linter](/how-to-setup-freecodecamp-locally/#follow-these-steps-to-get-your-development-environment-ready) will warn of any formatting which goes against this codebase's preferred practice. | ||
In most cases, our [`linter`](/how-to-setup-freecodecamp-locally/#follow-these-steps-to-get-your-development-environment-ready) will warn of any formatting which goes against this codebase's preferred practice. |
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.
In most cases, our [`linter`](/how-to-setup-freecodecamp-locally/#follow-these-steps-to-get-your-development-environment-ready) will warn of any formatting which goes against this codebase's preferred practice. | |
In most cases, our [linter](/how-to-setup-freecodecamp-locally/#follow-these-steps-to-get-your-development-environment-ready) will warn of any formatting which goes against this codebase's preferred practice. |
:::note | ||
note | ||
Editors like VSCode are still likely to show you the file has been deleted | ||
and a new one created. If you use the CLI to `git add .`, then VSCode will show the | ||
file as renamed in the staging area. | ||
::: |
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.
isn't this the way astro make the note blocks? why did you remove it?
@@ -135,7 +129,7 @@ export const reducer = ( | |||
|
|||
### How to Dispatch | |||
|
|||
Within a component, import the actions and selectors needed. | |||
With in a component, import the actions and selectors needed. |
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.
With in a component, import the actions and selectors needed. | |
Within a component, import the actions and selectors needed. |
Within is perfectly good English
Checklist:
Update index.md
)Closes #393