Extensions
The extensions option enables specialized rule packs that are useful across many project types.
Install @santi020k/eslint-config-extensions alongside the lean basic
package before enabling or auto-detecting entries on this page. The full
package already includes it.
| Extension | Enum | Use It When | Auto-Detected |
|---|---|---|---|
| RegExp | Extension.Regexp | The project wants stronger regular-expression linting. | No |
| Unicorn | Extension.Unicorn | The project wants modern JavaScript best-practice rules. | No |
| SonarJS | Extension.Sonarjs | The project wants maintainability-oriented rules. | No |
| Security | Extension.Security | The project wants additional security-oriented checks. | Yes |
| Perfectionist | Extension.Perfectionist | The project wants ordering and consistency rules. | No |
| BestPractices | Extension.BestPractices | The project wants light-weight quality rules with no extra dependencies. | No |
| Boundaries | Extension.Boundaries | The project wants dependency-free import boundary guardrails for package, generated-code, and test imports. | No |
| A11y | Extension.A11y | The project wants accessibility linting for JSX and Vue. | Yes |
| Biome | Extension.Biome | The project wants to enforce Biome formatting and rules. | No |
| Node | Extension.Node | The project is a Node.js codebase that wants eslint-plugin-n rules. | No |
| Compat | Extension.Compat | The project wants browser-compatibility checks against its browserslist. | No |
| DeMorgan | Extension.DeMorgan | The project wants negated logical expressions simplified automatically. | No |
| Depend | Extension.Depend | The project wants suggestions for lighter or native dependency alternatives. | No |
| Oxlint | Extension.Oxlint | The project runs Oxlint alongside ESLint and wants duplicate rules disabled. | No |
Example
Section titled “Example”import { defineConfig, Extension } from '@santi020k/eslint-config-basic'
export default await defineConfig({ extensions: [ Extension.Unicorn, Extension.Security, Extension.Perfectionist, Extension.BestPractices, Extension.Boundaries ]})Details
Section titled “Details”BestPractices
Section titled “BestPractices”The Extension.BestPractices pack adds four quality rules that don’t require any external plugin dependencies:
no-console(warn) — catches leftover debug outputno-alert(error) — disallows browseralert,confirm, andpromptcomplexity(warn, max 10) — flags overly complex functionsmax-depth(warn, max 4) — flags deeply nested blocks
Refactor a complexity finding when branches describe separable work, repeated decisions, or deeply nested control flow. A validator or release transaction that deliberately runs independent checks to return one complete report can merit a narrow source-level directive instead. Keep that directive on the smallest function and explain why preserving the complete transaction is more useful than splitting it.
To see the complexity ESLint counted for a file, run:
basic-eslint explain complexity --file src/validator.tsThe explanation includes each current complexity diagnostic and its source
location. ESLint’s diagnostic reports the calculated complexity and configured
maximum.
Boundaries
Section titled “Boundaries”The Extension.Boundaries pack adds dependency-free import guardrails:
import/no-relative-packages(warn) — catches relative imports across package boundaries.import/no-self-import(error) — prevents a module from importing itself.no-restricted-imports(error) — blocks production imports from generated-code and test-only paths.
The Extension.Node pack applies eslint-plugin-n recommended rules. Module-resolution rules (n/no-missing-import, n/no-missing-require) are disabled for TypeScript files because the compiler already validates imports.
Oxlint
Section titled “Oxlint”The Extension.Oxlint pack disables ESLint rules already covered by Oxlint so both linters can run side by side without duplicate reports — the same hybrid-linting model as the Biome extension.
Example usage:
import { defineConfig, Extension } from '@santi020k/eslint-config-basic'
export default await defineConfig({ extensions: [ // other extensions... Extension.Oxlint ]})By adding this extension, ESLint will no longer report errors for rules that Oxlint can check. You are expected to run oxlint manually (e.g., in your CI pipeline or package.json lint scripts) alongside eslint to catch those issues much faster.
- The Security extension is enabled by default through detection.
- These extensions can be layered with frameworks, formats, and tooling without changing the core composition model.
- Like Prettier and Biome, the Oxlint extension is applied after other extensions so its rule disables win.
Repository Examples
Section titled “Repository Examples”- Extension Playgrounds: packages/playground/extensions
- Extensions Package Source: packages/extensions
Did this page help?
Your answer stays in this browser. Share details on GitHub to help improve the docs.