CKEditor 5 ESLint config

raw JSON →
15.0.0 verified Sat Apr 25 auth: no javascript

Official ESLint preset for CKEditor 5 projects, version 15.0.0. Requires Node >=24.11.0, ESLint ^9.0.0, and TypeScript 5.5.4 as peer dependencies. Actively maintained by the CKEditor team with regular releases. Key differentiators: enforces CKEditor 5 coding style (e.g., no enums, node protocol, module tag validation) via custom rules from eslint-plugin-ckeditor5-rules. Designed for CKEditor 5 monorepo, includes rules for import patterns, changeset formatting, and CSS variable naming. Not recommended for non-CKEditor projects.

error Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/eslint-config-ckeditor5/index.js from /path/to/eslint.config.js not supported.
cause Using require() on an ESM-only package.
fix
Use 'import' syntax in eslint.config.js, or rename file to .mjs if using CommonJS project.
error ESLint couldn't find the plugin 'eslint-plugin-ckeditor5-rules'.
cause eslint-plugin-ckeditor5-rules not installed or not resolved.
fix
Install it: npm install --save-dev eslint-plugin-ckeditor5-rules (it is a peer dependency).
error Configuration for rule 'ckeditor5-rules/no-enum' is invalid: Value [object Object] is not a valid severity.
cause Trying to disable the rule without proper value.
fix
Use 'off' or 0 instead of false: 'ckeditor5-rules/no-enum': 'off'
error TypeError: defineConfig is not a function
cause Importing defineConfig from the wrong module.
fix
Import defineConfig from 'eslint/config', not from 'eslint-config-ckeditor5'.
breaking v15.0.0 enables ckeditor5-rules/no-enum by default — enums are disallowed. Existing code using enums will fail linting.
fix Replace enums with string unions or object constants, or disable the rule: 'ckeditor5-rules/no-enum': 'off'.
breaking v14.0.0 removed ckeditor-imports and no-legacy-imports rules. Old configs referencing these rules will cause unknown rule errors.
fix Remove references to ckeditor-imports and no-legacy-imports from your ESLint config.
breaking v13.0.0 enables enforce-node-protocol rule, requiring node: protocol for Node.js built-in imports (e.g., fs → node:fs).
fix Add node: prefix to all Node built-in imports: import { readFile } from 'node:fs';.
gotcha Package requires TypeScript 5.5.4 exactly as peer dependency. Mismatched TypeScript versions may lead to errors.
fix Install TypeScript 5.5.4: npm install --save-dev typescript@5.5.4.
gotcha The config is ESM-only (type: module or .mjs extension required for eslint.config.js). CommonJS projects cannot use this config directly.
fix Convert project to ESM, or use dynamic import inside a CommonJS wrapper: module.exports = import('eslint-config-ckeditor5');
breaking v12.0.0 added ckeditor5-rules/allow-imports-only-from-main-package-entry-point rule — restricts imports to main entry points of CKEditor 5 packages.
fix Ensure all CKEditor 5 imports use the package's main entry (e.g., '@ckeditor/ckeditor5-core' instead of '@ckeditor/ckeditor5-core/src/foo').
npm install eslint-config-ckeditor5
yarn add eslint-config-ckeditor5
pnpm add eslint-config-ckeditor5

Install and configure the CKEditor 5 ESLint preset with flat config. Shows ESM import and basic usage.

npm install --save-dev eslint-config-ckeditor5 eslint@^9.0.0 typescript@5.5.4

// eslint.config.js
import { defineConfig } from 'eslint/config';
import ckeditor5Config from 'eslint-config-ckeditor5';

export default defineConfig([
  {
    extends: ckeditor5Config,
  },
]);

// Optionally override rules:
// rules: {
//   'ckeditor5-rules/no-enum': 'off', // disable enum rule
// }