@vedapointe-shared/eslint-config
v2.0.0
Published
Shared ESLint flat config for VedaPointe TypeScript/Node.js/Express projects
Readme
@vedapointe-shared/eslint-config v2
Modern, opinionated ESLint flat config for VedaPointe TypeScript/Node.js/Express projects.
What's included
| Layer | Source | Purpose |
| ---------- | ----------------------------------------------------------------- | ------------------------------------------------------ |
| Base JS | @eslint/js recommended | Core JS error prevention |
| TypeScript | typescript-eslint recommendedTypeChecked + stylisticTypeChecked | Type-aware linting + style consistency |
| Node.js | eslint-plugin-n | Deprecated API detection, prefer modern APIs |
| Security | eslint-plugin-security | Detect common security anti-patterns |
| Testing | @vitest/eslint-plugin | Test best practices (Vitest/Jest-compatible) |
| Formatting | eslint-config-prettier | Disables all formatting rules — let Prettier handle it |
Requirements
- Node.js >= 18.18.0
- ESLint >= 9.22.0
- TypeScript >= 5.0.0
Installation
npm install --save-dev @vedapointe-shared/eslint-config eslint typescriptUsage
Create an eslint.config.mjs in your project root:
import vedapointe from "@vedapointe-shared/eslint-config";
import { defineConfig } from "eslint/config";
export default defineConfig(...vedapointe, {
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
});The
tsconfigRootDiroverride is required so typescript-eslint can find your project'stsconfig.json.
With overrides
import vedapointe from "@vedapointe-shared/eslint-config";
import { defineConfig } from "eslint/config";
export default defineConfig(
...vedapointe,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
{
rules: {
"no-console": "off",
"@typescript-eslint/no-explicit-any": "off",
},
},
);Custom ignores
import vedapointe from "@vedapointe-shared/eslint-config";
import { defineConfig } from "eslint/config";
export default defineConfig(
{ ignores: ["generated/**", "migrations/**"] },
...vedapointe,
{
languageOptions: {
parserOptions: {
projectService: true,
tsconfigRootDir: import.meta.dirname,
},
},
},
);Design decisions
Lean on the presets. Rather than manually listing 100+ rules, we extend recommendedTypeChecked and stylisticTypeChecked from typescript-eslint. These are well-maintained, stable presets. Our custom layer only overrides where we have a specific reason to diverge.
Warnings vs errors. Rules are set to error when they catch definite bugs (floating promises, unused vars, exhaustive switches). Rules are set to warn when they surface code smells that may have legitimate exceptions (unnecessary conditions, unbound methods, require-await). This lets teams adopt gradually without blocking CI on day one.
Express-friendly. checksVoidReturn.arguments is disabled for no-misused-promises so async route handlers don't trigger false positives. ignoreStatic is enabled for unbound-method so static middleware references work.
Decorator/DI-friendly. no-extraneous-class is off to support DI containers like typedi where classes are used as service tokens.
Test files are relaxed. Type-safety rules are loosened in test files where mocking often requires any and assertions need flexibility.
Prettier handles formatting. Zero stylistic/formatting rules are enforced. Run Prettier separately.
Security as a safety net. Security rules that produce many false positives (detect-object-injection) are off. Others are warnings to surface issues without blocking.
Key rules added beyond the presets
| Rule | Severity | Why |
| -------------------------------- | -------- | ---------------------------------------- |
| consistent-type-imports | error | Cleaner builds, explicit type boundaries |
| consistent-type-exports | error | Same as above for exports |
| switch-exhaustiveness-check | error | Catch missing cases at compile time |
| prefer-readonly | error | Immutability by default |
| promise-function-async | error | Make async intent explicit |
| return-await (in-try-catch) | warn | Catch unhandled rejections in try/catch |
| no-unnecessary-type-parameters | warn | Avoid over-generic code |
| n/no-deprecated-api | error | Stay off deprecated Node.js APIs |
| n/prefer-promises/* | error | Use promise-based fs/dns APIs |
| security/* | mixed | Baseline security hygiene |
Migrating from v1
v1 used the legacy .eslintrc format with eslint-plugin-jest. v2 is a complete rewrite:
- Remove old packages:
@typescript-eslint/eslint-plugin,@typescript-eslint/parser,eslint-plugin-jest,eslint-plugin-prettier - Update ESLint to v9+
- Delete
.eslintrc/.eslintignore - Create
eslint.config.mjsas shown above - Update your lint script:
"lint": "eslint ."
License
ISC
Minor or major release
npm version minor # or: npm version major
npm publish --access public