Registry / devops / eslint-config-expo

eslint-config-expo

JSON →
library55.0.0jsnpmunverified

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.

npm install eslint-config-expo
INSTALL
IMPORT
SIG · ESLINT-CONFIG-EXPO
E
eslint-config-expo
devopsjavascriptv55.0.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default config
import expoConfig from 'eslint-config-expo';
const expoConfig = require('eslint-config-expo');
ESM-only since version 50 (SDK 50). Use dynamic import or assert type: 'module' in package.json if using require() in CommonJS.
default config (CommonJS workaround)
const expoConfig = (await import('eslint-config-expo')).default;
const expoConfig = require('eslint-config-expo');
For CommonJS projects, dynamic import is required; direct require() throws 'ERR_REQUIRE_ESM'.
types
import type { ESLintConfig } from 'eslint-config-expo';
import { ESLintConfig } from 'eslint-config-expo';
Type import is only available from version 50+. Use import type to avoid runtime errors.
plugin reference (flat config)
import expo from 'eslint-config-expo/flat';
import expo from 'eslint-config-expo';
Since version 52, flat config is in a separate entrypoint. The default export is the legacy eslintrc config.
plugin reference (legacy eslintrc)
module.exports = { extends: ['expo'], };
extends: ['eslint-config-expo']
In eslintrc format, just 'expo' is enough; the full package name is not needed.

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 .
Debug
Known issues
breakingESLint 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.
affects: >=55.0.0
deprecatedThe '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'.
affects: =55.0.0
gotchaIf 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
affects: >=50.0.0
gotchaCommonJS require() directly will fail with 'ERR_REQUIRE_ESM'. This package is ESM-only.
fix
Use dynamic import or switch to ESM.
affects: >=50.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module
Using require() to import an ESM-only package in a CommonJS file.
fix
Use dynamic import: const expoConfig = (await import('eslint-config-expo')).default;
ESLint couldn't find the plugin 'eslint-plugin-expo'.
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').
Configuration for rule 'react-hooks/exhaustive-deps' is invalid.
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.
Cannot find module '@typescript-eslint/parser'
Missing peer dependency for TypeScript support.
fix
npm install --save-dev @typescript-eslint/parser @typescript-eslint/eslint-plugin
Upgrade
Version history
55.0.0latest on npm
Audit
Dependencies
eslintrequiredPeer dependency; ESLint 8.10+ required
Agent activity
9 hits · last 30 days
node
8
Resources
eslint-config-expo — npm install eslint-config-expo · libregistry