ESLint Config Expo

raw JSON →
55.0.0 verified Sat Apr 25 auth: no javascript

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.

error Error [ERR_REQUIRE_ESM]: require() of ES Module
cause Using require() to import an ESM-only package in a CommonJS file.
fix
Use dynamic import: const expoConfig = (await import('eslint-config-expo')).default;
error ESLint couldn't find the plugin 'eslint-plugin-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.
fix
Ensure you have eslint-config-expo installed and your ESLint config uses the correct extends (just 'expo').
error Configuration for rule 'react-hooks/exhaustive-deps' is invalid.
cause Conflicting rule definitions in custom config override the recommended values.
fix
Check your .eslintrc for duplicate or malformed rule settings; consider removing overrides if not needed.
error Cannot find module '@typescript-eslint/parser'
cause Missing peer dependency for TypeScript support.
fix
npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin
breaking ESLint 9 flat config is not supported. Only ESLint 8.x (>=8.10) is compatible.
fix Downgrade to ESLint 8.x or use eslintrc format with ESLint 8.
deprecated The 'eslint-config-expo/flat' entry point is deprecated as of SDK 55. Use the default export for flat config in future versions.
fix import expo from 'eslint-config-expo'; instead of 'eslint-config-expo/flat'.
gotcha If using strict TypeScript, you must also install @typescript-eslint/parser and @typescript-eslint/eslint-plugin separately; they are not included.
fix npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin
gotcha CommonJS require() directly will fail with 'ERR_REQUIRE_ESM'. This package is ESM-only.
fix Use dynamic import or switch to ESM.
npm install eslint-config-expo
yarn add eslint-config-expo
pnpm add eslint-config-expo

Configure ESLint for an Expo project using either legacy eslintrc or flat config format, with ESLint 8.x.

// Install: npm install --save-dev eslint-config-expo eslint@>=8.10
// .eslintrc.js (CommonJS workaround)
module.exports = {
  extends: ['expo'],
  rules: {
    // Override rules if needed
  },
};

// or flat config in eslint.config.js (ESM)
import expo from 'eslint-config-expo/flat';
export default [
  ...expo,
  {
    rules: {
      'react/react-in-jsx-scope': 'off',
    },
  },
];

// Run: npx eslint .