Socket
Book a DemoInstallSign in
Socket

@e18e/eslint-plugin

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@e18e/eslint-plugin

The official e18e ESLint plugin for modernizing code and improving performance.

Source
npmnpm
Version
0.1.2
Version published
Weekly downloads
212
-69.36%
Maintainers
1
Weekly downloads
 
Created
Source

@e18e/eslint-plugin

The official e18e ESLint plugin for modernizing JavaScript/TypeScript code and improving performance.

This plugin focuses on applying the e18e community's best practices and advise to JavaScript/TypeScript codebases.

Overview

There are a few categories of rules in this plugin:

  • Modernization - New syntax and APIs which improve code readability and performance
  • Module replacements - Community recommended alternatives to popular libraries, focused on performance and size
  • Performance improvements - Patterns that can be optimized for better runtime performance

Each of these can be enabled individually, or you can use the recommended configuration to enable all rules.

Installation

npm install --save-dev @e18e/eslint-plugin

Usage

Add the plugin to your eslint.config.js:

import e18e from '@e18e/eslint-plugin';

export default [
  // Use the recommended configuration (includes all categories)
  e18e.configs.recommended,

  // Or use specific category configurations
  e18e.configs.modernization,
  e18e.configs.moduleReplacements,
  e18e.configs.performanceImprovements,

  // Or configure rules manually
  {
    plugins: {
      e18e
    },
    rules: {
      'e18e/prefer-array-at': 'error',
      'e18e/prefer-array-fill': 'error',
      'e18e/prefer-includes': 'error'
    }
  }
];

Usage with oxlint

If you're using oxlint, you can enable the e18e plugin by adding it to your .oxlintrc.json file:

{
  "jsPlugins": ["@e18e/eslint-plugin"],
  "rules": {
    "e18e/prefer-includes": "error"
  }
}

You can enable the recommended configuration by copying the rules from each of the ESLint configuration files into your .oxlintrc.json file.

  • modernization configuration
  • module replacements configuration
  • performance improvements configuration

Copying these rules into your rules object will achieve the same effect as using the recommended configuration in ESLint.

[!NOTE] Our type-aware rules depend on TypeScript ESLint's parser, which means they will not work with oxlint at this time.

Rules

Legend:

  • ✅ = Yes / Enabled
  • ✖️ = No / Disabled
  • 💡 = Has suggestions (requires user confirmation for fixes)

Modernization

RuleDescriptionRecommendedFixableRequires Types
prefer-array-atPrefer Array.prototype.at() over length-based indexing✖️
prefer-array-fillPrefer Array.prototype.fill() over Array.from() or map() with constant values✖️
prefer-includesPrefer .includes() over indexOf() comparisons for arrays and strings✖️
prefer-array-to-reversedPrefer Array.prototype.toReversed() over copying and reversing arrays✖️
prefer-array-to-sortedPrefer Array.prototype.toSorted() over copying and sorting arrays✖️
prefer-array-to-splicedPrefer Array.prototype.toSpliced() over copying and splicing arrays✖️
prefer-exponentiation-operatorPrefer the exponentiation operator ** over Math.pow()✖️
prefer-nullish-coalescingPrefer nullish coalescing operator (?? and ??=) over verbose null checks✖️
prefer-object-has-ownPrefer Object.hasOwn() over Object.prototype.hasOwnProperty.call() and obj.hasOwnProperty()✖️
prefer-spread-syntaxPrefer spread syntax over Array.concat(), Array.from(), Object.assign({}, ...), and Function.apply()✖️
prefer-url-canparsePrefer URL.canParse() over try-catch blocks for URL validation💡✖️

Module replacements

RuleDescriptionRecommendedFixableRequires Types
ban-dependenciesBan dependencies in favor of lighter alternatives✖️✖️

Performance improvements

RuleDescriptionRecommendedFixableRequires Types
no-indexof-equalityPrefer startsWith() for strings and direct array access over indexOf() equality checks✖️
prefer-array-from-mapPrefer Array.from(iterable, mapper) over [...iterable].map(mapper) to avoid intermediate array allocation✖️
prefer-timer-argsPrefer passing function and arguments directly to setTimeout/setInterval instead of wrapping in an arrow function or using bind✖️

License

MIT

Keywords

eslint

FAQs

Package last updated on 19 Dec 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts