Registry / testing / metro-eslint

metro-eslint

JSON →
library0.0.5jsnpmunverified

Metro is the JavaScript bundler for React Native, providing fast reload cycles, scalable module bundling, and deep integration with React Native projects. This package, metro-eslint, is an ESLint plugin for Metro. Current stable version is 0.84.3 (released regularly, with breaking changes only in major versions). Key differentiators: sub-second HMR, built-in support for React Native's platform-specific extensions, and advanced caching. Alternatives: Webpack with React Native web support, but Metro is the default and recommended bundler for React Native. This specific package provides ESLint rules tailored to Metro's resolution and configuration.

npm install metro-eslint
INSTALL
IMPORT
SIG · METRO-ESLINT
M
metro-eslint
testingjavascriptv0.0.5
Install
—
Import
—
Disk
—
Pass rate
0/ 6
Env Coverage0 / 6
glibc
18–22
musl
18–22
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 18–226 runs
build_error
glibc
node 18–226 runs
build_error
Code
Verified usage

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

default
✓ import metroPlugin from 'metro-eslint'
✗ const metroPlugin = require('metro-eslint').default
ESM-only; CJS require returns the esModule, but .default is needed only if using named export.
configs
✓ import { configs } from 'metro-eslint'
✗ const configs = require('metro-eslint').configs
Named export for accessing built-in configs.
rules
✓ import { rules } from 'metro-eslint'
✗ const rules = require('metro-eslint').rules
Named export for custom rule configurations.

Minimal setup for using metro-eslint plugin in an ESLint configuration file.

// Add to .eslintrc.cjs module.exports = { plugins: ['metro'], extends: ['plugin:metro/recommended'], rules: { 'metro/no-env-with-spread': 'error', }, };
Debug
Known issues
breakingDropped support for Node.js v21, v23, and LTS minors released before v20.19 in v0.84.0.
fix
Upgrade Node.js to v20.19 or later, or v22.
affects: >=0.84.0 <0.85.0
deprecatedThe require('metro-config') pattern is deprecated in favor of ESM imports as of v0.83.0.
fix
Use import { mergeConfig } from 'metro-config' instead.
affects: >=0.83.0
gotchaConfig files must use .cjs extension when using CommonJS; .mjs or .js are treated as ESM.
fix
Use module.exports in .cjs files, or export default in .mjs/.js files.
affects: >=0.83.0
breakingMetro v0.83.0 introduced ESM-only config support, breaking CommonJS require('metro-config').
fix
Switch to import { mergeConfig } from 'metro-config' in .mjs or .js config files.
affects: >=0.83.0 <0.84.0
Errors
Common errors & fixes
Error: Cannot find module 'metro-eslint'
Missing dependency; metro-eslint is not installed.
fix
npm install --save-dev metro-eslint
Parsing error: The keyword 'import' is reserved
ESLint is not configured to parse ESM syntax; metro-eslint requires ESM.
fix
Add 'parserOptions: { sourceType: 'module' }' to .eslintrc or use .mjs extension.
Error: 'metro' plugin is not defined
The metro-eslint plugin is not registered in ESLint config.
fix
Add 'plugins: ["metro"]' to your ESLint config.
Upgrade
Version history
0.0.5latest on npm
Audit
Dependencies
eslintoptionalPeer dependency required for ESLint plugin functionality.
Agent activity
5 hits · last 30 days
node
5
Resources
metro-eslint — npm install metro-eslint · libregistry