How to configure ESLint and Prettier for Expo projects
In Expo projects, eslint and prettier are doesn’t configured by default. So we need to configure ourselves. For this reason, Expo team made a package named eslint-config-universe to configure these tools. Lets begin how to configure this package to our project.
We can add eslint-config-universe for development dependices as below:
yarn add -D eslint-config-universe
Also we need to install another helper dependencies such as eslint, prettier etc.
yarn add -D eslint prettier @typescript-eslint/eslint-plugin @typescript-eslint/parser
We can use extends option to import this config to our project. We can change package.json by adding eslintConfigsection as follows:
For prettier configuration, lets create a .prettierrc file with contents like this:
From my perspective, Eslint and Prettier are vital for development. And in expo projects you can easily configure with eslint-config-universe.
See you in my next post ✌️