@tghp/eslint-config
v0.1.0
Published
Shared ESLint flat config for TGHP projects
Readme
@tghp/eslint-config
Shared ESLint flat config for TGHP projects.
Install
pnpm add -D @tghp/eslint-config eslint typescript-eslint @typescript-eslint/utils
# for /next entry:
pnpm add -D eslint-config-nextVariants
Three entry points — pick the narrowest that fits:
@tghp/eslint-config/base— TypeScript only (libraries, Node services)@tghp/eslint-config/react— TypeScript + React rules@tghp/eslint-config/next— TypeScript + React + Next.js core-web-vitals, with Next conventions (page/layout default exports,.next/ignored)
Each entry exports a factory. Call it with per-project overrides.
Usage
// eslint.config.mjs
import next from '@tghp/eslint-config/next';
export default next({
ignores: [
'src/migrations/**',
'src/payload-*.ts',
'src/app/(payload)/**',
],
});// library
import base from '@tghp/eslint-config/base';
export default base();Factory options
All factories accept:
ignores: string[]— extra globs added toglobalIgnoreson top of variant defaultsfiles: string[]— override the default['**/*.ts', '**/*.tsx']matchdefaultExportIgnores: string[](react/next only) — files exempt fromno-restricted-exports(Next variant preseedspage.tsx,layout.tsx, etc.)
Custom plugin
custom/no-inline-react-props — forbids inline object type literals in React component parameters. Auto-registered by the react and next variants. Available standalone via @tghp/eslint-config/plugin.
