Configuration ESLint and Prettier in a project React.

reynaldoz

Reynaldo Quispe Soca

Posted on April 12, 2022

Configuration ESLint and Prettier in a project React.

ESLINT
1.- Install ESLint

npm install eslint --save-dev
Enter fullscreen mode Exit fullscreen mode

2.- Initialize ESLint

npx eslint --init 
Enter fullscreen mode Exit fullscreen mode

3.- answer questions as seen in the following image for configuration
Image description
4.- To fix a project you use

npx eslint . --fix
Enter fullscreen mode Exit fullscreen mode

PRETTIER
1.- Install configuration prettier and eslint

npm i eslint-config-prettier -D
Enter fullscreen mode Exit fullscreen mode

2.- Install prettier

npm i prettier -D  
Enter fullscreen mode Exit fullscreen mode

3.- Create file .prettierrc.json and inside this file write your configuration..
4.- In configuration .JSON write

"editor.formatOnPaste": true,
"editor.formatOnSave": true,
"editor.formatOnType": true,
"prettier.eslintIntegration": true
Enter fullscreen mode Exit fullscreen mode
💖 💪 🙅 🚩
reynaldoz
Reynaldo Quispe Soca

Posted on April 12, 2022

Join Our Newsletter. No Spam, Only the good stuff.

Sign up to receive the latest update from our blog.

Related