Module 0: Environment Setup

Setting up a professional React development environment with Vite, ESLint, and Prettier.

🚀 Goodbye Create React App (CRA)

For years, create-react-app was the standard. It is now deprecated. The industry standard for Single Page Applications (SPAs) is Vite (pronounced "veet"). It is significantly faster and leaner.

1. Install Node.js (LTS)

Ensure you have the Long Term Support (LTS) version of Node.js installed.

node -v
# Should be v18.x.x or v20.x.x

2. Create a Vite Project

We will use TypeScript, as it is the industry standard for React development.

npm create vite@latest my-react-app -- --template react-ts
cd my-react-app
npm install

3. Configure VS Code

Install these extensions for the best experience:

4. Setup Linting & Formatting

Consistency is key. We'll set up Prettier to run on save.

Create .prettierrc:

{
  "semi": true,
  "singleQuote": true,
  "tabWidth": 2,
  "trailingComma": "es5"
}

Update VS Code Settings (.vscode/settings.json):

{
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }
}

5. Run the App

npm run dev

Open the URL shown in the terminal (usually http://localhost:5173).

Next: Module 0.5 - JS Prerequisites →