There is another easy and effective way to restrict prettier errors, as I was unable to locate my eslint.js or eslint.json file.
Create a file named .prettierignore in the root of the project
Now paste the names of all the folders or files that you don't want the prettier to work. One simple way is to add the name of your root folder for your screens or components.
For my app, all the screens were in the component folder so I added component folder in the file. Below is the content I added in .prettier
node_modulesbuilddistandroidioscomponents