Registry / testing / eslint-plugin-react-native-globals

eslint-plugin-react-native-globals

JSON →
library0.1.2jsnpmunverified

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.

npm install eslint-plugin-react-native-globals
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-REAC
E
eslint-plugin-react-native-globals
testingjavascriptv0.1.2
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.

ESLint Configuration
{ "plugins": ["react-native-globals"], "env": {"react-native-globals/all": true} }
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.

This configuration snippet shows how to integrate the plugin into your `.eslintrc` file.

{ "plugins": [ "react-native-globals" ], "env": { "react-native-globals/all": true }, "rules": { // Example: Ensure no-undef is still active for non-React Native globals "no-undef": "error" } }
Debug
Known issues
breakingThe 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).
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.
affects: >=0.1.3 (hypothetically), any modern ESLint/React Native setup
gotchaIf you install ESLint globally (which is generally discouraged), you must also install `eslint-plugin-react-native-globals` globally for ESLint to locate it correctly.
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`.
affects: *
gotchaThis 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.
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.
affects: *
Errors
Common errors & fixes
Error: Failed to load plugin 'react-native-globals' declared in '.eslintrc.json': Cannot find module 'eslint-plugin-react-native-globals'
The `eslint-plugin-react-native-globals` package was not installed or is not accessible in the current environment.
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.
Error: The 'env' key 'react-native-globals/all' is unknown.
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.
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.
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies
eslintrequiredThis is an ESLint plugin and requires ESLint to function as a peer dependency.
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-react-native-globals — npm install eslint-plugin-react-native-globals · libregistry