Linting CSS in Create React App project

Install dependencies # Yarn yarn add -D stylelint stylelint-config-standard # NPM npm install -D stylelint stylelint-config-standard Configure your stylelint "stylelint": { "extends": [ "stylelint-config-standard" ] } Add script to your package.json "lint:css": "stylelint src/**/*.css" Stylelint with Prettier Install dependencies # Yarn yarn add -D stylelint-prettier stylelint-config-prettier # NPM npm install -D stylelint-prettier stylelint-config-prettier Configure your … Continue reading Linting CSS in Create React App project

Setting up Prettier for Create React App

Install dependencies # Yarn yarn add -D prettier eslint-config-prettier eslint-plugin-prettier # NPM npm install -D prettier eslint-config-prettier eslint-plugin-prettier By default your eslintConfig looks like this: "eslintConfig": { "extends": [ "react-app", "react-app/jest" ] } Let's add Prettier and Prettier React to the extends array: "eslintConfig": { "extends": [ "react-app", "react-app/jest", "plugin:prettier/recommended", "prettier/react" ] } Your editor … Continue reading Setting up Prettier for Create React App