{"_id":"@bollgade/eslint-config","name":"@bollgade/eslint-config","dist-tags":{"latest":"1.0.0"},"versions":{"1.0.0":{"name":"@bollgade/eslint-config","version":"1.0.0","description":"One-stop ESLint flat config for TypeScript, Node, NestJS, React, and Next.js","license":"MIT","type":"module","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":"./dist/index.js"},"keywords":["eslint","eslintconfig","eslint-config","eslint flat config","flat config","typescript","prettier","import","unused-imports","node","nestjs","react","next","nextjs","bollgade"],"author":{"name":"Bollgade","email":"bollgade@gmail.com"},"scripts":{"build":"tsup src/index.ts --format esm --dts --clean --minify","prepublishOnly":"npm run build","lint:ts":"eslint \"**/*.{ts,tsx}\" --max-warnings=0","lint:ts:fix":"npm run lint:ts -- --fix","type-check":"tsc --project ./tsconfig.json --noEmit","test":"vitest run","test:watch":"vitest"},"repository":{"type":"git","url":"git+https://github.com/bollgade/eslint-config.git"},"bugs":{"url":"https://github.com/bollgade/eslint-config/issues"},"homepage":"https://github.com/bollgade/eslint-config#readme","publishConfig":{"access":"public"},"peerDependencies":{"eslint":">=9.0.0"},"dependencies":{"@eslint/js":"^9.18.0","@stylistic/eslint-plugin":"^5.2.3","eslint-config-prettier":"10.1.8","eslint-import-resolver-typescript":"^4.4.4","eslint-plugin-import":"^2.32.0","eslint-plugin-prettier":"^5.5.4","eslint-plugin-unused-imports":"^4.1.4","globals":"^15.0.0","local-pkg":"^0.5.1","typescript-eslint":"^8.40.0"},"optionalDependencies":{"@next/eslint-plugin-next":"^15.0.0","eslint-plugin-i18next":"^6.1.0","eslint-plugin-jsx-a11y":"^6.10.0","eslint-plugin-react":"^7.37.0","eslint-plugin-react-component-name":"^2.0.0","eslint-plugin-react-hooks":"^5.1.0","eslint-plugin-storybook":"^9.0.0"},"devDependencies":{"@types/node":"^22.10.7","eslint":"^9.18.0","jiti":"2.6.1","tsup":"^8.5.1","typescript":"^5.9.3","vitest":"^3.0.0"},"engines":{"node":">=18.18.0"},"gitHead":"277d15c15d4693e04d4f3cfe902276e7ae804cae","_id":"@bollgade/eslint-config@1.0.0","_nodeVersion":"24.11.1","_npmVersion":"11.6.2","dist":{"integrity":"sha512-sxfwesMKlRHN5ur+CKg/28vhQt8KarU74GK7oGlBEJVK6w1QPyAgflOibgkck4RP0O0tTBUMU9eEjxzwrJlabA==","shasum":"8d81128c144e372359f45388a71b855fdb279c68","tarball":"https://registry.npmjs.org/@bollgade/eslint-config/-/eslint-config-1.0.0.tgz","fileCount":5,"unpackedSize":17915,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQC6VZMkZ8kbSmTDO3TP2yuKHCwVrE3/bPSXum4Qrbx4QQIhALXAvel03rfvF2bjDAZsOvHYvyub5HKj3Is50opaOP0E"}]},"_npmUser":{"name":"bollgade","email":"bollgade@yandex.ru"},"directories":{},"maintainers":[{"name":"bollgade","email":"bollgade@yandex.ru"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/eslint-config_1.0.0_1772602552265_0.16620381456578048"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-04T05:35:52.113Z","1.0.0":"2026-03-04T05:35:52.424Z","modified":"2026-03-04T05:35:52.671Z"},"maintainers":[{"name":"bollgade","email":"bollgade@yandex.ru"}],"description":"One-stop ESLint flat config for TypeScript, Node, NestJS, React, and Next.js","homepage":"https://github.com/bollgade/eslint-config#readme","keywords":["eslint","eslintconfig","eslint-config","eslint flat config","flat config","typescript","prettier","import","unused-imports","node","nestjs","react","next","nextjs","bollgade"],"repository":{"type":"git","url":"git+https://github.com/bollgade/eslint-config.git"},"author":{"name":"Bollgade","email":"bollgade@gmail.com"},"bugs":{"url":"https://github.com/bollgade/eslint-config/issues"},"license":"MIT","readme":"# @bollgade/eslint-config\n\n[![npm](https://img.shields.io/npm/v/@bollgade/eslint-config)](https://www.npmjs.com/package/@bollgade/eslint-config)\n[![downloads](https://img.shields.io/npm/dm/@bollgade/eslint-config)](https://www.npmjs.com/package/@bollgade/eslint-config)\n\nOne-stop **ESLint flat config** factory for TypeScript projects: Node.js, NestJS, React, and Next.js.\n\nInspired by [antfu/eslint-config](https://github.com/antfu/eslint-config): a single package where framework support is opt-in via `optionalDependencies` and auto-detected from your project's installed packages.\n\n## Installation\n\n```bash\nnpm install -D @bollgade/eslint-config\n```\n\nFramework plugins are **optional** — install only what you need:\n\n```bash\n# React\nnpm install -D eslint-plugin-react eslint-plugin-react-hooks\n\n# Next.js\nnpm install -D @next/eslint-plugin-next\n\n# Accessibility\nnpm install -D eslint-plugin-jsx-a11y\n\n# i18n\nnpm install -D eslint-plugin-i18next\n\n# Storybook\nnpm install -D eslint-plugin-storybook\n```\n\n## Usage\n\nCreate `eslint.config.mts` (or `.js`):\n\n```ts\nimport { createConfig } from '@bollgade/eslint-config';\n\nexport default createConfig();\n```\n\n`createConfig` returns `Promise<Linter.Config[]>` — ESLint flat config supports async exports out of the box.\n\n---\n\n## Presets\n\n### TypeScript + Node.js (backend, default)\n\n```ts\nexport default createConfig();\n// typescript: true, node: true, prettier: true, stylistic: true, imports: true\n// react/next/nest: auto-detected from node_modules\n```\n\n### NestJS\n\n```ts\nexport default createConfig({\n  nest: true, // disables @typescript-eslint/no-extraneous-class for module classes\n});\n```\n\n### React\n\n```ts\nexport default createConfig({\n  react: true,\n  // auto-detects: jsx-a11y, i18next, storybook, react-component-name\n});\n```\n\n### Next.js\n\n```ts\nexport default createConfig({\n  next: true, // implies react: true automatically\n});\n```\n\n### With local overrides\n\n```ts\nimport { createConfig } from '@bollgade/eslint-config';\nimport { defineConfig } from 'eslint/config';\n\nconst base = await createConfig({ react: true });\n\nexport default defineConfig(...base, {\n  rules: {\n    'no-console': 'off',\n  },\n});\n```\n\n---\n\n## All options\n\nEvery option is `boolean | OptionsObject`. Passing `false` disables the layer entirely, passing an object enables it with custom settings.\n\n| Option | Type | Default | Description |\n|---|---|---|---|\n| `typescript` | `boolean \\| TypescriptOptions` | `true` | typescript-eslint with typed linting |\n| `node` | `boolean \\| NodeOptions` | `true` | Node.js globals |\n| `nest` | `boolean \\| NestOptions` | auto-detect | NestJS-specific rule relaxations |\n| `react` | `boolean \\| ReactOptions` | auto-detect | React + hooks plugins |\n| `next` | `boolean \\| NextOptions` | auto-detect | Next.js plugin (implies `react: true`) |\n| `prettier` | `boolean \\| PrettierOptions` | `true` | Prettier formatting integration |\n| `stylistic` | `boolean \\| StylisticOptions` | `true` | @stylistic/eslint-plugin |\n| `imports` | `boolean \\| ImportsOptions` | `true` | Import ordering and hygiene |\n\n### TypescriptOptions\n\n```ts\ncreateConfig({\n  typescript: {\n    tsconfigPath: './tsconfig.json',  // or array of paths\n    strictTypeChecked: true,           // false → uses recommended preset\n    rules: { /* override specific rules */ },\n  },\n});\n```\n\n### ReactOptions\n\n```ts\ncreateConfig({\n  react: {\n    version: 'detect',     // React version for eslint-plugin-react\n    a11y: true,            // jsx-a11y (auto-detect)\n    i18n: true,            // eslint-plugin-i18next (auto-detect)\n    storybook: true,       // eslint-plugin-storybook (auto-detect)\n    componentName: true,   // eslint-plugin-react-component-name (auto-detect)\n    rules: { /* override specific rules */ },\n  },\n});\n```\n\n### ReactI18nOptions\n\n```ts\ncreateConfig({\n  react: {\n    i18n: {\n      ignoreAttribute: ['to', 'as', 'name', 'data-testid'],\n      rules: {},\n    },\n  },\n});\n```\n\n### ReactComponentNameOptions\n\n```ts\ncreateConfig({\n  react: {\n    componentName: {\n      targets: ['memo', 'forwardRef', 'observer'],\n    },\n  },\n});\n```\n\n---\n\n## What's included\n\n| Layer | Always on | Plugin(s) | Key rules |\n|---|---|---|---|\n| **base** | ✓ | `@eslint/js` | `no-console: warn`, `max-len: 120`, `prefer-arrow-callback` |\n| **typescript** | ✓ | `typescript-eslint` | `strictTypeChecked`, `no-floating-promises`, `no-unused-vars` |\n| **stylistic** | ✓ | `@stylistic/eslint-plugin` | semi, arrowParens, quote-props |\n| **imports** | ✓ | `eslint-plugin-import`, `eslint-plugin-unused-imports` | `import/order`, `no-unused-imports` |\n| **prettier** | ✓ | `eslint-plugin-prettier` | `singleQuote: true` |\n| **node** | ✓ | — | `globals.node`, `globals.jest` |\n| **nest** | auto | — | `no-extraneous-class: off` |\n| **react** | auto | `eslint-plugin-react`, `eslint-plugin-react-hooks` | hooks rules, JSX rules |\n| **react › a11y** | auto | `eslint-plugin-jsx-a11y` | `label-has-associated-control` |\n| **react › i18n** | auto | `eslint-plugin-i18next` | `no-literal-string` |\n| **react › storybook** | auto | `eslint-plugin-storybook` | story file rules |\n| **react › componentName** | auto | `eslint-plugin-react-component-name` | display names for memo/forwardRef |\n| **next** | auto | `@next/eslint-plugin-next` | recommended Next.js rules |\n\n---\n\n## Auto-detection\n\nFrameworks are auto-detected by checking your `node_modules`:\n\n| Option | Detected when |\n|---|---|\n| `nest` | `@nestjs/core` is installed |\n| `react` | `react` is installed |\n| `next` | `next` is installed |\n| `react.a11y` | `eslint-plugin-jsx-a11y` is installed |\n| `react.i18n` | `eslint-plugin-i18next` is installed |\n| `react.storybook` | `eslint-plugin-storybook` is installed |\n| `react.componentName` | `eslint-plugin-react-component-name` is installed |\n\nYou can always override auto-detection explicitly:\n\n```ts\ncreateConfig({\n  react: true,       // force-enable even if react not in node_modules\n  nest: false,       // force-disable even if @nestjs/core is installed\n});\n```\n\n---\n\n## Implies logic\n\n- `nest: true` → always adds Node.js globals (even if `node: false`)\n- `next: true` → always adds React layer (even if `react: false`)\n\n---\n\n## Roadmap\n\n- [ ] **Typed rules** — fully typed `rules` overrides per plugin (currently `Partial<Linter.RulesRecord>`)\n- [ ] **`projectService` support** — alternative to `tsconfigPath` in `TypescriptOptions` for monorepos\n- [ ] **Separate test layer** — dedicated `test` option with Jest/Vitest globals instead of bundling them in `node`\n","readmeFilename":"README.md","_rev":"1-9d12b81a814c7b12155ee15162bbfc95"}