{"id":19499,"library":"eslint-config-ckeditor5","title":"CKEditor 5 ESLint config","description":"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.","status":"active","version":"15.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/ckeditor/ckeditor5-linters-config","tags":["javascript","style guide","eslint","config","lint","ckeditor","eslintconfig"],"install":[{"cmd":"npm install eslint-config-ckeditor5","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-ckeditor5","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-ckeditor5","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Provides custom CKEditor 5 ESLint rules; bundled dependency of this config.","package":"eslint-plugin-ckeditor5-rules","optional":false}],"imports":[{"note":"Package is ESM-only since v15; CommonJS require() fails.","wrong":"const ckeditor5Config = require('eslint-config-ckeditor5');","symbol":"default","correct":"import ckeditor5Config from 'eslint-config-ckeditor5';"},{"note":"defineConfig() is from ESLint's own config module, not from this package.","wrong":"import { defineConfig } from 'eslint-config-ckeditor5';","symbol":"defineConfig","correct":"import { defineConfig } from 'eslint/config';"},{"note":"Plugin exports a single default object; named import structure may vary.","wrong":"import { rules } from 'eslint-plugin-ckeditor5-rules';","symbol":"eslint-plugin-ckeditor5-rules","correct":"import ckeditor5Rules from 'eslint-plugin-ckeditor5-rules';"}],"quickstart":{"code":"npm install --save-dev eslint-config-ckeditor5 eslint@^9.0.0 typescript@5.5.4\n\n// eslint.config.js\nimport { defineConfig } from 'eslint/config';\nimport ckeditor5Config from 'eslint-config-ckeditor5';\n\nexport default defineConfig([\n  {\n    extends: ckeditor5Config,\n  },\n]);\n\n// Optionally override rules:\n// rules: {\n//   'ckeditor5-rules/no-enum': 'off', // disable enum rule\n// }","lang":"javascript","description":"Install and configure the CKEditor 5 ESLint preset with flat config. Shows ESM import and basic usage."},"warnings":[{"fix":"Replace enums with string unions or object constants, or disable the rule: 'ckeditor5-rules/no-enum': 'off'.","message":"v15.0.0 enables ckeditor5-rules/no-enum by default — enums are disallowed. Existing code using enums will fail linting.","severity":"breaking","affected_versions":">=15.0.0"},{"fix":"Remove references to ckeditor-imports and no-legacy-imports from your ESLint config.","message":"v14.0.0 removed ckeditor-imports and no-legacy-imports rules. Old configs referencing these rules will cause unknown rule errors.","severity":"breaking","affected_versions":">=14.0.0"},{"fix":"Add node: prefix to all Node built-in imports: import { readFile } from 'node:fs';.","message":"v13.0.0 enables enforce-node-protocol rule, requiring node: protocol for Node.js built-in imports (e.g., fs → node:fs).","severity":"breaking","affected_versions":">=13.0.0"},{"fix":"Install TypeScript 5.5.4: npm install --save-dev typescript@5.5.4.","message":"Package requires TypeScript 5.5.4 exactly as peer dependency. Mismatched TypeScript versions may lead to errors.","severity":"gotcha","affected_versions":">=15.0.0"},{"fix":"Convert project to ESM, or use dynamic import inside a CommonJS wrapper: module.exports = import('eslint-config-ckeditor5');","message":"The config is ESM-only (type: module or .mjs extension required for eslint.config.js). CommonJS projects cannot use this config directly.","severity":"gotcha","affected_versions":">=15.0.0"},{"fix":"Ensure all CKEditor 5 imports use the package's main entry (e.g., '@ckeditor/ckeditor5-core' instead of '@ckeditor/ckeditor5-core/src/foo').","message":"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.","severity":"breaking","affected_versions":">=12.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use 'import' syntax in eslint.config.js, or rename file to .mjs if using CommonJS project.","cause":"Using require() on an ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module /path/to/eslint-config-ckeditor5/index.js from /path/to/eslint.config.js not supported."},{"fix":"Install it: npm install --save-dev eslint-plugin-ckeditor5-rules (it is a peer dependency).","cause":"eslint-plugin-ckeditor5-rules not installed or not resolved.","error":"ESLint couldn't find the plugin 'eslint-plugin-ckeditor5-rules'."},{"fix":"Use 'off' or 0 instead of false: 'ckeditor5-rules/no-enum': 'off'","cause":"Trying to disable the rule without proper value.","error":"Configuration for rule 'ckeditor5-rules/no-enum' is invalid: Value [object Object] is not a valid severity."},{"fix":"Import defineConfig from 'eslint/config', not from 'eslint-config-ckeditor5'.","cause":"Importing defineConfig from the wrong module.","error":"TypeError: defineConfig is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}