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
muslnode 18–226 runs
build_error
glibcnode 18–226 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');
});
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).
fixInstall 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.
fixEnsure '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.
fixUse 'testcafe/no-valid-testcafe-pattern' in rules configuration.
Audit
Dependencies
eslintrequiredpeer dependency required for linting