First, make sure you have the following installed:
- Visual Studio Code
- Node.js - v16.x.x
- npm - v8.x.x
Then, once you have npm
, run the following command to install yarn if you don't already have it:
npm install --global yarn
ESLint allows us to keep our code consistent and adherent to a certain code style. It can also format our code on save in VSCode. To enable this (and please do), open the command palette in VSCode and open Preferences: Open Workspace Settings (JSON). Now add the following settings into the JSON file:
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"eslint.validate": ["javascript"]
Now when you save a file, VSCode will format it to adhere to our ESLint configuration.
- Auto Rename Tag — useful for JSX
- ESLint — required
- Error Lens — highly recommended
- GitLens — see who edited any line of code while you're editing
Make sure you have all the necessary packages installed:
yarn # or yarn install
Then, you can run the development server:
yarn dev
Open http://localhost:3000 with your browser to see the result.
To learn more about Next.js, take a look at the following resources:
- Next.js Documentation - learn about Next.js features and API.
- Learn Next.js - an interactive Next.js tutorial.
You can check out the Next.js GitHub repository - your feedback and contributions are welcome!