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-jam3Verified import paths — ran on the pinned version, not inferred.
Installation and configuration of eslint-plugin-jam3 with example rules for XSS prevention.
Ensure both ESLint and the plugin are installed globally, or use npx to resolve locally.
Consider migrating to more actively maintained alternatives like eslint-plugin-react or eslint-plugin-security.
If using ESLint 7+, this plugin may not work. Check for compatibility or use a fork.
Install locally: npm install eslint-plugin-jam3 --save-dev. Run ESLint from project root.
Use 2 or 'error'. E.g., "jam3/no-sanitizer-with-danger": 2
Add 'jam3' to plugins array: "plugins": ["jam3"]