{"id":19864495,"url":"https://github.com/karenyov/react-native-eslint-prettier","last_synced_at":"2026-04-14T10:31:31.987Z","repository":{"id":91383544,"uuid":"522311446","full_name":"karenyov/react-native-eslint-prettier","owner":"karenyov","description":"Enforcing Consistent and Error Free Code in an Expo React Native Project with TypeScript","archived":false,"fork":false,"pushed_at":"2022-08-07T20:24:03.000Z","size":17,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-03T22:55:53.449Z","etag":null,"topics":["eslint","expo","prettier","react-native"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/karenyov.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-08-07T19:58:12.000Z","updated_at":"2022-08-12T14:36:37.000Z","dependencies_parsed_at":null,"dependency_job_id":"8dd5480a-77e4-4789-9bea-549515354c33","html_url":"https://github.com/karenyov/react-native-eslint-prettier","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/karenyov/react-native-eslint-prettier","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenyov%2Freact-native-eslint-prettier","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenyov%2Freact-native-eslint-prettier/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenyov%2Freact-native-eslint-prettier/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenyov%2Freact-native-eslint-prettier/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/karenyov","download_url":"https://codeload.github.com/karenyov/react-native-eslint-prettier/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/karenyov%2Freact-native-eslint-prettier/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31793212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-14T02:24:21.117Z","status":"ssl_error","status_checked_at":"2026-04-14T02:24:20.627Z","response_time":153,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["eslint","expo","prettier","react-native"],"created_at":"2024-11-12T15:18:53.112Z","updated_at":"2026-04-14T10:31:31.968Z","avatar_url":"https://github.com/karenyov.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"# React Native EsLint Prettier for Expo.\nEnforcing Consistent and Error Free Code in an Expo React Native Project with TypeScript. \nTutorial Resume in this [link](https://justinnoel.dev/2020/07/20/enforcing-consistent-and-error-free-code-in-an-expo-react-native-project-with-typescript/).\n\n\n\u003e Improve your team's code quality and efficiency by using ESLint, Prettier to automate formatting and consistency checks.\n\n## Configure ESLint for TypeScript\nFirst, we need to get ESLint configured to support TypeScript:\n\n```sh\n\nnpm add --dev eslint @typescript-eslint/parser @typescript-eslint/eslint-plugin\n\n```\n\nNow, let's add an .eslintrc file in our project's root directory so that it looks like this:\n```\n{\n  \"root\": true,\n  \"parser\": \"@typescript-eslint/parser\",\n  \"plugins\": [\n    \"@typescript-eslint\"\n  ],\n  \"extends\": [\n    \"eslint:recommended\",\n    \"plugin:@typescript-eslint/eslint-recommended\",\n    \"plugin:@typescript-eslint/recommended\"\n  ]\n}\n```\n\nNext, we'll need to add an .eslintignore file to ensure our linter doesn't go to crazy and start linting every directory in our project:\n```\nnode_modules\ndist\n.expo\n.expo-shared\nweb-build\n```\n\nNow, we'll need to add a lint script to our package.json:\n```\n{\n...,\n\"lint\": \"eslint . --ext .ts,.tsx,.js,.jsx,.json\",\n\"lint-and-fix\": \"eslint . --ext .ts,.tsx,.js,.jsx,.json --fix\",\n...\n}\n```\nThe two script above will let you npm run lint or ```npm run lint-and-fix``` to see/fix all the linting errors in your project.\n\n## Installing and Configuring Prettier\nTo install Prettier, run this command\n\n```\nyarn add --dev prettier\n```\n\nNow, we need to add the magic sauce to keep all your files formatted just the way your team likes (after arguing for a few days).\n\nAdd a .prettierrc file to look something like this:\n```\n{\n  \"semi\": true,\n  \"trailingComma\": \"all\",\n  \"singleQuote\": false,\n  \"printWidth\": 80\n}\n```\n\nWe also need to keep Prettier and ESLint from whacking each other over the head. Modify your .eslintrc file to look like this:\n```\n{\n  \"root\": true,\n  \"parser\": \"@typescript-eslint/parser\",\n  \"plugins\": [\"react\", \"@typescript-eslint\", \"prettier\"],\n  \"extends\": [\n    \"eslint:recommended\",\n    \"plugin:@typescript-eslint/eslint-recommended\",\n    \"plugin:@typescript-eslint/recommended\",\n    \"prettier\"\n  ]\n}\n```\n\nFinally, add a script to package.json to run prettier on all your existing files:\n\n```\n\"prettier-format\": \"prettier --config --write \\\"src/**/*.{js,jsx,tsx,ts}\\\"\"\n```\n\n\nNow, run ```npm run prettier-format``` and watch it automagically format many of the files in our project. Just like that, we've updated the formatting for every file in the project. Now, if a team member modifies one of those files days or weeks later, their PR won't be polluted with tons of formatting changes that hide their real changes.\n\n## VSCode Configs \nAll settings for VSCode are in ```.vscode/settings.json``` file.\n\n\u003e OBS: Add comment ```// eslint-disable-next-line no-undef``` for lines ignore validation in code.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarenyov%2Freact-native-eslint-prettier","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkarenyov%2Freact-native-eslint-prettier","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkarenyov%2Freact-native-eslint-prettier/lists"}