Registry / testing / eslint-plugin-jam3

eslint-plugin-jam3

JSON →
library0.2.3jsnpmunverified

An ESLint plugin for React applications focusing on security best practices, particularly around XSS prevention. Current stable version 0.2.3, last updated October 2019. Maintained by Jam3. Differentiators: provides rules for enforcing sanitizers with dangerouslySetInnerHTML and window.location access, and forbidding specific methods to reduce XSS vulnerabilities. Suitable for projects needing baseline security linting for React code.

npm install eslint-plugin-jam3
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-JAM3
E
eslint-plugin-jam3
testingjavascriptv0.2.3
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 object
plugins: ['jam3'] in .eslintrc
Using full name 'eslint-plugin-jam3' in plugins array without prefix
ESLint automatically resolves plugins with the 'eslint-plugin-' prefix, so only 'jam3' is needed.
Rule configuration
rules: { 'jam3/no-sanitizer-with-danger': 'error' }
rules: { 'no-sanitizer-with-danger': 'error' }
Rules must be prefixed with the plugin name ('jam3/') when configured in .eslintrc.
Require (CJS) in Node.js
const plugin = require('eslint-plugin-jam3');
const plugin = require('jam3');
When using programmatic API in Node.js, the full package name is required.

Installation and configuration of eslint-plugin-jam3 with example rules for XSS prevention.

// Install eslint and the plugin npm install eslint eslint-plugin-jam3 --save-dev // .eslintrc.json { "plugins": ["jam3"], "rules": { "jam3/no-sanitizer-with-danger": "error", "jam3/no-sanitizer-window-location": "error", "jam3/forbid-methods": ["error", { "methods": ["innerHTML", "outerHTML"] }] } } // Run ESLint npx eslint yourfile.jsx
Debug
Known issues
gotchaRules may not be automatically available if ESLint is installed globally but the plugin is local.
fix
Ensure both ESLint and the plugin are installed globally, or use npx to resolve locally.
affects: >=0.0
deprecatedThe package has not been updated since October 2019 and may not support newer ESLint versions or React features.
fix
Consider migrating to more actively maintained alternatives like eslint-plugin-react or eslint-plugin-security.
affects: =0.2.3
breakingPlugin requires ESLint version compatible with its peer dependency (likely ESLint 4.x–6.x).
fix
If using ESLint 7+, this plugin may not work. Check for compatibility or use a fork.
affects: >=7.0
Errors
Common errors & fixes
ESLint: Cannot find module 'eslint-plugin-jam3'
Plugin not installed or ESLint cannot resolve it due to global/local mismatch.
fix
Install locally: npm install eslint-plugin-jam3 --save-dev. Run ESLint from project root.
Configuration for rule "jam3/no-sanitizer-with-danger" is invalid: Value "error" is invalid.
Rule severity must be an integer (2) or one of 'off'/'warn'/'error' per ESLint version.
fix
Use 2 or 'error'. E.g., "jam3/no-sanitizer-with-danger": 2
ESLint: Rule 'jam3/no-sanitizer-window-location' was not found.
Plugin not correctly loaded in plugins array or rule name typo.
fix
Add 'jam3' to plugins array: "plugins": ["jam3"]
Upgrade
Version history
0.2.3latest on npm
Audit
Dependencies
eslintrequiredpeer dependency required for the plugin to work
Agent activity
2 hits · last 30 days
node
2
Resources
eslint-plugin-jam3 — npm install eslint-plugin-jam3 · libregistry