Just got acquainted with React Hook Form, a great library for form management in React. It handles field registration, validations, error handling, and integrates smoothly with UI libraries.
#React#ReactHookForm
Customizing ESLint rules
We can modify the ESLint rules based on our usecase by adding it in the rules .eslintrc.json file.
"rules" : { "no-console": "off", "quotes": ["error","double"]}
This will apply rules like double quotes must be used instead of single quotes and so on
Setting up ESLint
1. Install Eslint using the command npm install eslint --save-dev.
2. Initialize an ESLint configuration for the project using the command ./node_modules/.bin/eslint --init
Configure Eslint to automatically format code and fix syntax error on save. To do this goto viewβ command pallete and search for Preferences: Open Workspace Settings (JSON) and add
{ "editor.codeActionsOnSave": {"source.fixAll.eslint": true},"eslint.validate": ["javascript"]}
Setting up project
1. Create a directory with a suitable name.
2. Navigate to the directory and execute npm init to initialize the project. This will create a package.json file which will contain all the dependencies of the project.
Explored ESLint recently from rules setup to error detection, it's been a valuable tool for improving code quality. Checkout out the thread below to see what I've learned!.
#ESLint#CodeQuality
ESLint is a tool for identifying, reporting and formatting code based on certain standards or rules so that the code is consistent and more readable with minimal errors. It can be integrated into VS code to check the code for syntax errors and highlight errors.
Explored Jest with React Testing Library and covered topics from test project setup to snapshot testing!
More details in the π§΅
#React#testing#Jest#ReactTesting