First, we need to install eslint as a node module. Also install the react plugin if we are using React.

yarn add eslint — dev
yarn add eslint-plugin-react — dev

Then we can either initialize eslint using a script.

./node_modules/.bin/eslint --init

Or conveniently use this template (.eslintrc.json)

Then go to VSCode, Install ESLint extension and we are good to go.