Registry /
security / eslint-plugin-no-wildcard-postmessage
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
no-wildcard-postmessage
✓ plugins: ['no-wildcard-postmessage']
✗ plugins: ['eslint-plugin-no-wildcard-postmessage']
In ESLint config, omit the 'eslint-plugin-' prefix when referencing the plugin name.
rule: no-wildcard-postmessage/no-wildcard-postmessage
✓ rules: { 'no-wildcard-postmessage/no-wildcard-postmessage': 'error' }
✗ rules: { 'no-wildcard-postmessage': 'error' }
The rule is namespaced under the plugin name; the full rule name is 'no-wildcard-postmessage/no-wildcard-postmessage'.
rules: ["@mozilla/gaia/postmessage"] (deprecated)
✓ rules: { 'no-wildcard-postmessage/no-wildcard-postmessage': 'error' }
✗ rules: { '@mozilla/gaia/postmessage': 'error' }
The rule was previously under a different namespace in older versions; using the old namespace no longer works.
Shows installation, ESLint configuration, and example violations/allowed usage for the no-wildcard-postmessage rule.
// Install the plugin
npm install --save-dev eslint-plugin-no-wildcard-postmessage
// .eslintrc.json
{
"plugins": ["no-wildcard-postmessage"],
"rules": {
"no-wildcard-postmessage/no-wildcard-postmessage": "error"
}
}
// Example violation:
// frame.postMessage(obj, "*"); // ESLint will report error
// Allowed:
// frame.postMessage(obj, "https://example.com");
// postMessage(obj); // in a worker
// Important: The rule only checks postMessage calls where the second argument is a string literal "*". Variables or computed values are not checked.
Errors
Common errors & fixes
ESLint: Configuration for rule "no-wildcard-postmessage" is invalid.
Using the rule name without the plugin prefix.
fixUse 'no-wildcard-postmessage/no-wildcard-postmessage' as the rule key.
Cannot find module 'eslint-plugin-no-wildcard-postmessage'
Missing npm install or module resolution issue.
fixRun 'npm install --save-dev eslint-plugin-no-wildcard-postmessage' and ensure eslint can resolve the plugin.
Definition for rule 'no-wildcard-postmessage/no-wildcard-postmessage' was not found.
Plugin not loaded in ESLint config.
fixAdd 'plugins: ["no-wildcard-postmessage"]' to your ESLint config.
Audit
Dependencies
eslintrequiredpeer dependency required to load the plugin as an ESLint rule