{"id":19749,"library":"eslint-plugin-expo","title":"Expo ESLint Plugin","description":"A collection of ESLint rules for Expo apps, providing linting for Expo-specific APIs and best practices. Current stable version is 1.0.0. Released alongside Expo SDK updates. Key differentiators: focused on Expo ecosystem, catches common mistakes like missing expo-constants or incorrect import paths for Expo modules.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/expo/expo","tags":["javascript","eslint","eslintplugin","eslint-plugin"],"install":[{"cmd":"npm install eslint-plugin-expo","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-expo","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-expo","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency, required to run the plugin","package":"eslint","optional":false}],"imports":[{"note":"ESM-only since v1; no CommonJS support.","wrong":"const expoPlugin = require('eslint-plugin-expo')","symbol":"default","correct":"import expoPlugin from 'eslint-plugin-expo'"},{"note":"Use the flat config entry point for ESLint 9+ flat config files.","wrong":"import expo from 'eslint-plugin-expo'","symbol":"flat config (ESLint 9+)","correct":"import expo from 'eslint-plugin-expo/configs/flat'"},{"note":"Named export for advanced usage; ESM only.","wrong":"const { rules } = require('eslint-plugin-expo')","symbol":"rules","correct":"import { rules } from 'eslint-plugin-expo'"}],"quickstart":{"code":"// .eslintrc.cjs (CommonJS)\nmodule.exports = {\n  plugins: ['expo'],\n  extends: ['plugin:expo/recommended'],\n  rules: {\n    'expo/no-env-var-imports': 'error',\n  },\n};\n\n// eslint.config.js (Flat config, ESLint 9+)\nimport expo from 'eslint-plugin-expo/configs/flat';\nexport default [\n  ...expo.configs.recommended,\n  {\n    rules: {\n      'expo/no-env-var-imports': 'error',\n    },\n  },\n];","lang":"javascript","description":"Shows both CommonJS (legacy) and flat config setup for Expo ESLint plugin, including an example rule."},"warnings":[{"fix":"Switch to import expoPlugin from 'eslint-plugin-expo';","message":"Using require('eslint-plugin-expo') is deprecated in v1.0.0; use ESM imports instead.","severity":"deprecated","affected_versions":">=1.0.0"},{"fix":"Correct import: import expo from 'eslint-plugin-expo/configs/flat';","message":"Flat config import path changed in v1.0.0-beta.3: use 'eslint-plugin-expo/configs/flat' not 'eslint-plugin-expo/flat'.","severity":"gotcha","affected_versions":">=1.0.0-beta.3"},{"fix":"Upgrade ESLint to version 8.10 or higher.","message":"Plugin rules only work with ESLint >=8.10; older versions do not support the plugin's features.","severity":"gotcha","affected_versions":">=8.10"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run: npm install eslint-plugin-expo --save-dev","cause":"Missing npm package or incorrect module resolution.","error":"Could not find plugin \"eslint-plugin-expo\"."},{"fix":"Install locally: npm install eslint-plugin-expo@latest --save-dev","cause":"Plugin not installed in project's node_modules or global ESLint installation.","error":"Error: Failed to load plugin 'expo' declared in '.eslintrc': Cannot find module 'eslint-plugin-expo'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}