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

Updated/Removed todos in Codebase Best Practices page #552

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

Conversation

shyam-cmd
Copy link

  • Removed todo comment about practice that is already implemented.
  • Fixed mistakes
  • Removed todo comment about store-related practice as it is not applicable.

Checklist:

Closes #393

- Removed todo comment about practice that is already implemented.
-  Fixed mistakes
- Removed todo comment about store-related practice as it is not applicable.
@shyam-cmd shyam-cmd requested a review from a team as a code owner January 18, 2025 09:40
Comment on lines -1 to -5
---
title: Codebase Best Practices
---
# Codebase Best Practices

import { Steps } from '@astrojs/starlight/components';
Copy link
Contributor

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/).
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
- 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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
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.

Comment on lines -52 to -56
:::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.
:::
Copy link
Contributor

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.
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
With in a component, import the actions and selectors needed.
Within a component, import the actions and selectors needed.

Within is perfectly good English

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.

Update/Remove Todos in the 'Codebase Best Practices' page
2 participants