{
  "path": "/writing/lean-js-with-e18e-linting-rules",
  "site": "at://did:plc:m25hu5wadnbqnt47zep7xza6/site.standard.publication/self",
  "$type": "site.standard.document",
  "title": "Lean JavaScript with e18e Linting Rules",
  "description": "Use e18e's linting rules to automatically flag outdated packages and enforce modern JS patterns.",
  "publishedAt": "2026-04-06T00:00:00.000Z",
  "textContent": "[e18e](https://e18e.dev/) is an initiative lead by a small circle of developers who are striving to make the JavaScript ecosystem sustainably better.[^1]\n\nOne of their projects is the [eslint](https://eslint.org/) plugin [e18e/eslint-plugin](https://github.com/e18e/eslint-plugin). It enables ESLint (and ESLint-compatible tooling) to detect deviations from current best practices.\n\nWhereas it has **many** powerful rules available, my favorite by far is `e18e/ban-dependencies`. This rule uses the [module replacements list](https://github.com/e18e/module-replacements) to detect the usage of obsolete packages[^2].\n\n```ts frame=\"code\" title=\"main.ts\"\nimport chalk from \"chalk\";\n\nchalk.green(\"Hello world!\");\n```\n\n<br/>\n\n```bash frame=\"terminal\" title=\"~/Developer/temp\"\n~/Developer/temp\n✗ bun lint\n$ oxlint\n\n  × e18e(ban-dependencies): \"chalk\" should be replaced with an alternative package. Read more here: https://github.com/es-tooling/module-replacements/blob/main/docs/modules/chalk.md\n   ╭─[src/main.ts:1:1]\n 1 │ import chalk from 'chalk';\n   · ──────────────────────────\n 2 │\n   ╰────\n\nFound 0 warnings and 1 error.\nFinished in 72ms on 2 files with 110 rules using 10 threads.\nerror: script \"lint\" exited with code 1\n```\n\nJust by using that rule you can make sure that you do not accidentally use packages that have been superseded by timely alternatives.\n\n## Integrating with Oxlint\n\nIf you're like me and prefer Oxlint[^3] over ESLint, there's good news:\nAs Oxlint added support for JS plugins since March 2026, we can neatly integrate `@e18e/eslint-plugin` into our Oxlint setup.\n\nTo get started, it's as easy as adding both packages as dev dependencies to our project.\n\n```bash\n~/Developer/temp\n➜ bun add -D oxlint @e18e/eslint-plugin\nbun add v1.3.11 (af24e281)\n\ninstalled oxlint@1.58.0 with binaries:\n - oxlint\ninstalled @e18e/eslint-plugin@0.3.0\n\n[871.00ms] done\n```\n\nAfterwards, you can create an oxlint config either by running `bun oxlint --init` (which creates a JSON config by default) or by manually creating an `oxlint.config.ts` file. I prefer the latter and will therefore cover that approach here.\n\nIn that file, you will use the same `defineConfig` flow that may already be familiar from, for example, [Vite](https://vite.dev/) or similiar tools.\n\n```ts frame=\"code\" title=\"oxlint.config.ts\"\nimport { defineConfig } from \"oxlint\";\n\nexport default defineConfig({\n\tjsPlugins: [\"@e18e/eslint-plugin\"],\n\tignorePatterns: [\"dist\", \"node_modules\"],\n\trules: {\n\t\t// modernization\n\t\t\"e18e/prefer-array-at\": \"error\",\n\t\t\"e18e/prefer-array-fill\": \"error\",\n\t\t\"e18e/prefer-includes\": \"error\",\n\t\t\"e18e/prefer-array-to-reversed\": \"error\",\n\t\t\"e18e/prefer-array-to-sorted\": \"error\",\n\t\t\"e18e/prefer-array-to-spliced\": \"error\",\n\t\t\"e18e/prefer-nullish-coalescing\": \"error\",\n\t\t\"e18e/prefer-object-has-own\": \"error\",\n\t\t\"e18e/prefer-spread-syntax\": \"error\",\n\t\t\"e18e/prefer-url-canparse\": \"error\",\n\n\t\t// module replacements\n\t\t\"e18e/ban-dependencies\": \"error\",\n\n\t\t// performance improvements\n\t\t\"e18e/prefer-array-from-map\": \"error\",\n\t\t\"e18e/prefer-timer-args\": \"error\",\n\t\t\"e18e/prefer-date-now\": \"error\",\n\t\t\"e18e/prefer-regex-test\": \"error\",\n\t\t\"e18e/prefer-array-some\": \"error\",\n\t\t\"e18e/prefer-static-regex\": \"error\",\n\t},\n});\n```\n\nIt is just as simple as listing the module name in the `jsPlugins` list and then configuring the rules in the `rules` section. You can find the full list of rules in the [e18e/eslint-plugin readme](https://github.com/e18e/eslint-plugin?tab=readme-ov-file#usage-with-oxlint).\n\n[^1]: [Theo (t3.gg)](https://t3.gg/) also made a [video](https://www.youtube.com/watch?v=1t-k6-m50Fc) covering this topic more thoroughly.\n\n[^2]: Packages may be marked as obsolete for various reasons. Some of them are [listed on e18e's website](https://e18e.dev/docs/replacements/#what-are-these).\n\n[^3]: ESLint-compatible linter, part of the [Ox toolchain](https://oxc.rs/)."
}