# eslint-config-mocg

> Shared, company-wide ESLint flat config for Node.js, NestJS, React, Next.js, and Vue projects — with an interactive installer.

Latest version **2.2.0** (published 2026-06-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install eslint-config-mocg
pnpm add eslint-config-mocg
yarn add eslint-config-mocg
bun add eslint-config-mocg
```

Provides the command `eslint-config-mocg`.

## Health

**Score 60/100 (C)** — status: active.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 2.2.0 |
| Published | 2026-06-30 |
| First published | 2026-06-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | ^22.21.0 \|\| >=24.10.0 |
| Dependencies | 30 |
| Unpacked size | 190.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Dmytro Vakulenko |
| Maintainers | mocg-admin |
| Keywords | eslint, eslint-config, eslintconfig, flat-config, typescript, react, next, nextjs, vue, nestjs, prettier, shareable-config |

## Links

- npm: https://www.npmjs.com/package/eslint-config-mocg
- Repository: https://github.com/moc-global/eslint-config
- Homepage: https://moc-global.github.io/eslint-config/
- Issues: https://github.com/moc-global/eslint-config/issues
- npm.io page: https://npm.io/package/eslint-config-mocg

## Dependencies (30)

- [json5](https://npm.io/package/json5.md) ^2.2.3
- [globals](https://npm.io/package/globals.md) ^17.5.0
- [prettier](https://npm.io/package/prettier.md) ^3.8.3
- [@eslint/js](https://npm.io/package/@eslint/js.md) ^10.0.1
- [@eslint/compat](https://npm.io/package/@eslint/compat.md) ^2.0.5
- [eslint-plugin-n](https://npm.io/package/eslint-plugin-n.md) ^18.1.0
- [eslint-plugin-zod](https://npm.io/package/eslint-plugin-zod.md) ^4.7.0
- [typescript-eslint](https://npm.io/package/typescript-eslint.md) ^8.59.1
- [eslint-plugin-jsdoc](https://npm.io/package/eslint-plugin-jsdoc.md) ^63.0.2
- [eslint-config-naming](https://npm.io/package/eslint-config-naming.md) ^1.9.1
- [eslint-plugin-depend](https://npm.io/package/eslint-plugin-depend.md) ^1.5.0
- [eslint-plugin-regexp](https://npm.io/package/eslint-plugin-regexp.md) ^3.1.0
- [@vitest/eslint-plugin](https://npm.io/package/@vitest/eslint-plugin.md) ^1.6.16
- [eslint-plugin-promise](https://npm.io/package/eslint-plugin-promise.md) ^7.3.0
- [eslint-plugin-sonarjs](https://npm.io/package/eslint-plugin-sonarjs.md) ^4.0.3
- [eslint-plugin-unicorn](https://npm.io/package/eslint-plugin-unicorn.md) ^65.0.1
- [eslint-config-prettier](https://npm.io/package/eslint-config-prettier.md) ^10.1.8
- [eslint-plugin-import-x](https://npm.io/package/eslint-plugin-import-x.md) ^4.16.2
- [eslint-plugin-lintlord](https://npm.io/package/eslint-plugin-lintlord.md) ^1.2.0
- [eslint-plugin-prettier](https://npm.io/package/eslint-plugin-prettier.md) ^5.5.5
- [eslint-plugin-security](https://npm.io/package/eslint-plugin-security.md) ^4.0.0
- [@stylistic/eslint-plugin](https://npm.io/package/@stylistic/eslint-plugin.md) ^5.10.0
- [eslint-plugin-boundaries](https://npm.io/package/eslint-plugin-boundaries.md) ^6.0.2
- [eslint-plugin-import-zod](https://npm.io/package/eslint-plugin-import-zod.md) ^1.2.1
- [eslint-plugin-no-secrets](https://npm.io/package/eslint-plugin-no-secrets.md) ^2.3.3
- [eslint-plugin-perfectionist](https://npm.io/package/eslint-plugin-perfectionist.md) ^5.9.0
- [eslint-plugin-unused-imports](https://npm.io/package/eslint-plugin-unused-imports.md) ^4.4.1
- [eslint-plugin-no-barrel-files](https://npm.io/package/eslint-plugin-no-barrel-files.md) ^1.3.1
- [eslint-plugin-simple-import-sort](https://npm.io/package/eslint-plugin-simple-import-sort.md) ^13.0.0
- [@dword-design/eslint-plugin-import-alias](https://npm.io/package/@dword-design/eslint-plugin-import-alias.md) ^8.1.8

## Recent versions

- 2.2.0 (latest) — 2026-06-30

## README

<p align="center">
  <img src="docs/public/logo.svg" alt="eslint-config-mocg" width="140">
</p>

# eslint-config-mocg

> The shared, company-wide ESLint flat config for Node.js, NestJS, React, Next.js, and Vue — with a one-command installer.

A single, versioned package that encodes one strict standard for our TypeScript and JavaScript. Core plugins ship bundled and version-locked; framework plugins load on demand. Adopt it in one command, govern it in one place.

## Quick start

```bash
npx eslint-config-mocg init
```

This detects your framework and package manager, installs what you need, writes `eslint.config.mjs`, and adds lint scripts. Or do it manually:

```bash
npm i -D eslint-config-mocg eslint
```

```js
// eslint.config.mjs
import { mocg } from 'eslint-config-mocg';

export default mocg(); // auto-detects your stack
```

```bash
npm run lint
```

## What it covers

- **Stacks:** Node/TypeScript (base), NestJS, React, Next.js (= React + Next), Vue
- **Add-ons:** Vite (React Fast Refresh), Vitest, Jest, Zod, i18next, Tailwind CSS
- **Out of the box:** type-aware TS linting, import hygiene, security rules, naming conventions, Prettier integration, dead-code detection, and more — see the [rules reference](./docs/reference/plugins.md).

## Examples

Five runnable example consumers live in [`examples/`](./examples) — each installs the
packed tarball and lints with a bare `export default mocg()` (Vue opts into type-aware
SFCs with `mocg({ vueTs: true })`):

| Example | Stack |
| --- | --- |
| [`typescript-app`](./examples/typescript-app) | Node + TypeScript, path aliases, layered architecture |
| [`react-app`](./examples/react-app) | React 19 + TypeScript (JSX runtime) |
| [`next-app`](./examples/next-app) | Next.js 16 — App Router + Pages Router, Route Handler, `'use client'` |
| [`nest-app`](./examples/nest-app) | NestJS — decorators, class-validator DTOs, Swagger |
| [`vue-app`](./examples/vue-app) | Vue 3 `<script setup lang="ts">` single-file components |

They double as living documentation **and** as a verification gate:
`npm run verify:examples` installs the freshly-packed config into each one and runs its
lint + typecheck, so a rule or plugin that breaks in a real consumer install fails
loudly. The husky **pre-push** hook runs it locally before every push.

## Installing without a public registry

Until it's published to a registry, install from Git or a tarball. The package is
authored in TypeScript and **builds itself on install** via the `prepare` script
(npm installs the build's devDependencies and compiles `dist/` automatically):

```jsonc
// git dependency — `prepare` compiles dist/ on install
"eslint-config-mocg": "git+ssh://git@github.com/moc-global/eslint-config.git#semver:^2"
```

```bash
# or a packed tarball (the tarball ships the prebuilt dist/)
npm run build && npm pack && npm i -D ./eslint-config-mocg-2.2.0.tgz
```

Once published, the registry tarball ships the prebuilt `dist/` (with `.d.ts`), so consumers need no build step.

## Adopting in an existing codebase

Don't fix everything at once. Baseline existing violations and ratchet down:

```bash
npx eslint-config-mocg init
npx eslint --suppress-all      # CI green today; only new violations fail
```

See [Existing & legacy projects](./docs/guide/existing-projects.md).

## Documentation

📖 **Published:** [moc-global.github.io/eslint-config](https://moc-global.github.io/eslint-config/)
— deployed from `main` by [`.github/workflows/docs.yml`](./.github/workflows/docs.yml)
(live once GitHub Pages is enabled with Source: "GitHub Actions").

Or run it locally (`npm run docs:dev`). Start with:

- [Why this config](./docs/guide/why.md)
- [Getting started](./docs/guide/getting-started.md)
- [How it works](./docs/guide/how-it-works.md)
- [Stacks & add-ons](./docs/guide/stacks.md)
- [The installer CLI](./docs/guide/cli.md)
- [API reference](./docs/reference/api.md)
- [Rules & plugins](./docs/reference/plugins.md)
- [Contributing](./docs/guide/contributing.md)

## Development

```bash
npm install              # legacy-peer-deps; `prepare` builds dist/ and installs husky git hooks
npm run build            # tsc → dist/*.js + *.d.ts
npm run lint             # the config lints its own TypeScript source
npm run typecheck
npm run test:run         # vitest — includes the React/Nest/Vue dogfood tests
npm run verify:examples  # install the packed config into examples/* and lint each
npm run docs:dev
```

All checks run **locally** via a **husky `pre-push` hook** before every push:
`lint` + `typecheck` + `test:run` (whose dogfood tests compose `mocg()` for each stack and
lint a fixture) + `docs:build` + `pack:check` + `verify:examples`. The checks workflow
(`.github/workflows/ci.yml`) is kept on hand but **disabled** for now (manual-only); the
docs deploy (`.github/workflows/docs.yml`) is the one active workflow. Use
`git push --no-verify` to skip the hook for a one-off push.

## License

MIT — Master of Code Global. Maintained by Dmytro Vakulenko.

---
_Source: https://npm.io/package/eslint-config-mocg · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
