Skip to content

Core Package

Package: @santi020k/eslint-config-core

The core package contains the base JavaScript rules, runtime-aware globals, shared utilities, and types that the rest of the monorepo builds on.

  • Base ESLint and stylistic rules.
  • Runtime helpers and environment globals.
  • detectProjectOptions: Automatically identifies project settings from package.json and project structure. Note that this no longer populates boolean flags in the frameworks object; instead, it reports names via detectedFrameworks.
  • Shared config types and enums.
  • gitignore integration.
  • Import sort groups — a carefully ordered set of simple-import-sort groups with broad framework coverage and optional monorepo customization.
  • Runtime
  • Preset
  • Library
  • Testing
  • Format
  • Tool
  • Extension
  • Setting
  • NextMode
  • detectProjectOptions
  • createCoreConfig
  • coreConfig
  • groups — default import sort groups array (used by simple-import-sort/imports)
  • createImportGroups — factory to generate import groups with optional monorepo customization
  • ImportGroupOptions — TypeScript type for createImportGroups options

The core package ships a curated set of simple-import-sort groups that handle most real-world import patterns automatically. The groups are applied in this order:

#GroupExamples
1Side effectsimport 'reflect-metadata', import 'zone.js'
2Node built-insimport fs from 'node:fs', import path from 'path'
3Framework virtualsvirtual:icons, astro:content, $app/navigation, #imports
4Internal UI layercomponents/Button, @/pages/Home, ~/layouts/Main
5Internal app layerhooks/useAuth, @/utils/format, store/user
6Style imports./Button.module.css, @/styles/globals.scss, theme.sass
7Workspace packages (optional)@acme/shared, @myorg/ui
8External npm packagesreact, @tanstack/query, lodash
9Aliases catch-all@/router, ~/main, #subpath/mod
10Parent-relative../../shared, ../utils
11Same-directory./index, ./helpers/format

Styles are placed before externals and relative imports so that ./Button.module.css, theme.sass, and @/styles/globals.scss all land in the same group regardless of how the path is written.

Internal UI and app layer patterns are placed before external npm packages so that bare paths like components/Button or hooks/useAuth are never misclassified as npm packages.

For most projects the default groups export is all you need — it is used automatically when you consume the core config. If you are working in a monorepo and want to sort your own workspace packages separately from external npm packages, pass workspacePrefixes directly to defineConfig:

import { defineConfig } from '@santi020k/eslint-config-basic'
export default await defineConfig({
workspacePrefixes: ['@acme'] // @acme/* sorts before react, lodash, etc.
})

If you need the groups array directly (e.g. to inspect or extend it), use createImportGroups:

import { createImportGroups } from '@santi020k/eslint-config-basic'
const groups = createImportGroups({ workspacePrefixes: ['@acme'] })

For most consumers, the main package is the right entry point. Import core directly only when you are building your own wrapper or you need the low-level shared utilities.

Did this page help?

One click helps us spot documentation that needs another pass. No personal data is sent.