@kommo-crm/eslint-config
v0.1.0
Published
Shared ESLint configuration for Kommo projects
Downloads
139
Readme
@kommo-crm/eslint-config
Shared ESLint configuration for Kommo projects, widgets, and open-source repositories.
Status: 0.x (beta, skeleton). Package layout, build, and release pipeline are ready; rule content is being added in follow-up iterations.
Contents
The package ships the following exports:
| Subpath | Purpose | Status |
| --------------------------------- | ---------------------------------------------------------- | -------- |
| @kommo-crm/eslint-config | ESLint flat-config presets (base, typescript, react) | skeleton |
| @kommo-crm/eslint-config/legacy | Legacy entry for .eslintrc (ESLint 8) | skeleton |
| @kommo-crm/eslint-config/types | Global TypeScript types (DistributiveOmit etc.) | skeleton |
Installation
pnpm add -D @kommo-crm/eslint-config eslint typescripteslint and typescript are peer dependencies — the package does not pull them in.
Usage — ESLint 9 (flat config)
// eslint.config.mjs
import { base, typescript, react } from '@kommo-crm/eslint-config';
export default [
...base(),
...typescript(),
...react(),
// project-specific overrides
{
rules: {
'no-restricted-globals': ['error', 'RegExp', 'MutationObserver'],
},
},
];Every preset accepts an options object with rule overrides:
...base({ rules: { 'no-console': 'off' } }),TypeScript types
To pull in DistributiveOmit and other ambient types, add the types subpath to your tsconfig.json:
{
"compilerOptions": {
"types": ["@kommo-crm/eslint-config/types"],
},
}Usage — ESLint 8 (.eslintrc)
// .eslintrc.js
module.exports = {
extends: ['@kommo-crm/eslint-config/legacy'],
};The legacy entry is auto-generated from the flat-config presets on every build. It will be deprecated once all projects migrate to flat config.
Development
This package lives in a turborepo monorepo. Run commands from the
repository root (they fan out via turbo) or scope them to this package with
pnpm --filter @kommo-crm/eslint-config <script>.
pnpm install
pnpm build # tsup → dist/ (+ copy-assets + build-legacy)
pnpm typecheck # tsc --noEmit
pnpm lint # eslint .
pnpm test # node --test with tsx loader
pnpm dev # tsup --watchReleases
Releases are cut manually by maintainers and triggered by pushing an annotated vX.Y.Z tag. The release workflow then runs make verify, publishes to npm with pnpm publish, and creates a GitHub Release.
Commits follow Conventional Commits — feat:, fix:, feat!: (breaking), etc. — enforced by commitlint locally and in CI. The maintainer uses these types to choose the patch/minor/major bump and to hand-curate CHANGELOG.md, which is the source of truth for what shipped in each version.
The full runbook lives in RELEASING.md.
Structure
src/
├── index.ts # public API: base, typescript, react
├── presets/
│ ├── base.ts
│ ├── typescript.ts
│ └── react.ts
└── types/
└── global.d.ts # DistributiveOmitThe custom ESLint rules consumed by these presets live in a separate package,
@kommo-crm/eslint-plugin, and are registered under the
kommo namespace.
dist/legacy.cjs (the ESLint 8 entry) is generated at build time by scripts/build-legacy.mjs.
Planned follow-up iterations:
- Fill presets with rules from
core_backend/frontend/eslint.config.mjs - Snapshot + RuleTester tests
fsd/widgetpresets withimport-xpathGroups- A separate
@kommo-crm/stylelint-configpackage
License
MIT — see LICENSE.
