eslint-config-universe
raw JSON → 15.0.3 verified Sat Apr 25 auth: no javascript
Shared ESLint configs for Expo projects, providing a single dependency to set up ESLint with TypeScript, React, and Prettier. Currently at version 15.0.3, it follows Expo's release cadence and updates frequently to align with new ESLint rules and Expo SDK changes. Differentiators include automatic parser detection based on TypeScript usage, built-in support for React Native and React, and seamless integration with Expo's ecosystem. Requires ESLint >=8.10 and Prettier >=3. Notably, the default export provides a comprehensive base config, but developers often misuse the require path or fail to install peer dependencies.
Common errors
error Error: Failed to load config 'universe' to extend from. ↓
cause eslint-config-universe is not installed or not in node_modules.
fix
Run npm install --save-dev eslint-config-universe
error Cannot find module 'prettier' ↓
cause Missing peer dependency prettier.
fix
npm install --save-dev prettier
error Configuration for rule 'react/jsx-no-bind' is invalid ↓
cause Incompatible eslint-plugin-react version.
fix
Update eslint-plugin-react to the version required by eslint-config-universe.
Warnings
breaking Since version 12, the recommended config no longer automatically detects React Native; use 'universe' (includes RN) or 'universe/web' explicitly. ↓
fix Update your ESLint config: use 'universe' for RN or 'universe/web' for web projects.
deprecated The 'universe/node' config is deprecated and will be removed in a future version. ↓
fix Use 'universe' or customize with 'universe/shared/typescript' as needed.
gotcha Missing peer dependency 'prettier' causes runtime error: 'Cannot find module 'prettier''. ↓
fix Install prettier: npm install --save-dev prettier
gotcha ESLint 9 flat config is not supported; this config uses legacy .eslintrc format. ↓
fix Use ELLint 8.x or stick with legacy config until flat config support is added.
Install
npm install eslint-config-universe yarn add eslint-config-universe pnpm add eslint-config-universe Imports
- default config wrong
const config = require('eslint-config-universe')correctmodule.exports = { extends: 'universe' } - TypeScript config wrong
module.exports = { extends: 'universe/typescript' }correctmodule.exports = { extends: 'universe/shared/typescript' } - Web config wrong
module.exports = { extends: 'universe' } (without specifying web)correctmodule.exports = { extends: 'universe/web' }
Quickstart
// Install peer dependencies first
// npm install --save-dev eslint prettier eslint-config-universe
// .eslintrc.js
module.exports = {
extends: 'universe',
// For TypeScript projects, use 'universe/shared/typescript' instead
// For web projects, use 'universe/web'
env: {
node: true,
browser: true,
es2021: true,
},
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
},
};