A lightweight linting tool for detecting the target="_blank" vulnerability in HTML anchor tags where missing rel="noopener noreferrer" allows the opened page to access the opener's window via window.opener. The package provides a simple API to parse HTML strings and return errors for insecure links. It is at version 0.1.1 with a minimal footprint and no dependencies. Compared to full-fledged HTML validators or linters like ESLint plugins, this is a focused, single-purpose module for quick checks during development or build processes.
npm install lint-target-blankNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to require the module, create an instance, and lint an HTML string for insecure target="_blank" links.
Always pass an empty object `{}` or an options object with configuration.Iterate over the returned array to access individual errors.
Consider using a proper HTML parser (e.g., cheerio) for more accurate linting.
Use `const LintTargetBlank = require('lint-target-blank');` instead of `import`.Always pass a string to the `lint` method.
No dependency data recorded yet.