Extensions
The extensions option enables specialized rule packs that are useful across many project types.
| 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 |
Example
Section titled “Example”import { eslintConfig, Extension } from '@santi020k/eslint-config-basic'
export default eslintConfig({ extensions: [Extension.Unicorn, Extension.Security, Extension.Perfectionist, Extension.BestPractices]})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
- 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.
Repository Examples
Section titled “Repository Examples”- Extension Playgrounds: packages/playground/extensions
- Integrations Package Source: packages/integrations
Did this page help?
One click helps us spot documentation that needs another pass. No personal data is sent.