{"id":10829,"library":"eslint-plugin-react-native-globals","title":"ESLint Environment for React Native Globals","description":"eslint-plugin-react-native-globals is a lightweight ESLint plugin designed to provide an environment that acknowledges common React Native global variables and APIs. Its primary purpose is to prevent `no-undef` errors for built-in React Native globals (like `__DEV__`, `__dirname`, `__filename`, `process`, `global`, `console`, `setTimeout`, `setInterval`, etc.) without needing to disable the `no-undef` rule entirely. This allows developers to maintain strict linting for undefined variables while working with the React Native specific global scope. The package is currently at version `0.1.2`, with its last significant update occurring in 2019. Due to its age and lack of recent updates, it can be considered abandoned or in indefinite maintenance mode, with no predictable release cadence. Newer React Native versions might introduce globals not covered by this plugin.","status":"abandoned","version":"0.1.2","language":"javascript","source_language":"en","source_url":"https://github.com/satya164/eslint-plugin-react-native-globals","tags":["javascript","eslint","eslint-plugin","react-native"],"install":[{"cmd":"npm install eslint-plugin-react-native-globals","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-react-native-globals","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-react-native-globals","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"This is an ESLint plugin and requires ESLint to function as a peer dependency.","package":"eslint","optional":false}],"imports":[{"note":"This package is an ESLint plugin and does not export any symbols for direct import into JavaScript/TypeScript code. Its functionality is configured via the `.eslintrc` file.","symbol":"ESLint Configuration","correct":"{ \"plugins\": [\"react-native-globals\"], \"env\": {\"react-native-globals/all\": true} }"}],"quickstart":{"code":"{\n  \"plugins\": [\n    \"react-native-globals\"\n  ],\n  \"env\": {\n    \"react-native-globals/all\": true\n  },\n  \"rules\": {\n    // Example: Ensure no-undef is still active for non-React Native globals\n    \"no-undef\": \"error\"\n  }\n}","lang":"json","description":"This configuration snippet shows how to integrate the plugin into your `.eslintrc` file."},"warnings":[{"fix":"Consider migrating to `eslint-plugin-react-native` (which has its own global environment), manually declaring globals in your ESLint config, or using more modern ESLint alternatives like `globals` package with specific React Native definitions.","message":"The package `eslint-plugin-react-native-globals` is abandoned, with its last commit in April 2019 and version 0.1.2. It may not support newer React Native globals or be compatible with recent major versions of ESLint (e.g., ESLint v9+ which uses a new configuration format).","severity":"breaking","affected_versions":">=0.1.3 (hypothetically), any modern ESLint/React Native setup"},{"fix":"Ensure both ESLint and its plugins are installed locally in your project for consistent behavior: `yarn add --dev eslint eslint-plugin-react-native-globals` or `npm install --save-dev eslint eslint-plugin-react-native-globals`.","message":"If you install ESLint globally (which is generally discouraged), you must also install `eslint-plugin-react-native-globals` globally for ESLint to locate it correctly.","severity":"gotcha","affected_versions":"*"},{"fix":"For comprehensive React Native linting, install and configure `eslint-plugin-react-native` alongside this plugin (if you still choose to use it), or as a complete replacement for global definitions.","message":"This plugin only provides global variable definitions. It does not include any specific linting rules for React Native code styles or best practices. For rules, you need `eslint-plugin-react-native` or similar.","severity":"gotcha","affected_versions":"*"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"Run `npm install --save-dev eslint-plugin-react-native-globals` or `yarn add --dev eslint-plugin-react-native-globals` in your project's root directory. If ESLint is installed globally, install the plugin globally too.","cause":"The `eslint-plugin-react-native-globals` package was not installed or is not accessible in the current environment.","error":"Error: Failed to load plugin 'react-native-globals' declared in '.eslintrc.json': Cannot find module 'eslint-plugin-react-native-globals'"},{"fix":"Ensure your `.eslintrc` file contains `\"plugins\": [\"react-native-globals\"]` and `\"env\": {\"react-native-globals/all\": true}` as shown in the quickstart, with correct casing and spelling.","cause":"The `react-native-globals` plugin is not correctly listed in the `plugins` array of your `.eslintrc` configuration, or there's a typo in the `env` key.","error":"Error: The 'env' key 'react-native-globals/all' is unknown."}],"ecosystem":"npm"}