I have been struggling with setting up linting and formatting for my React Native project for a while now. Despite following various tutorials, I still encounter setup issues.
My project consists of a Django backend and a React Native frontend. I began implementing the tutorial from https://reactnative.dev/docs/environment-setup using Expo, Yarn, and TypeScript in the src/frontend
directory.
After this initial setup, I tried to integrate ESLint and Prettier into the project without making any further changes. Below are the configuration files I utilized:
.eslintrc.js
/* Configuration settings for ESLint */
.prettierrc.json
{ "singleQuote": true }
tsconfig.json
{ "extends": "expo/tsconfig.base", "compilerOptions": {} }
Some of the errors that I am encountering include issues like import/namespace
, where it indicates "';' expected" for react-native
, variables being used before being defined (e.g., styles
), as well as parsing error messages related to mismatched configurations between @typescript-eslint/parser
and .eslintrc.js
.