ESLint Standards
Relevant source files
The following files were used as context for generating this wiki page:
Introduction
The ESLint standards in the wrelik-kit repository are designed to enforce architectural boundaries and coding discipline across the Wrelik ecosystem. By providing a centralized configuration package, @wrelik/eslint-config, the project ensures consistent code quality for both Node.js and Next.js applications while strictly managing third-party dependency usage.
The primary purpose of these standards is to support the "Adapter-first" architecture, which mandates that applications interact with external vendors exclusively through shared internal packages. This approach reduces vendor lock-in and centralizes best practices.
Sources: README.md:5-24, packages/eslint-config/package.json:1-17
Architecture and Integration
The linting system is integrated into the monorepo's build pipeline using Turborepo. Every package within the packages/ directory is required to include @wrelik/eslint-config as a development dependency.
Dependency Management
The configuration is distributed as a standalone package that bundles several industry-standard plugins and configurations.
| Dependency | Purpose |
|---|---|
eslint-config-next | Base rules for Next.js projects. |
eslint-config-turbo | Rules for Turborepo monorepo management. |
eslint-config-prettier | Disables ESLint rules that might conflict with Prettier. |
@typescript-eslint/eslint-plugin | Linting rules for TypeScript. |
eslint-plugin-only-warn | Downgrades all errors to warnings (optional behavior). |
Sources: packages/eslint-config/package.json:8-14, CONTRIBUTING.md:4-8
Build Pipeline Flow
The following diagram illustrates how the linting task is coordinated across the monorepo.
The turbo.json file defines the lint task, which has no specific dependencies on other tasks, allowing it to run in parallel across all packages.
Sources: turbo.json:19-21, package.json:12
Restricted Imports and Architectural Boundaries
The most critical component of the ESLint standards is the enforcement of the "no-vendor-SDK" rule. The configuration uses no-restricted-imports to prevent developers from importing vendor-specific libraries directly into application code, forcing the use of internal adapters.
Prohibited Import Mappings
| Restricted Module | Suggested Internal Alternative | Reason |
|---|---|---|
@clerk/nextjs | @wrelik/auth | Enforce Clerk adapter standards. |
@prisma/client | @wrelik/db | Ensure multi-tenant context helpers. |
resend | @wrelik/email | Centralize transactional templates. |
posthog-node | @wrelik/analytics | Enforce event naming conventions. |
inngest | @wrelik/jobs | Standardize event-driven workflows. |
@aws-sdk/* | @wrelik/storage | Abstract S3-compatible logic. |
Sources: packages/eslint-config/index.js:13-53, DECISIONS.md:14-22
Configuration Logic Snippet
The implementation in packages/eslint-config/index.js uses strict error levels for these restrictions:
// packages/eslint-config/index.js:12-42
'no-restricted-imports': [
'error',
{
paths: [
{
name: '@clerk/nextjs',
message: 'Please use @wrelik/auth instead.',
},
// ... other restricted paths
],
patterns: [
{
group: ['@aws-sdk/*'],
message: 'Please use @wrelik/storage instead.',
},
],
},
],
Rule Customizations
In addition to architectural restrictions, the project applies specific overrides to standard TypeScript and React rules to align with its development philosophy.
- Next.js Specifics: The rule
@next/next/no-html-link-for-pagesis disabled (off), as isreact/jsx-key. - TypeScript Strictness:
@typescript-eslint/no-explicit-anyis set towarnrather thanerror.@typescript-eslint/no-unused-varsis set towarnbut ignores variables starting with an underscore (e.g.,_variable).
- Parser: Uses
@typescript-eslint/parserfor all files. - Ignores: The linter is configured to ignore build outputs (
dist) and CSS files (**/*.css).
Sources: packages/eslint-config/index.js:1-11
Conclusion
ESLint Standards in wrelik-kit act as an automated governance tool. By codifying architectural decisions into the no-restricted-imports rule, the project ensures that its "Adapter-first" principle is maintained without requiring manual oversight for every import statement. This setup facilitates a scalable, vendor-agnostic infrastructure where third-party service swaps are localized to specific adapter packages.