{"id":47626418,"url":"https://github.com/e18e/eslint-plugin","last_synced_at":"2026-04-01T22:49:33.773Z","repository":{"id":327305553,"uuid":"1107883719","full_name":"e18e/eslint-plugin","owner":"e18e","description":"The official e18e ESLint plugin for code modernization and performance best practices","archived":false,"fork":false,"pushed_at":"2026-03-21T18:14:00.000Z","size":308,"stargazers_count":131,"open_issues_count":13,"forks_count":5,"subscribers_count":4,"default_branch":"main","last_synced_at":"2026-03-21T21:36:45.889Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/e18e.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"open_collective":"e18e"}},"created_at":"2025-12-01T18:26:14.000Z","updated_at":"2026-03-21T21:28:59.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/e18e/eslint-plugin","commit_stats":null,"previous_names":["e18e/eslint-plugin"],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/e18e/eslint-plugin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e18e%2Feslint-plugin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e18e%2Feslint-plugin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e18e%2Feslint-plugin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e18e%2Feslint-plugin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/e18e","download_url":"https://codeload.github.com/e18e/eslint-plugin/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/e18e%2Feslint-plugin/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31292703,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-01T21:15:39.731Z","status":"ssl_error","status_checked_at":"2026-04-01T21:15:34.046Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-01T22:49:33.168Z","updated_at":"2026-04-01T22:49:33.754Z","avatar_url":"https://github.com/e18e.png","language":"TypeScript","funding_links":["https://opencollective.com/e18e"],"categories":[],"sub_categories":[],"readme":"# @e18e/eslint-plugin\n\n\u003e The official e18e ESLint plugin for modernizing JavaScript/TypeScript code and improving performance.\n\nThis plugin focuses on applying the e18e community's best practices and advise to JavaScript/TypeScript codebases.\n\n## Overview\n\nThere are a few categories of rules in this plugin:\n\n- Modernization - New syntax and APIs which improve code readability and performance\n- Module replacements - Community recommended alternatives to popular libraries, focused on performance and size\n- Performance improvements - Patterns that can be optimized for better runtime performance\n\nEach of these can be enabled individually, or you can use the recommended configuration to enable all rules.\n\n## Installation\n\n```bash\nnpm install --save-dev @e18e/eslint-plugin\n```\n\n## Usage\n\nAdd the plugin to your `eslint.config.js`:\n\n```ts\nimport e18e from '@e18e/eslint-plugin';\n\nexport default [\n  // Use the recommended configuration (includes all categories)\n  e18e.configs.recommended,\n\n  // Or use specific category configurations\n  e18e.configs.modernization,\n  e18e.configs.moduleReplacements,\n  e18e.configs.performanceImprovements,\n\n  // Or configure rules manually\n  {\n    plugins: {\n      e18e\n    },\n    rules: {\n      'e18e/prefer-array-at': 'error',\n      'e18e/prefer-array-fill': 'error',\n      'e18e/prefer-includes': 'error'\n    }\n  }\n];\n```\n\n## Usage with oxlint\n\nIf you're using oxlint, you can enable the e18e plugin by adding it to your `.oxlintrc.json` file:\n\n```json\n{\n  \"jsPlugins\": [\"@e18e/eslint-plugin\"],\n  \"rules\": {\n    \"e18e/prefer-includes\": \"error\"\n  }\n}\n```\n\nYou can enable the recommended configuration by copying the rules from each of the ESLint configuration files into your `.oxlintrc.json` file.\n\n- [modernization configuration](./src/configs/modernization.ts)\n- [module replacements configuration](./src/configs/module-replacements.ts)\n- [performance improvements configuration](./src/configs/performance-improvements.ts)\n\nCopying these rules into your `rules` object will achieve the same effect as using the recommended configuration in ESLint.\n\n\u003e [!NOTE]\n\u003e Our type-aware rules depend on TypeScript ESLint's parser, which means they\n\u003e will not work with oxlint at this time.\n\n## Linting `package.json`\n\nSome rules (e.g. `ban-dependencies`) can be used against your `package.json`.\n\nYou can achieve this by using `@eslint/json` or `jsonc-eslint-parser`.\n\nFor example, with `@eslint/json` and `eslint.config.js`:\n\n```ts\nimport e18e from '@e18e/eslint-plugin';\nimport json from '@eslint/json';\nimport {defineConfig} from 'eslint/config';\n\nexport default defineConfig([\n  {\n    files: ['package.json'],\n    language: 'json/json',\n    plugins: {\n      e18e,\n      json\n    },\n    extends: ['e18e/recommended'],\n  }\n]);\n```\n\nOr with `jsonc-eslint-parser` and `eslint.config.js`:\n\n```ts\nimport e18e from '@e18e/eslint-plugin';\nimport jsonParser from 'jsonc-eslint-parser';\nimport {defineConfig} from 'eslint/config';\n\nexport default defineConfig([\n  {\n    files: ['package.json'],\n    languageOptions: {\n      parser: jsonParser\n    },\n    plugins: {\n      e18e\n    },\n    extends: ['e18e/recommended'],\n  }\n]);\n```\n\nRead more at the\n[`@eslint/json` docs](https://github.com/eslint/json) and\n[`jsonc-eslint-parser` docs](https://github.com/ota-meshi/jsonc-eslint-parser).\n\n## Rules\n\n**Legend:**\n- ✅ = Yes / Enabled\n- ✖️ = No / Disabled\n- 💡 = Has suggestions (requires user confirmation for fixes)\n- 🔶 = Optionally uses types (works without TypeScript but more powerful with it)\n\n### Modernization\n\n| Rule | Description | Recommended | Fixable | Requires Types |\n|------|-------------|-------------|---------|----------------|\n| [prefer-array-at](./src/rules/prefer-array-at.ts) | Prefer `Array.prototype.at()` over length-based indexing | ✅ | ✅ | 🔶 |\n| [prefer-array-fill](./src/rules/prefer-array-fill.ts) | Prefer `Array.prototype.fill()` over `Array.from()` or `map()` with constant values | ✅ | ✅ | ✖️ |\n| [prefer-includes](./src/rules/prefer-includes.ts) | Prefer `.includes()` over `indexOf()` comparisons for arrays and strings | ✅ | ✅ | ✖️ |\n| [prefer-array-to-reversed](./src/rules/prefer-array-to-reversed.ts) | Prefer `Array.prototype.toReversed()` over copying and reversing arrays | ✅ | ✅ | 🔶 |\n| [prefer-array-to-sorted](./src/rules/prefer-array-to-sorted.ts) | Prefer `Array.prototype.toSorted()` over copying and sorting arrays | ✅ | ✅ | 🔶 |\n| [prefer-array-to-spliced](./src/rules/prefer-array-to-spliced.ts) | Prefer `Array.prototype.toSpliced()` over copying and splicing arrays | ✅ | ✅ | ✖️ |\n| [prefer-exponentiation-operator](./src/rules/prefer-exponentiation-operator.ts) | Prefer the exponentiation operator `**` over `Math.pow()` | ✅ | ✅ | ✖️ |\n| [prefer-nullish-coalescing](./src/rules/prefer-nullish-coalescing.ts) | Prefer nullish coalescing operator (`??` and `??=`) over verbose null checks | ✅ | ✅ | ✖️ |\n| [prefer-object-has-own](./src/rules/prefer-object-has-own.ts) | Prefer `Object.hasOwn()` over `Object.prototype.hasOwnProperty.call()` and `obj.hasOwnProperty()` | ✅ | ✅ | ✖️ |\n| [prefer-spread-syntax](./src/rules/prefer-spread-syntax.ts) | Prefer spread syntax over `Array.concat()`, `Array.from()`, `Object.assign({}, ...)`, and `Function.apply()` | ✅ | ✅ | 🔶 |\n| [prefer-url-canparse](./src/rules/prefer-url-canparse.ts) | Prefer `URL.canParse()` over try-catch blocks for URL validation | ✅ | 💡 | ✖️ |\n\n### Module replacements\n\n| Rule | Description | Recommended | Fixable | Requires Types |\n|------|-------------|-------------|---------|----------------|\n| ban-dependencies | Ban dependencies in favor of lighter alternatives | ✅ | ✖️ | ✖️ |\n\n### Performance improvements\n\n| Rule | Description | Recommended | Fixable | Requires Types |\n|------|-------------|-------------|---------|----------------|\n| [no-indexof-equality](./src/rules/no-indexof-equality.ts) | Prefer `startsWith()` for strings and direct array access over `indexOf()` equality checks | ✖️ | ✅ | ✅ |\n| [prefer-array-from-map](./src/rules/prefer-array-from-map.ts) | Prefer `Array.from(iterable, mapper)` over `[...iterable].map(mapper)` to avoid intermediate array allocation | ✅ | ✅ | ✖️ |\n| [prefer-array-some](./src/rules/prefer-array-some.ts) | Prefer `Array.some()` over `Array.find()` when checking for element existence | ✅ | ✅ | ✖️ |\n| [prefer-timer-args](./src/rules/prefer-timer-args.ts) | Prefer passing function and arguments directly to `setTimeout`/`setInterval` instead of wrapping in an arrow function or using `bind` | ✅ | ✅ | ✖️ |\n| [prefer-date-now](./src/rules/prefer-date-now.ts) | Prefer `Date.now()` over `new Date().getTime()` and `+new Date()` | ✅ | ✅ | ✖️ |\n| [prefer-regex-test](./src/rules/prefer-regex-test.ts) | Prefer `RegExp.test()` over `String.match()` and `RegExp.exec()` when only checking for match existence | ✅ | ✅ | 🔶 |\n| [prefer-static-regex](./src/rules/prefer-static-regex.ts) | Prefer defining regular expressions at module scope to avoid re-compilation on every function call | ✅ | ✖️ | 🔶 |\n| [prefer-inline-equality](./src/rules/prefer-inline-equality.ts) | Prefer inline equality checks over temporary object creation for simple comparisons | ✖️ | ✅ | 🔶 |\n\n## Sponsors\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://e18e.dev/sponsor\"\u003e\n    \u003cimg src=\"https://e18e.dev/sponsors.svg\" alt=\"e18e community sponsors\" /\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe18e%2Feslint-plugin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fe18e%2Feslint-plugin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fe18e%2Feslint-plugin/lists"}