feat(tools): remove eslint-plugin-prettier for prettier (#42438)

* feat: remove eslint-plugin-prettier for prettier

This removes the annoying lint warnings when all that needs to change is
formatting

* fix: use .js lint-staged config to ignore properly

* fix: lint everything if a lot of files are changed

It's faster than making lots of individual linter calls

* chore: apply prettier

* fix: ignore code in curriculum-file-structure
This commit is contained in:
Oliver Eyton-Williams
2021-10-06 17:32:21 +02:00
committed by GitHub
parent 8518079316
commit c8d7f0a782
152 changed files with 905 additions and 735 deletions

View File

@ -81,7 +81,7 @@ If you have queries about the stack, architecture of the codebase, translations,
| Nicholas Carrigan | [@nhcarrigan](https://forum.freecodecamp.org/u/nhcarrigan) |
| Oliver Eyton-Williams | [@ojeytonwilliams](https://forum.freecodecamp.org/u/ojeytonwilliams) |
| Rafael D Hernandez | [@RafaelHernandez](https://forum.freecodecamp.org/u/rafaelhernandez) |
| Shaun Hamilton | [@sky020](https://forum.freecodecamp.org/u/sky020) |
| Shaun Hamilton | [@sky020](https://forum.freecodecamp.org/u/sky020) |
| Tom Mondloc | [@moT01](https://forum.freecodecamp.org/u/moT01) |
**You can email our developer staff at: `dev[at]freecodecamp.org`**

View File

@ -1,3 +1,3 @@
## Our contributing docs are available here: <https://contribute.freecodecamp.org>.
Looking to edit these docs? Read [this document](how-to-work-on-the-docs-theme.md) first.
Looking to edit these docs? Read [this document](how-to-work-on-the-docs-theme.md) first.

View File

@ -15,6 +15,7 @@ There are a few terms we use when discussing our curriculum content.
Using those terms, here is how the file structure would be defined:
<!-- prettier-ignore -->
```md
curriculum/
@ -64,7 +65,7 @@ When renaming a certification, you will likely want to rename the associated sup
Also, you will likely want to rename the certificate and the `{superBlock}-projects` block when you rename a superBlock since they all shares a name. To rename only a superBlock you need to:
1. Rename the superBlock folder in the `curriculum/challenges/english` directory.
1. Rename the superBlock folder in *all* other `curriculum/challenges/{language}` directories.
1. Rename the superBlock folder in _all_ other `curriculum/challenges/{language}` directories.
1. For each block within that superBlock, update the `superBlock` value in the `meta.json` file to its dashedName. You don't need to rename any folders here. Do that when renaming a block.
1. Rename the superblock folder in `client/src/pages/learn`.
1. Update the `index.md` file in the above folder, changing the `title` and `superBlock` values to the new name.
@ -81,7 +82,7 @@ Also, you will likely want to rename the certificate and the `{superBlock}-proje
When renaming a curriculum block, you need to:
1. Change the name of the block folder in the `curriculum/challenges/english/{superBlock}` directory.
1. Change the name of the same block folder in *all* of the other language directories to match. These must all be the same as the English structure or the build will error out.
1. Change the name of the same block folder in _all_ of the other language directories to match. These must all be the same as the English structure or the build will error out.
1. Change the name of the block folder in the `_meta` directory.
1. Update the `name` and `dashedName` property for that block's `meta.json` file.
1. Update the `client/utils/help-category-map.json` to use the new block name as the key.
@ -96,7 +97,7 @@ When renaming a single challenge file, you need to:
1. Change the name of the challenge file in the `curriculum/challenges/english` directory.
1. Change the name of the `title` and `dashedName` within that file.
1. Change the name of the file, and the `dashedName` in those files for *all* of the other language directories to match.
1. Change the name of the file, and the `dashedName` in those files for _all_ of the other language directories to match.
1. Update the name of the challenge in the relevant `meta.json` file. The challenge names here are not used in the build, but provide a user-friendly way to identify the challenge order.
1. If the challenge is a certificate project, update the YAML file in `curriculum/english/12-certificates/<superBlock>` to the new name.
1. If the challenge is a certificate project, update the `title` and `link` in `client/src/resources/cert-and-project-map.ts`

View File

@ -30,6 +30,7 @@ docker stop mailhog
to stop it.
When the installation completes, you can start [using MailHog](#using-mailhog).
</details>
<details><summary>Installing MailHog on macOS</summary>
@ -44,6 +45,7 @@ brew services start mailhog
The above commands will start a mailhog service in the background.
When the installation completes, you can start [using MailHog](#using-mailhog).
</details>
<details><summary>Installing MailHog on Windows</summary>
@ -55,6 +57,7 @@ When the download completes, click to open the file. A Windows firewall notifica
Close MailHog by closing the command prompt window. To start MailHog again, click on the MailHog executable (.exe) file that was downloaded initially - it is not necessary to download a new MailHog installation file.
Start [using MailHog](#using-mailhog).
</details>
<details><summary>Installing MailHog on Linux</summary>
@ -96,6 +99,7 @@ mailhog
```
Start [using MailHog](#using-mailhog).
</details>
## Using MailHog

View File

@ -8,7 +8,6 @@ The video challenge pages are created by members of the freeCodeCamp team. YouTu
You can help by creating multiple-choice questions related to video sections and adding the questions to the markdown files for the video challenges.
## Challenge Template
Below is a template of what the challenge markdown files look like.
@ -27,9 +26,7 @@ forumTopicId: 12345
Challenge description text, in markdown
```html
<div>
example code
</div>
<div>example code</div>
```
# --question--
@ -55,7 +52,6 @@ More answers
## --video-solution--
The number for the correct answer goes here.
````
## Creating questions for video challenges
@ -76,6 +72,7 @@ Pick a challenge markdown file from the options above.
First, find the videoId.
For example, in the following code from the header of a video challenge markdown file, the videoId is "nVAaxZ34khk". On GitHub, the information should be laid out in a table format.
```
---
id: 5e9a093a74c4063ca6f7c14d
@ -86,7 +83,7 @@ videoId: nVAaxZ34khk
```
Next, access the YouTube video with that `videoId`. The URL for the video will be:
https://www.youtube.com/watch?v=[videoId] (replace `videoId` in the URL with the video's ID - without square brackets)
https://www.youtube.com/watch?v=[videoId] (replace `videoId` in the URL with the video's ID - without square brackets)
In the example above, the URL is https://www.youtube.com/watch?v=nVAaxZ34khk
@ -122,12 +119,14 @@ More answers
1
```
Add/Update the question text under the part that shows:
Add/Update the question text under the part that shows:
```
# --question--
## --text--
```
Add/Update answers (`Answer 1`, `Answer 2`, and so on) under `## --answers--`. Make sure to update the number under `## --video-solution--` with the correct answer number. You can add more possible answers using the same format. The question and answers can be surrounded with quotation marks.
### Question examples
@ -136,14 +135,16 @@ Add/Update answers (`Answer 1`, `Answer 2`, and so on) under `## --answers--`. M
# --question--
## --text--
What does this JavaScript code log to the console?
```js
console.log('hello world');
```
## --answers--
hello *world*
hello _world_
---
@ -156,11 +157,11 @@ hello world
---
## --video-solution--
3
````
````md
# --question--
## --text--

View File

@ -19,12 +19,12 @@ When opening a Pull Request(PR), you can use the below to determine the type, sc
**Type:**
| Type | When to select |
| :---- | :--------------------------------------------------------------------------- |
| Type | When to select |
| :---- | :------------------------------------------------------------------------------- |
| fix | Changed or updated/improved functionality, tests, the verbiage of a lesson, etc. |
| feat | Only if you are adding new functionality, tests, etc. |
| chore | Changes that are not related to code, tests, or verbiage of a lesson. |
| docs | Changes to `/docs` directory or the contributing guidelines, etc. |
| feat | Only if you are adding new functionality, tests, etc. |
| chore | Changes that are not related to code, tests, or verbiage of a lesson. |
| docs | Changes to `/docs` directory or the contributing guidelines, etc. |
**Scope:**
@ -135,37 +135,37 @@ When you are working on features for our upcoming curriculum `next-*` branches,
a. Either delete your local branch after taking a backup (if you still have it locally):
```console
git checkout <pr-branch-name>
```console
git checkout <pr-branch-name>
# example:
# git checkout feat/add-numpy-video-question
# example:
# git checkout feat/add-numpy-video-question
git checkout -b <backup-branch-name>
git checkout -b <backup-branch-name>
# example:
# git checkout -b backup-feat/add-numpy-video-question
# example:
# git checkout -b backup-feat/add-numpy-video-question
git branch -D <pr-branch-name>
```
git branch -D <pr-branch-name>
```
b. Or just a backup of your pr branch (if you do not have it locally):
```console
git checkout -b <backup-branch-name> origin/<pr-branch-name>
```console
git checkout -b <backup-branch-name> origin/<pr-branch-name>
# example:
# git checkout -b backup-feat/add-numpy-video-question origin/feat/add-numpy-video-question
```
# example:
# git checkout -b backup-feat/add-numpy-video-question origin/feat/add-numpy-video-question
```
4. Start off with a clean slate:
3. Start off with a clean slate:
```console
git checkout -b <pr-branch-name> next-python-projects
git cherry-pick <commit-hash>
```
5. Resolve any conflicts, and cleanup, install run tests
4. Resolve any conflicts, and cleanup, install run tests
```console
npm run clean
@ -179,7 +179,7 @@ When you are working on features for our upcoming curriculum `next-*` branches,
```
6. If everything looks good push back to the PR
5. If everything looks good push back to the PR
```console
git push --force origin <pr-branch-name>

View File

@ -49,7 +49,7 @@ We highly recommend installing [Visual Studio Code](https://code.visualstudio.co
Essentially, you will edit and store your code on Ubuntu-18.04 with VS Code installed on Windows.
If you use [IntelliJ Idea](https://www.jetbrains.com/idea/), you may need to update your Node interpreter and Npm package manager to what is installed on your WSL distro.
If you use [IntelliJ Idea](https://www.jetbrains.com/idea/), you may need to update your Node interpreter and Npm package manager to what is installed on your WSL distro.
You can check these settings by going to Settings > Languages & Frameworks > Node.js and NPM.

View File

@ -144,7 +144,7 @@ For the video challenges, you need to change a few things. First add the new loc
...
```
Then add an id for the new language to any video challenge in an audited block. For example, if `auditedCerts` in `all-langs.js` includes `scientific-computing-with-python` for `dothraki`, then you must add a `dothraki` entry in `videoLocaleIds`. The frontmatter should then look like this:
Then add an id for the new language to any video challenge in an audited block. For example, if `auditedCerts` in `all-langs.js` includes `scientific-computing-with-python` for `dothraki`, then you must add a `dothraki` entry in `videoLocaleIds`. The frontmatter should then look like this:
```yml
videoLocaleIds:

View File

@ -12,4 +12,4 @@ If you see messages like
bash: change_volumes_owner.sh: No such file or directory
```
when you `npm run docker:init` this is likely the culprit.
when you `npm run docker:init` this is likely the culprit.

View File

@ -287,7 +287,7 @@ Challenges should have the minimum number of tests necessary to verify that a ca
Our goal is to communicate the single point that the challenge is trying to teach, and test that they have understood that point.
Challenge tests can make use of the Node.js and Chai.js assertion libraries. Also, if needed, user-generated code can be accessed in the `code` variable. In addition, the `__helpers` object exposes several functions that simplify the process of writing tests. The available functions are defined in _client/src/utils/curriculum-helpers.ts_.
Challenge tests can make use of the Node.js and Chai.js assertion libraries. Also, if needed, user-generated code can be accessed in the `code` variable. In addition, the `__helpers` object exposes several functions that simplify the process of writing tests. The available functions are defined in _client/src/utils/curriculum-helpers.ts_.
## Formatting seed code

View File

@ -84,6 +84,7 @@ One really neat trick is that you can also create custom one-off templates just
```sh
npm run zip
```
## Other Reference and resources
### PostCSS Features Used

View File

@ -1,6 +1,7 @@
This page describes how to contribute to the freeCodeCamp tutorials and projects that are completed using the CodeRoad VS Code extension.
## How the tutorials work
The freeCodeCamp tutorials that use CodeRoad each have their own repo under the freeCodeCamp GitHub organization. They all start with `learn-`. For example, `https://github.com/freeCodeCamp/learn-bash-by-building-a-boilerplate/`.
Each tutorial repo has a `main` branch and a "version" branch, e.g. `v1.0.0`.
@ -20,11 +21,13 @@ In order to make changes to commits on a version branch, you would need to rebas
## How to contribute
### Prerequisites
Install the [CodeRoad CLI tools](https://www.npmjs.com/package/@coderoad/cli) with `npm install -g @coderoad/cli`.
There have been some issues with the latest version. If `coderoad --version` doesn't work after installing, downgrade to `0.7.0` with `npm install -g @coderoad/cli@0.7.0`.
### Working on `main`
This set of instructions is for PRs that only make minor changes on `main` to **existing lessons**. That mainly consists of typo, grammar, hint, and instructional changes or fixes in the `TUTORIAL.md` file.
For everything else, including adding or deleting lessons, follow the [working on a version branch instructions](#working-on-version-branch). You will not need to create a new version branch for this - you can create a PR following the instructions below.
@ -47,12 +50,14 @@ Follow these instructions to make a PR, keeping in mind that instructions usuall
- Make a PR
### Testing changes on `main`
If you want to test your changes to `main` after using the above instructions, follow these instructions:
- Follow the instructions on the [rdb-alpha repo](https://github.com/freeCodeCamp/rdb-alpha) to run a container
- Start the tutorial using the `tutorial.json` file on the new branch
### Reviewing PR's to `main`
If reviewing a PR that only changes `main` with instructional or grammar issues as described above, the changes in `TUTORIAL.md` should match the changes in `tutorial.json`.
The `tutorial.json` file should not have changes to commit hashes, or step/level ids. Startup or level commands or file watchers likely should not be changed either. There are exceptions if there's an issue with a step, but they should be treated with more caution.
@ -60,6 +65,7 @@ The `tutorial.json` file should not have changes to commit hashes, or step/level
Also, keep in mind that instructions usually use the lessons around them for context, so make sure they make sense.
### Working on version branch
> [!WARNING]
>
> Reminder: Never make or push changes to a version branch that is on one of the freeCodeCamp repos. Always create a new one
@ -86,10 +92,12 @@ Follow these instructions to create a new version:
- Leave it here for reviewers
### Testing changes to a version branch
- Follow the instructions on the [rdb-alpha repo](https://github.com/freeCodeCamp/rdb-alpha) to run a container
- Start the tutorial using the `tutorial.json` file on whatever fork the changes are on. Make sure to use the file on the `feat: version-X.X.Y` branch and not the `main` branch
### Pushing a new version
Before pushing a new version, view the new `feat/version-vX.X.Y` (will be merged to `main`) branch on the user's fork. Make sure there are additions to the `CHANGELOG.md` file that include the new changes, and the version in the two spots of `coderoad.yaml` matches the new version branch.
If you have write access to the freeCodeCamp repo, have verified the `CHANGELOG` and `coderoad.yaml` files, have tested the changes using the instructions above, and want to push a new version of a tutorial:
@ -114,13 +122,17 @@ If you have write access to the freeCodeCamp repo, have verified the `CHANGELOG`
- Finally, if any PRs for this version exists, close them
### How to revert to a previous version
- Create a new branch off the latest `main` with `git checkout -b revert/to-version-X.X.X`
- Revert all commits on this branch up to and including the commit of the version after the one you want to revert to. For example, you may have commits that look like this:
```
fix: typo
release: version 1.0.1
fix: typo
release: version 1.0.0
```
If you want to revert to v1.0.0, revert all the commits from `release: version 1.0.1` and after
- Create a PR. Give it a title of `revert: to version X.X.X`