Registry / testing / eslint-plugin-scanjs-rules

eslint-plugin-scanjs-rules

JSON →
library0.2.1jsnpmunverified

ESLint plugin providing supplemental security rules inspired by Mozilla's ScanJS, version 0.2.1. Last updated in 2016 with no active release cadence. Provides additional rules not found in core ESLint for detecting dangerous patterns (e.g., innerHTML, eval-like usage, constructors with HTML strings). Use with eslint-config-scanjs for full ScanJS parity. Note: unmaintained, may not work with modern ESLint versions (tested up to ESLint 3).

npm install eslint-plugin-scanjs-rules
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-SCAN
E
eslint-plugin-scanjs-rules
testingjavascriptv0.2.1
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.

rules (plugin object)
import plugin from 'eslint-plugin-scanjs-rules';
const plugin = require('eslint-plugin-scanjs-rules');
ESLint plugins are typically used via plugins array in config, not direct import. If imported, use default export.
configs.recommended
import scanjs from 'eslint-plugin-scanjs-rules'; const config = scanjs.configs.recommended;
const config = require('eslint-plugin-scanjs-rules').configs.recommended;
CommonJS require works but ESM is preferred for modern ESLint.
Individual rule (e.g., 'no-eval')
import plugin from 'eslint-plugin-scanjs-rules'; const rule = plugin.rules['no-eval'];
const rule = require('eslint-plugin-scanjs-rules/rules/no-eval');
Rules are only accessible via plugin object, not direct file path.

Shows how to configure ESLint to use scanjs-rules plugin and enable recommended rules plus custom overrides.

// .eslintrc.js module.exports = { plugins: ['eslint-plugin-scanjs-rules'], extends: ['plugin:eslint-plugin-scanjs-rules/recommended'], rules: { 'scanjs-rules/no-eval': 'error', 'scanjs-rules/no-document-write': 'warn' } };
Debug
Known issues
gotchaPlugin was last updated in 2016; may not work with ESLint >= 4 due to plugin API changes.
fix
Consider using eslint-plugin-security or @microsoft/eslint-plugin-sdl instead.
affects: >=4.0.0
deprecatedRule 'no-eval' is deprecated in ESLint core; use 'no-eval' from plugin for supplemental checks.
fix
Use ESLint core 'no-eval' or scanjs-rules 'no-eval' but not both.
affects: >=0.0.0
breakingRule names in config use 'scanjs-rules/' prefix; omitting prefix fails.
fix
Use 'scanjs-rules/rule-name' in rules object.
affects: >=0.0.0
gotchaNo TypeScript definitions; plugin may not work with @typescript-eslint/parser.
fix
Wrap plugin in custom wrapper or use alternative security linter.
affects: >=0.0.0
gotchaSome rules like 'no-document-write' may conflict with browser globals not present in Node.js environments.
fix
Set env: { browser: true } in ESLint config.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Failed to load plugin 'eslint-plugin-scanjs-rules' declared in '.eslintrc.js': Cannot find module 'eslint-plugin-scanjs-rules'
Plugin not installed or path incorrect.
fix
Run 'npm install eslint-plugin-scanjs-rules --save-dev'.
Definition for rule 'scanjs-rules/no-eval' was not found
Rule name typo or missing prefix.
fix
Use 'scanjs-rules/no-eval' (with prefix) in rules object, and ensure plugin is in plugins array.
ESLint configuration in .eslintrc.js is invalid: Unexpected top-level property "extends" is an array but should be a string
Incorrect extends format in older ESLint versions.
fix
Use string for extends: 'plugin:eslint-plugin-scanjs-rules/recommended' (not array) in ESLint <3.
Upgrade
Version history
0.2.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
eslint-plugin-scanjs-rules — npm install eslint-plugin-scanjs-rules · libregistry