Registry / testing / eslint-plugin-testcafe

eslint-plugin-testcafe

JSON →
library0.2.1jsnpmunverified

ESLint plugin providing rules for TestCafe end-to-end testing framework. Current version 0.2.1 (pre-1.0) allows referencing `t` variable from TestCafe test context. Installation requires ESLint (peer dependency). Plugin exports a recommended configuration that enforces good practices. Differentiator: avoids false positives from TestCafe globals and supports TestCafe-specific patterns like `t.expect()`.

npm install eslint-plugin-testcafe
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-TEST
E
eslint-plugin-testcafe
testingjavascriptv0.2.1
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.

plugin:testcafe/recommended
extends: 'plugin:testcafe/recommended'
extends: 'testcafe/recommended' (missing 'plugin:' prefix)
The recommended config is accessed via 'plugin:' prefix in ESLint extends. Must also add 'testcafe' to plugins array.
no-valid-testcafe-pattern
rules: { 'testcafe/no-valid-testcafe-pattern': 'error' }
rules: { 'no-valid-testcafe-pattern': 'error' } (missing namespace)
ESLint plugin rules must be prefixed with the plugin name (testcafe/) when configured in rules section.
plugin import
plugins: ['testcafe']
using the plugin name with scope (e.g., '@testcafe/eslint-plugin') which is not the package name
The plugin is registered as 'testcafe' in the plugins array; it's not scoped.

Configures ESLint with the testcafe plugin and recommended rules, then shows a TestCafe test using common patterns.

// .eslintrc.js module.exports = { plugins: ['testcafe'], extends: 'plugin:testcafe/recommended', rules: { 'testcafe/no-valid-testcafe-pattern': 'error', }, }; // Example TestCafe test that will pass ESLint with the plugin fixture('Example fixture') .page('https://example.com'); test('Example test', async t => { await t .click('#button') .typeText('#input', 'hello') .expect('#result').eql('hello'); });
Debug
Known issues
deprecatedPlugin version 0.2.1 is outdated and may not support newer TestCafe features (e.g., Role, RequestMock). Consider using more actively maintained alternatives.
fix
Switch to a more maintained ESLint plugin for TestCafe, or contribute to this one.
affects: 0.x
gotchaThe 'no-valid-testcafe-pattern' rule might incorrectly flag valid TestCafe code if the rule is not updated for newer TestCafe APIs.
fix
Review rule configs and consider disabling the rule if it causes false positives.
affects: >=0.0.0
gotchaInstall both eslint and eslint-plugin-testcafe as devDependencies, not globally, unless you prefer global install. Global installs can cause conflicts.
fix
Run: npm install eslint eslint-plugin-testcafe --save-dev
affects: >=0.0.0
Errors
Common errors & fixes
ESLint: Failed to load plugin 'testcafe': Cannot find module 'eslint-plugin-testcafe'
eslint-plugin-testcafe is not installed or is installed globally while ESLint is local (or vice versa).
fix
Install locally: npm install eslint-plugin-testcafe --save-dev. Ensure ESLint and the plugin are installed in the same scope (both global or both local).
ESLint: Error while loading rule 'testcafe/no-valid-testcafe-pattern': Could not find rule
The rule name might be incorrect or the plugin is not specified in plugins array.
fix
Ensure 'testcafe' is in the plugins array and the rule is prefixed with 'testcafe/'.
Definition for rule 'no-valid-testcafe-pattern' was not found
Missing namespace prefix 'testcafe/' on the rule.
fix
Use 'testcafe/no-valid-testcafe-pattern' in rules configuration.
Upgrade
Version history
0.2.1latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required for linting
Agent activity
5 hits · last 30 days
node
4
Amazon
1
Resources
eslint-plugin-testcafe — npm install eslint-plugin-testcafe · libregistry