JSPM

eslint-plugin-modernization

2.0.4
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 57
  • Score
    100M100P100Q77638F
  • License MIT

ESLint rules for modernizing JavaScript to ES2022+ syntax with AI-parseable guidance.

Package Exports

  • eslint-plugin-modernization

Readme

ESLint Interlace Logo

Security-focused ESLint plugin.

NPM Version NPM Downloads Package License Codecov Since Dec 2025

Description

This plugin provides Security-focused ESLint plugin. By using this plugin, you can proactively identify and mitigate security risks across your entire codebase.

Philosophy

Interlace fosters strength through integration. Instead of stacking isolated rules, we interlace security directly into your workflow to create a resilient fabric of code. We believe tools should guide rather than gatekeep, providing educational feedback that strengthens the developer with every interaction.

Getting Started

npm install eslint-plugin-modernization --save-dev

โš™๏ธ Configuration Presets

Preset Description
recommended Balanced modernization for most projects
strict All rules as errors for aggressive modernization

๐Ÿข Usage Example

// eslint.config.js
import modernization from 'eslint-plugin-modernization';

export default [
  modernization.configs.recommended,

  // Or be strict about modernization
  // modernization.configs.strict,
];

Why These Rules?

no-instanceof-array

instanceof Array fails across different realms (iframes, workers). Array.isArray() is the correct, reliable check.

// โŒ Bad: Fails across realms
if (value instanceof Array) {
}

// โœ… Good: Works everywhere
if (Array.isArray(value)) {
}

prefer-at

Array.at() provides cleaner negative index access (ES2022+).

// โŒ Bad: Verbose negative index access
const last = arr[arr.length - 1];

// โœ… Good: Clean ES2022+ syntax
const last = arr.at(-1);

prefer-event-target

EventTarget is the native browser API and doesn't require Node.js polyfills.

// โŒ Bad: Requires polyfill in browsers
import { EventEmitter } from 'events';

// โœ… Good: Native browser API
const target = new EventTarget();

Rules

Legend

Icon Description
๐Ÿ’ผ Recommended: Included in the recommended preset.
โš ๏ธ Warns: Set towarn in recommended preset.
๐Ÿ”ง Auto-fixable: Automatically fixable by the --fix CLI option.
๐Ÿ’ก Suggestions: Providing code suggestions in IDE.
๐Ÿšซ Deprecated: This rule is deprecated.
Rule CWE OWASP CVSS Description ๐Ÿ’ผ โš ๏ธ ๐Ÿ”ง ๐Ÿ’ก ๐Ÿšซ
no-instanceof-array ESLint rule documentation for no-instanceof-array
prefer-at ESLint rule documentation for prefer-at
prefer-event-target ESLint rule documentation for prefer-event-target

Part of the Interlace ESLint Ecosystem โ€” AI-native security plugins with LLM-optimized error messages:

Plugin Downloads Description
eslint-plugin-secure-coding downloads General security rules & OWASP guidelines.
eslint-plugin-pg downloads PostgreSQL security & best practices.
eslint-plugin-crypto downloads NodeJS Cryptography security rules.
eslint-plugin-jwt downloads JWT security & best practices.
eslint-plugin-browser-security downloads Browser-specific security & XSS prevention.
eslint-plugin-express-security downloads Express.js security hardening rules.
eslint-plugin-lambda-security downloads AWS Lambda security best practices.
eslint-plugin-nestjs-security downloads NestJS security rules & patterns.
eslint-plugin-mongodb-security downloads MongoDB security best practices.
eslint-plugin-vercel-ai-security downloads Vercel AI SDK security hardening.
eslint-plugin-import-next downloads Next-gen import sorting & architecture.

๐Ÿ“„ License

MIT ยฉ Ofri Peretz

ESLint Interlace Plugin