In Memory Pair Game Project:
- Create package.json
- Install eslint, prettier and pluginf for code editor/IDE
- Read explanations to all errors forund by eslint according to eslint-config-airbnb
- Create package in a directory: Option 1:
npm init
This option will start interactive wizzard. If you are ok with using default setting, use this:
npm init --yes
-
Install the packages: eslint - the linter itself
eslint-plugin-import - required by ESLint to install other plugins
eslint-config-airbnb-base - ESlint config following Airbnb JavaScript style guide.
prettier - the code formatter
eslint-config-prettier, eslint-plugin-prettier - config and plugin to connect ESlint and Prettier and avoid conflicting rules -
Setup the tools: in your eslint config (may be located in
package.json
or in separate file.eslintrc
add the integrations:
{
"extends": ["airbnb", "prettier"],
"plugins": ["prettier"],
"rules": {
"prettier/prettier": ["error"]
},
}
- Add plugins for ESLint and Prettier to the code editor or IDE.