edsger-lint
v0.1.0
Published
Shared ESLint configurations for Edsger projects
Maintainers
Readme
edsger-lint
Shared lint configurations for TypeScript projects. Currently provides ESLint configs; Prettier and commitlint configs coming soon.
Install
npm install edsger-lint eslint --save-devESLint Setup
Create eslint.config.mjs in your project root and compose the presets you need:
Next.js
import nextPlugin from '@next/eslint-plugin-next'
import { baseConfig, next, react, typeCheckedRules } from 'edsger-lint/eslint'
export default [
...baseConfig,
...typeCheckedRules(import.meta.dirname),
...react,
...next,
nextPlugin.flatConfig.coreWebVitals,
]React (Vite, Electron renderer, etc.)
import { baseConfig, react, typeCheckedRules } from 'edsger-lint/eslint'
export default [
...baseConfig,
...typeCheckedRules(import.meta.dirname),
...react,
]React Native / Expo
import { baseConfig, reactNative, typeCheckedRules } from 'edsger-lint/eslint'
export default [
...baseConfig,
...typeCheckedRules(import.meta.dirname),
...reactNative,
]Node.js (CLI tools, SDKs, servers)
import { baseConfig, node, typeCheckedRules } from 'edsger-lint/eslint'
export default [
...baseConfig,
...typeCheckedRules(import.meta.dirname),
...node,
]Deno Edge Functions
import { baseConfig, deno } from 'edsger-lint/eslint'
export default [...baseConfig, ...deno]Presets Reference
| Export | Description |
| ----------------------- | --------------------------------------------------------------------------------------------------------------------------- |
| baseConfig | TypeScript strict + stylistic, import sorting, security, code quality, naming conventions, Prettier compat. Use everywhere. |
| typeCheckedRules(dir) | Async/await safety, exhaustive switches. Pass import.meta.dirname. Requires tsconfig.json. |
| react | React + Hooks + jsx-a11y accessibility rules. |
| reactNative | Same as react but with a11y rules disabled (RN has its own accessibility system). |
| next | Next.js relaxations — spread after react. Disables rules handled by Next.js Link/Image. |
| node | Node.js globals + no-buffer-constructor. |
| deno | Relaxes console, require, and no-explicit-any for Deno Edge Functions. |
Adding Project-Specific Overrides
Append override objects after the presets:
import { baseConfig, node, typeCheckedRules } from 'edsger-lint/eslint'
export default [
...baseConfig,
...typeCheckedRules(import.meta.dirname),
...node,
// Project-specific
{
rules: {
'no-console': 'off',
'@typescript-eslint/no-explicit-any': 'warn',
},
},
]Re-exports
For cases where presets aren't enough, plugins and utilities are re-exported:
import {
globals,
jsxA11yPlugin,
reactHooksPlugin,
reactPlugin,
} from 'edsger-lint/eslint'Rule Philosophy
- error = blocks commit, must be clean
- warn = shows in output, fix incrementally
Security rules (no-eval, no-new-func, etc.) and type safety rules are always errors. Complexity and style rules are warnings.
Peer Dependencies
eslint>= 9
License
MIT
