Skip to content

Overview & Quick Start

ESLint 9 Flat Config standards

@nexload-sdk/eslint-config

v9.39.2 Stable Released

Shared authoritative ESLint configurations for the Nexload SDK monorepo

ESLint 9Node.jsTypeScriptReactNext.jsPayload CMS

@nexload-sdk/eslint-config provides a unified, strict ESLint 9 Flat Config system for TypeScript repositories. Built on typescript-eslint v8, eslint-plugin-perfectionist, and eslint-plugin-unicorn, it enforces clean architectural discipline, deterministic import order, semantic whitespace padding, and zero-any type safety.


Create eslint.config.mjs in your project root using the nexloadConfig() universal factory:

eslint.config.mjs
import { nexloadConfig } from "@nexload-sdk/eslint-config";
export default nexloadConfig({
framework: "next", // "next" | "react" | "node" | "payload" | "none"
typeAware: true,
});

This configuration enforces unambiguous, production-grade engineering standards:

1. Mandatory Kebab-Case Filenames (unicorn/filename-case)

Section titled “1. Mandatory Kebab-Case Filenames (unicorn/filename-case)”

Every file in your source tree must use kebab-case.ts. CamelCase, PascalCase, or snake_case file names trigger compile-blocking linter errors.

✅ src/user-profile.ts
✅ src/auth-guard.spec.ts
❌ src/UserProfile.ts
❌ src/user_profile.ts

2. Deterministic Perfectionist Imports (perfectionist/sort-imports)

Section titled “2. Deterministic Perfectionist Imports (perfectionist/sort-imports)”

Imports are automatically organized alphabetically into strict semantic groups separated by blank lines:

  1. Type imports (import type { ... })
  2. Node.js built-ins (node:fs, node:path)
  3. External dependencies (react, zod, payload)
  4. Internal ecosystem packages (@nexload-sdk/*)
  5. Parent & sibling relative imports (../, ./)

3. Absolute Zero-any Policy (@typescript-eslint/no-explicit-any)

Section titled “3. Absolute Zero-any Policy (@typescript-eslint/no-explicit-any)”

Using any is treated as a hard error. Types must be properly narrowed at boundary points using unknown, generics, type guards, or Zod schemas.

4. Semantic Whitespace Padding (@stylistic/padding-line-between-statements)

Section titled “4. Semantic Whitespace Padding (@stylistic/padding-line-between-statements)”

Blank lines are enforced around returns, classes, exports, and multi-line declarations to eliminate visual clutter and ensure code remains human-readable and AI-friendly.

5. Floating Promise Prevention (@typescript-eslint/no-floating-promises)

Section titled “5. Floating Promise Prevention (@typescript-eslint/no-floating-promises)”

Async operations must be explicitly awaited or handled with .catch(). Unhandled background promises fail CI immediately.


Preset ExportTarget EnvironmentIncluded Plugins
baseConfigUniversal TypeScript foundationtypescript-eslint, perfectionist, unicorn, @stylistic, prettier
nodeConfigNode.js backend servicesBase + Node globals and environment rules
reactConfigReact libraries & SPAsBase + react-hooks
nextjsConfigNext.js App RouterBase + react-hooks + @next/eslint-plugin-next
payloadConfigPayload CMS applicationsBase + react-hooks + Payload-specific admin & server boundary rules
nexloadConfig(options)Universal configurable factoryCombines presets, custom rules, ignores, and overrides in one call

Terminal window
pnpm add -D @nexload-sdk/eslint-config eslint@^9.0.0 typescript

Peer requirements: eslint >= 9.0.0, typescript >= 5.0.0.