|
1 | 1 | # ⚙️ Project Configuration
|
2 | 2 |
|
3 |
| -The application has been bootstrapped using `Vite ` and its `react-ts` template. It allows us to create applications quickly without dealing with a complex tooling setup such as bundling, transpiling etc. |
| 3 | +The sample application has been bootstrapped using `Vite ` and its `react-ts` template. It allows us to create applications quickly without dealing with a complex tooling setup such as bundling, transpiling etc. |
4 | 4 |
|
5 |
| -Other popular ways we could have bootstrapped the application are: |
| 5 | +Other popular ways you can bootstrap the application are: |
6 | 6 |
|
7 | 7 | - [Next.js](https://nextjs.org/)
|
8 | 8 | - [Remix](https://remix.run/)
|
9 | 9 |
|
10 |
| -But for simplicity we will use Vite, as it doesn't force us to use the meta-framework specific things, and allows us to focus on React. |
| 10 | +For simplicity we will use Vite, as it doesn't force us to use the meta-framework specific things, and allows us to focus on React. |
11 | 11 |
|
12 | 12 | You should always configure and use the following tools:
|
13 | 13 |
|
14 | 14 | #### ESLint
|
15 | 15 |
|
16 |
| -ESLint is a linting tool for JavaScript. By providing specific configuration defined in the`.eslintrc.js` file it prevents developers from making silly mistakes in their code and enforces consistency in the codebase. |
| 16 | +ESLint serves as a valuable linting tool for JavaScript, helping developers in maintaining code quality and adhering to coding standards. By configuring rules in the `.eslintrc.js` file, ESLint helps identify and prevent common errors, ensuring code correctness and promoting consistency throughout the codebase. This approach not only helps in catching mistakes early but also enforces uniformity in coding practices, thereby enhancing the overall quality and readability of the code. |
17 | 17 |
|
18 | 18 | [ESLint Configuration Example Code](../.eslintrc.js)
|
19 | 19 |
|
20 | 20 | #### Prettier
|
21 | 21 |
|
22 |
| -Prettier is a great tool for formatting code. It enforces a consistent code style across your entire codebase. By utilizing the "format on save" feature in your IDE you can automatically format the code based on the configuration provided in the `.prettierrc` file. It will also give you good feedback when something is wrong with the code. If the auto-format doesn't work, something is wrong with the code. |
| 22 | +Prettier is a useful tool for maintaining consistent code formatting in your project. By enabling the "format on save" feature in your IDE, code is automatically formatted according to the rules set in the `.prettierrc` configuration file. This practice ensures a uniform code style across your codebase and provides helpful feedback on code issues. If the auto-formatting fails, it signals potential syntax error. Furthermore, Prettier can be integrated with ESLint to handle code formatting tasks alongside enforcing coding standards effectively throughout the development process. |
23 | 23 |
|
24 | 24 | [Prettier Configuration Example Code](../.prettierrc)
|
25 | 25 |
|
26 | 26 | #### TypeScript
|
27 | 27 |
|
28 |
| -ESLint is great for catching some of the bugs related to the language, but since JavaScript is a dynamic language ESLint cannot check data that run through the applications, which can lead to bugs, especially on larger projects. That is why TypeScript should be used. It is very useful during large refactors because it reports any issues you might miss otherwise. When refactoring, change the type declaration first, then fix all the TypeScript errors throughout the project and you are done. One thing you should keep in mind is that TypeScript does not protect your application from failing during runtime, it only does type checking during build time, but it increases development confidence drastically anyways. Here is a [great resource on using TypeScript with React](https://react-typescript-cheatsheet.netlify.app/). |
| 28 | +ESLint is effective for detecting language-related bugs in JavaScript. However, due to JavaScript's dynamic nature, ESLint may not catch all runtime data issues, especially in complex projects. To address this, TypeScript is recommended. TypeScript is valuable for identifying issues during large refactoring processes that may go unnoticed. When refactoring, prioritize updating type declarations first, then resolving TypeScript errors throughout the project. It's important to note that while TypeScript enhances development confidence by performing type checking at build time, it does not prevent runtime failures. Here is a [great resource on using TypeScript with React](https://react-typescript-cheatsheet.netlify.app/). |
29 | 29 |
|
30 | 30 | #### Husky
|
31 | 31 |
|
32 |
| -Husky is a tool for executing git hooks. Use Husky to run your code validations before every commit, thus making sure the code is in the best shape possible at any point of time and no faulty commits get into the repo. It can run linting, code formatting and type checking, etc. before it allows pushing the code. You can check how to configure it [here](https://typicode.github.io/husky/#/?id=usage). |
| 32 | +Husky is a valuable tool for implementing and executing git hooks in your workflow. By utilizing Husky to run code validations before each commit, you can ensure that your code maintains high standards and that no faulty commits are pushed to the repository. Husky enables you to perform various tasks such as linting, code formatting, and type checking before allowing code pushes. You can check how to configure it [here](https://typicode.github.io/husky/#/?id=usage). |
33 | 33 |
|
34 | 34 | #### Absolute imports
|
35 | 35 |
|
|
0 commit comments