7693b49253
- 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.
1.1 KiB
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/jsrecommended и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';
}