Registry / testing / eslint-plugin-detox

eslint-plugin-detox

JSON →
library1.0.0jsnpmunverified

ESLint environment plugin for Detox, an end-to-end testing framework for React Native applications. Version 1.0.0 is the latest stable release with no known release cadence. It provides a custom ESLint environment to enable global Detox variables (like `device`, `expect`, `element`, `by`, `waitFor`) in test files, preventing no-undef errors. Unlike generic ESLint settings, this plugin is tailored specifically for Detox's asynchronous UI testing helpers and should be combined with environments like mocha/jest. Statically releases with no frequent updates; works with ESLint 1.x+ and supports both npm and yarn.

npm install eslint-plugin-detox
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-DETO
E
eslint-plugin-detox
testingjavascriptv1.0.0
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-plugin-detox
// In .eslintrc: { "plugins": ["detox"] } or {"env":{"detox/detox":true}}
This is an ESLint plugin, not an imported module. It is activated via ESLint configuration. The plugin provides the 'detox/detox' environment.
detox/detox environment
In .eslintrc: { "env": { "detox/detox": true } } or via /* eslint-env detox/detox */
This exposes Detox globals (device, expect, element, by, waitFor). Must be combined with test runner env (e.g., mocha, jest).

Shows how to install, configure ESLint with detox environment, and a sample Detox test using globals enabled by the plugin.

// Install dependencies // npm install eslint eslint-plugin-detox --save-dev // .eslintrc.json { "plugins": ["detox"], "env": { "detox/detox": true, "mocha": true }, "rules": { "no-undef": "error" } } // Then in your test file: /* eslint-env detox/detox, mocha */ describe('Example', () => { beforeEach(async () => { await device.reloadReactNative(); }); it('should show hello screen', async () => { await expect(element(by.text('Hello'))).toBeVisible(); }); });
Debug
Known issues
gotchaThe plugin only provides an environment; it does not include any custom rules. Developers might expect rules like 'detox/no-assertions' but they do not exist.
fix
Use standard ESLint rules (e.g., 'no-undef') with the 'detox/detox' environment.
affects: >=0.0.0
gotchaThe environment must be used alongside a test runner environment (mocha, jest, etc.) to avoid missing globals like 'describe', 'it', etc.
fix
Combine 'detox/detox' with 'mocha':true or 'jest':true in the env block.
affects: >=0.0.0
Errors
Common errors & fixes
'device' is not defined no-undef
The 'detox/detox' environment is not enabled in ESLint config.
fix
Add 'detox/detox' to the env section of .eslintrc or include comment: /* eslint-env detox/detox */
Definition for rule 'detox/no-assertions' was not found
User attempted to use a rule from the plugin, but the plugin does not define any rules.
fix
Remove rule references prefixed with 'detox/'. The plugin only provides an environment.
Upgrade
Version history
1.0.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required by all ESLint plugins
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-detox — npm install eslint-plugin-detox · libregistry