{"id":19514,"library":"eslint-config-expo","title":"ESLint Config Expo","description":"Official ESLint configuration for Expo applications, maintained by the Expo team. Version 55.0.0 aligns with Expo SDK 55 and supports ESLint 8.x. Provides a consistent set of rules for Expo/React Native projects, including React, React Hooks, React Native, and Expo-specific best practices. Unlike generic React Native configs, this package includes rules tailored for Expo's file-based routing, Expo modules, and platform-specific code. Released in tandem with Expo SDK updates, typically on a monthly cadence. Key differentiators: first-class support for Expo Router, automatic detection of web vs native platforms, and integration with Expo's Metro bundler settings.","status":"active","version":"55.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/expo/expo","tags":["javascript","eslint-config","expo","react-native"],"install":[{"cmd":"npm install eslint-config-expo","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-expo","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-expo","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; ESLint 8.10+ required","package":"eslint","optional":false}],"imports":[{"note":"ESM-only since version 50 (SDK 50). Use dynamic import or assert type: 'module' in package.json if using require() in CommonJS.","wrong":"const expoConfig = require('eslint-config-expo');","symbol":"default config","correct":"import expoConfig from 'eslint-config-expo';"},{"note":"For CommonJS projects, dynamic import is required; direct require() throws 'ERR_REQUIRE_ESM'.","wrong":"const expoConfig = require('eslint-config-expo');","symbol":"default config (CommonJS workaround)","correct":"const expoConfig = (await import('eslint-config-expo')).default;"},{"note":"Type import is only available from version 50+. Use import type to avoid runtime errors.","wrong":"import { ESLintConfig } from 'eslint-config-expo';","symbol":"types","correct":"import type { ESLintConfig } from 'eslint-config-expo';"},{"note":"Since version 52, flat config is in a separate entrypoint. The default export is the legacy eslintrc config.","wrong":"import expo from 'eslint-config-expo';","symbol":"plugin reference (flat config)","correct":"import expo from 'eslint-config-expo/flat';"},{"note":"In eslintrc format, just 'expo' is enough; the full package name is not needed.","wrong":"extends: ['eslint-config-expo']","symbol":"plugin reference (legacy eslintrc)","correct":"module.exports = {\n  extends: ['expo'],\n};"}],"quickstart":{"code":"// Install: npm install --save-dev eslint-config-expo eslint@>=8.10\n// .eslintrc.js (CommonJS workaround)\nmodule.exports = {\n  extends: ['expo'],\n  rules: {\n    // Override rules if needed\n  },\n};\n\n// or flat config in eslint.config.js (ESM)\nimport expo from 'eslint-config-expo/flat';\nexport default [\n  ...expo,\n  {\n    rules: {\n      'react/react-in-jsx-scope': 'off',\n    },\n  },\n];\n\n// Run: npx eslint .","lang":"javascript","description":"Configure ESLint for an Expo project using either legacy eslintrc or flat config format, with ESLint 8.x."},"warnings":[{"fix":"Downgrade to ESLint 8.x or use eslintrc format with ESLint 8.","message":"ESLint 9 flat config is not supported. Only ESLint 8.x (>=8.10) is compatible.","severity":"breaking","affected_versions":">=55.0.0"},{"fix":"import expo from 'eslint-config-expo'; instead of 'eslint-config-expo/flat'.","message":"The 'eslint-config-expo/flat' entry point is deprecated as of SDK 55. Use the default export for flat config in future versions.","severity":"deprecated","affected_versions":"=55.0.0"},{"fix":"npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin","message":"If using strict TypeScript, you must also install @typescript-eslint/parser and @typescript-eslint/eslint-plugin separately; they are not included.","severity":"gotcha","affected_versions":">=50.0.0"},{"fix":"Use dynamic import or switch to ESM.","message":"CommonJS require() directly will fail with 'ERR_REQUIRE_ESM'. This package is ESM-only.","severity":"gotcha","affected_versions":">=50.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use dynamic import: const expoConfig = (await import('eslint-config-expo')).default;","cause":"Using require() to import an ESM-only package in a CommonJS file.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module"},{"fix":"Ensure you have eslint-config-expo installed and your ESLint config uses the correct extends (just 'expo').","cause":"The config references 'expo' plugin but it's not installed; it is bundled within eslint-config-expo, but some versions require explicit peer dependency.","error":"ESLint couldn't find the plugin 'eslint-plugin-expo'."},{"fix":"Check your .eslintrc for duplicate or malformed rule settings; consider removing overrides if not needed.","cause":"Conflicting rule definitions in custom config override the recommended values.","error":"Configuration for rule 'react-hooks/exhaustive-deps' is invalid."},{"fix":"npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin","cause":"Missing peer dependency for TypeScript support.","error":"Cannot find module '@typescript-eslint/parser'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}