Files
tools/configs/eslint/rules/base.md
T
robonen 7693b49253 chore(configs): migrate oxlint→eslint presets, refactor tsconfig
- Replace @robonen/oxlint with @robonen/eslint (composable ESLint flat-config
  presets: base, typescript, vue, vitest, imports, node, stylistic).
- Plugins bundled as deps: typescript-eslint, eslint-plugin-vue,
  @vitest/eslint-plugin, eslint-plugin-import-x, eslint-plugin-n,
  eslint-plugin-unicorn, @stylistic/eslint-plugin.
- @robonen/tsconfig: add base/dom/node/vue configs for composite project refs.
2026-06-07 16:28:10 +07:00

1.1 KiB

base preset

Purpose

Базовый quality-профиль для JS/TS-проектов: корректность, анти-паттерны, безопасные дефолты. Включает @eslint/js recommended (аналог oxlint-категории correctness) + правила unicorn.

Key Rules

  • eqeqeq: запрещает ==, требует ===.
  • no-unused-vars: запрещает неиспользуемые переменные (кроме _name).
  • no-eval, no-var, prefer-const.
  • unicorn/prefer-node-protocol: требует node: для built-in модулей.
  • unicorn/no-thenable: запрещает thenable-объекты.

Правила oxc/* из @robonen/oxlint не имеют аналога в ESLint и были убраны; их назначение покрывается @eslint/js recommended и unicorn.

Examples

// ✅ Good
import { readFile } from 'node:fs/promises';

const id = 42;
if (id === 42) {
  throw new Error('unexpected');
}

// ❌ Bad
import { readFile } from 'fs/promises';

var id = 42;
if (id == '42') {
  throw 'unexpected';
}