Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 12, 2022 07:18 pm GMT

Configuration ESLint and Prettier in a project React.

ESLINT
1.- Install ESLint

npm install eslint --save-dev

2.- Initialize ESLint

npx eslint --init 

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

npx eslint . --fix

PRETTIER
1.- Install configuration prettier and eslint

npm i eslint-config-prettier -D

2.- Install prettier

npm i prettier -D  

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

Original Link: https://dev.to/reynaldoz/configuration-eslint-and-prettier-in-a-project-react-2m7i

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To