{"id":19800,"library":"eslint-plugin-jam3","title":"eslint-plugin-jam3","description":"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.","status":"maintenance","version":"0.2.3","language":"javascript","source_language":"en","source_url":"https://github.com/Jam3/eslint-plugin-jam3","tags":["javascript","eslint","eslintplugin","eslint-plugin","eslint-plugin-jam3","eslint-react","no-danger","dangerouslySetInnerHTML","xss"],"install":[{"cmd":"npm install eslint-plugin-jam3","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-jam3","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-jam3","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required for the plugin to work","package":"eslint","optional":false}],"imports":[{"note":"ESLint automatically resolves plugins with the 'eslint-plugin-' prefix, so only 'jam3' is needed.","wrong":"Using full name 'eslint-plugin-jam3' in plugins array without prefix","symbol":"Plugin object","correct":"plugins: ['jam3'] in .eslintrc"},{"note":"Rules must be prefixed with the plugin name ('jam3/') when configured in .eslintrc.","wrong":"rules: { 'no-sanitizer-with-danger': 'error' }","symbol":"Rule configuration","correct":"rules: { 'jam3/no-sanitizer-with-danger': 'error' }"},{"note":"When using programmatic API in Node.js, the full package name is required.","wrong":"const plugin = require('jam3');","symbol":"Require (CJS) in Node.js","correct":"const plugin = require('eslint-plugin-jam3');"}],"quickstart":{"code":"// Install eslint and the plugin\nnpm install eslint eslint-plugin-jam3 --save-dev\n\n// .eslintrc.json\n{\n  \"plugins\": [\"jam3\"],\n  \"rules\": {\n    \"jam3/no-sanitizer-with-danger\": \"error\",\n    \"jam3/no-sanitizer-window-location\": \"error\",\n    \"jam3/forbid-methods\": [\"error\", { \"methods\": [\"innerHTML\", \"outerHTML\"] }]\n  }\n}\n\n// Run ESLint\nnpx eslint yourfile.jsx","lang":"javascript","description":"Installation and configuration of eslint-plugin-jam3 with example rules for XSS prevention."},"warnings":[{"fix":"Ensure both ESLint and the plugin are installed globally, or use npx to resolve locally.","message":"Rules may not be automatically available if ESLint is installed globally but the plugin is local.","severity":"gotcha","affected_versions":">=0.0"},{"fix":"Consider migrating to more actively maintained alternatives like eslint-plugin-react or eslint-plugin-security.","message":"The package has not been updated since October 2019 and may not support newer ESLint versions or React features.","severity":"deprecated","affected_versions":"=0.2.3"},{"fix":"If using ESLint 7+, this plugin may not work. Check for compatibility or use a fork.","message":"Plugin requires ESLint version compatible with its peer dependency (likely ESLint 4.x–6.x).","severity":"breaking","affected_versions":">=7.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Install locally: npm install eslint-plugin-jam3 --save-dev. Run ESLint from project root.","cause":"Plugin not installed or ESLint cannot resolve it due to global/local mismatch.","error":"ESLint: Cannot find module 'eslint-plugin-jam3'"},{"fix":"Use 2 or 'error'. E.g., \"jam3/no-sanitizer-with-danger\": 2","cause":"Rule severity must be an integer (2) or one of 'off'/'warn'/'error' per ESLint version.","error":"Configuration for rule \"jam3/no-sanitizer-with-danger\" is invalid: Value \"error\" is invalid."},{"fix":"Add 'jam3' to plugins array: \"plugins\": [\"jam3\"]","cause":"Plugin not correctly loaded in plugins array or rule name typo.","error":"ESLint: Rule 'jam3/no-sanitizer-window-location' was not found."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}