@batoanng/eslint-config
Flat-config presets for React, Next.js, Tailwind, tests, and strict TypeScript repos.
Quick install
npm install -D @batoanng/eslint-configCompose a flat config
Start with the shared base and add the environment-specific presets your package needs.
Context
What It Covers
Compose shared lint rules with targeted exports for base JavaScript, React, Next.js, Tailwind, and test environments.
- @batoanng/eslint config or @batoanng/eslint config/react :
- @batoanng/eslint config/next :
- @batoanng/eslint config/tailwind :
- @batoanng/eslint config/test :
Setup
Installation
Bring the package into your project with the published npm entrypoint.
npm install -D @batoanng/eslint-config
Baseline install:
npm install -D eslint typescript @batoanng/eslint-config
Install additional peers only for the entrypoints you use:
@batoanng/eslint-configor@batoanng/eslint-config/react:eslint-plugin-react,eslint-plugin-react-hooks,eslint-plugin-jsx-a11y@batoanng/eslint-config/next:@next/eslint-plugin-next@batoanng/eslint-config/tailwind:eslint-plugin-tailwindcss,tailwindcssFor Tailwind CSS v4, installeslint-plugin-tailwindcss@^4.0.0-beta.0@batoanng/eslint-config/test:eslint-plugin-jest,eslint-plugin-testing-library,jest
Start
Compose a flat config
Start with the shared base and add the environment-specific presets your package needs.
import config from '@batoanng/eslint-config';
import typed from '@batoanng/eslint-config/typed';
import test from '@batoanng/eslint-config/test';
export default [...config, ...typed, ...test];
TypeScript library
// eslint.config.mjs
import base from '@batoanng/eslint-config/base';
export default [...base];
React package with type-aware linting
// eslint.config.mjs
import config from '@batoanng/eslint-config';
import test from '@batoanng/eslint-config/test';
import typed from '@batoanng/eslint-config/typed';
export default [...config, ...typed, ...test];
Next.js app with Tailwind
// eslint.config.mjs
import config from '@batoanng/eslint-config';
import next from '@batoanng/eslint-config/next';
import tailwind from '@batoanng/eslint-config/tailwind';
import typed from '@batoanng/eslint-config/typed';
export default [...config, ...typed, ...next, ...tailwind];
Surface
Exports And Entrypoints
Export surface
.->./index.mjs./base->./base.mjs./react->./react.mjs./typed->./typed.mjs./next->./next.mjs./tailwind->./tailwind.mjs./test->./test.mjs
Key files
-
base.mjs -
index.mjs -
next.mjs -
package.json -
react.mjs -
shared.mjs -
smoke/ -
@batoanng/eslint-config: base + React defaults Requires:eslint-plugin-react,eslint-plugin-react-hooks,eslint-plugin-jsx-a11y -
@batoanng/eslint-config/base: JavaScript and TypeScript baseline Requires no extra peers beyondeslintandtypescript -
@batoanng/eslint-config/react: React, hooks, and JSX a11y rules Requires:eslint-plugin-react,eslint-plugin-react-hooks,eslint-plugin-jsx-a11y -
@batoanng/eslint-config/typed: opt-in type-aware TypeScript rules Requires no extra peers beyondeslintandtypescript -
@batoanng/eslint-config/next: Next.js rules Requires:@next/eslint-plugin-next -
@batoanng/eslint-config/tailwind: Tailwind CSS rules Requires:eslint-plugin-tailwindcss,tailwindcssSupports: Tailwind CSS v3 witheslint-plugin-tailwindcss@^3.18.2, or Tailwind CSS v4 witheslint-plugin-tailwindcss@^4.0.0-beta.0 -
@batoanng/eslint-config/test: Jest, Vitest globals, and Testing Library rules Requires:eslint-plugin-jest,eslint-plugin-testing-library,jest
Integration
Integration Notes
Peer dependencies
-
@next/eslint-plugin-next -
eslint -
eslint-plugin-jest -
eslint-plugin-jsx-a11y -
eslint-plugin-react -
eslint-plugin-react-hooks -
eslint-plugin-tailwindcss -
eslint-plugin-testing-library -
tailwindcss -
typescript -
typedusesparserOptions.projectService, so it reads the consumer project's own TypeScript configuration. -
The shared config already enables
eslint-config-prettier, so formatting-only rule conflicts stay off. -
Feature-specific ESLint plugins are peer dependencies so consumers only install the entrypoint-specific packages they actually use.
-
Tailwind CSS v4 currently relies on the upstream
eslint-plugin-tailwindcssbeta channel, because stable upstream releases still pin Tailwind CSS to v3. -
The Tailwind entrypoint automatically uses a local
tailwind.config.*file when one exists, and falls back to Tailwind's default config for CSS-first Tailwind CSS v4 projects. -
The package ships flat config only. Legacy
.eslintrc*usage is intentionally unsupported.
Ops
Development Notes
Latest release snapshot
3.3.2
Patch Changes
- Update tailwind version
Source docs
Reference
The full README is rendered below so the package guide stays detailed and traceable to the source docs that live with the package itself.
Flat ESLint configs for TypeScript, React, Next.js, Tailwind, and tests.
Installation
Baseline install:
npm install -D eslint typescript @batoanng/eslint-config
Install additional peers only for the entrypoints you use:
@batoanng/eslint-configor@batoanng/eslint-config/react:eslint-plugin-react,eslint-plugin-react-hooks,eslint-plugin-jsx-a11y@batoanng/eslint-config/next:@next/eslint-plugin-next@batoanng/eslint-config/tailwind:eslint-plugin-tailwindcss,tailwindcssFor Tailwind CSS v4, installeslint-plugin-tailwindcss@^4.0.0-beta.0@batoanng/eslint-config/test:eslint-plugin-jest,eslint-plugin-testing-library,jest
Exports
@batoanng/eslint-config: base + React defaults Requires:eslint-plugin-react,eslint-plugin-react-hooks,eslint-plugin-jsx-a11y@batoanng/eslint-config/base: JavaScript and TypeScript baseline Requires no extra peers beyondeslintandtypescript@batoanng/eslint-config/react: React, hooks, and JSX a11y rules Requires:eslint-plugin-react,eslint-plugin-react-hooks,eslint-plugin-jsx-a11y@batoanng/eslint-config/typed: opt-in type-aware TypeScript rules Requires no extra peers beyondeslintandtypescript@batoanng/eslint-config/next: Next.js rules Requires:@next/eslint-plugin-next@batoanng/eslint-config/tailwind: Tailwind CSS rules Requires:eslint-plugin-tailwindcss,tailwindcssSupports: Tailwind CSS v3 witheslint-plugin-tailwindcss@^3.18.2, or Tailwind CSS v4 witheslint-plugin-tailwindcss@^4.0.0-beta.0@batoanng/eslint-config/test: Jest, Vitest globals, and Testing Library rules Requires:eslint-plugin-jest,eslint-plugin-testing-library,jest
Usage
TypeScript library
// eslint.config.mjs
import base from '@batoanng/eslint-config/base';
export default [...base];
React package with type-aware linting
// eslint.config.mjs
import config from '@batoanng/eslint-config';
import test from '@batoanng/eslint-config/test';
import typed from '@batoanng/eslint-config/typed';
export default [...config, ...typed, ...test];
Next.js app with Tailwind
// eslint.config.mjs
import config from '@batoanng/eslint-config';
import next from '@batoanng/eslint-config/next';
import tailwind from '@batoanng/eslint-config/tailwind';
import typed from '@batoanng/eslint-config/typed';
export default [...config, ...typed, ...next, ...tailwind];
Notes
typedusesparserOptions.projectService, so it reads the consumer project's own TypeScript configuration.- The shared config already enables
eslint-config-prettier, so formatting-only rule conflicts stay off. - Feature-specific ESLint plugins are peer dependencies so consumers only install the entrypoint-specific packages they actually use.
- Tailwind CSS v4 currently relies on the upstream
eslint-plugin-tailwindcssbeta channel, because stable upstream releases still pin Tailwind CSS to v3. - The Tailwind entrypoint automatically uses a local
tailwind.config.*file when one exists, and falls back to Tailwind's default config for CSS-first Tailwind CSS v4 projects. - The package ships flat config only. Legacy
.eslintrc*usage is intentionally unsupported.