If you are not familiar with linters, read root level README.
Please do the following steps in this order:
- In the first commit of your feature branch create a
.github/workflows
folder and add a copy of.github/workflows/linters.yml
to that folder.- Remember to use the file linked above
- Remember that
.github
folder starts with a dot.
- Do not make any changes in config files - they represent style guidelines that you share with your team - which is a group of all Microverse students.
- If you think that change is necessary - open a Pull Request in this repository and let your code reviewer know about it.
- When you open your first pull request you should see the result of the GitHub actions checks:
Click on the Details
link of each action to see the full output and the errors that need to be fixed:
Note: The npm
package manager is going to create a node_modules
directory to install all of your dependencies. You shouldn't commit that directory. To avoid that, you can create a .gitignore
file and add node_modules
to it:
# .gitignore
node_modules/
An open-source, automated tool for improving the quality of web pages. It has audits for performance, accessibility, progressive web apps, SEO and more.
You can get the Lighthouse report by any of the following ways:
To access the report generated by Lighthouse on your pull request, click the Details
link for the Linters/Lighthouse
check and you will see the full output of the action:
A customizable linting tool that helps you improve your site's accessibility, speed, cross-browser compatibility, and more by checking your code for best practices and common errors.
NOTE: If you are running on Windows, you need to initialize npm to create package.json
file.
npm init -y
- Run
not sure how to use npm? Read this.
npm install --save-dev [email protected]
- Copy .hintrc to the root directory of your project.
- Do not make any changes in config files - they represent style guidelines that you share with your team - which is a group of all Microverse students.
- If you think that change is necessary - open a Pull Request in this repository and let your code reviewer know about it.
- Run
npx hint .
- Fix validation errors.
A mighty, modern linter that helps you avoid errors and enforce conventions in your styles.
-
Run
npm install --save-dev [email protected] [email protected] [email protected] [email protected]
not sure how to use npm? Read this.
-
Copy .stylelintrc.json to the root directory of your project.
-
Do not make any changes in config files - they represent style guidelines that you share with your team - which is a group of all Microverse students.
- If you think that change is necessary - open a Pull Request in this repository and let your code reviewer know about it.
-
Run
npx stylelint "**/*.{css,scss}"
on the root of your directory of your project. -
Fix linter errors.
-
IMPORTANT NOTE: feel free to research auto-correct options for Stylelint if you get a flood of errors but keep in mind that correcting style errors manually will help you to make a habit of writing a clean code!
-
Run
npm install --save-dev [email protected] [email protected] [email protected] [email protected]
not sure how to use npm? Read this.
-
Copy .eslintrc.json to the root directory of your project.
-
Do not make any changes in config files - they represent style guidelines that you share with your team - which is a group of all Microverse students.
- If you think that change is necessary - open a Pull Request in this repository and let your code reviewer know about it.
-
Run
npx eslint .
on the root of your directory of your project. -
Fix linter errors.
-
IMPORTANT NOTE: feel free to research auto-correct options for Eslint if you get a flood of errors but keep in mind that correcting style errors manually will help you to make a habit of writing a clean code!