It provides an initial structure for setting up a development/production environment for React using the airbnb style guide, eslint and prettier.
Let's check out the list of required VS Code plugins to enable the eslint and code formatting conventions.
To ensure that this extension is used over other extensions you may have installed, be sure to set it as the default formatter in your VS Code settings.
Ctrl+Shift+P -> Setting -> Preferences: Open Settings (JSON)
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
}
},
"devDependencies": {
"eslint": "^6.6.0",
"eslint-config-airbnb": "^18.1.0",
"eslint-config-prettier": "^6.11.0",
"eslint-plugin-import": "^2.21.2",
"eslint-plugin-prettier": "^3.1.3",
"eslint-plugin-react": "^7.20.0",
"eslint-plugin-react-hooks": "^4.0.4",
"prettier": "^2.0.5",
"prettier-eslint": "^11.0.0"
}
.eslintrc.json
File to set up the eslint/prettier conventions.
.eslintrc.json
File to set up the source code path for enabling the absolute import path.
.
├── public
├── src
│ ├── common
│ ├── components
| | ├── container
| | ├── presentational
| | ├── pages
│ ├── contexts
│ ├── reducers
│ ├── styles
└── .editorconfig
└── .eslintrc.json
└── .gitignore
└── jsconfig.json
└── package.json
└── README.md
In the project directory, you can run:
Runs the app in the development mode.
Open http://localhost:3000 to view it in the browser.
The page will reload if you make edits.
You will also see any lint errors in the console.
Launches the test runner in the interactive watch mode.
See the section about running tests for more information.
Builds the app for production to the build
folder.
It correctly bundles React in production mode and optimizes the build for the best performance.
The build is minified and the filenames include the hashes.
Your app is ready to be deployed!
See the section about deployment for more information.
You can learn more in the Create React App documentation.
To learn React, check out the React documentation.