{"id":19709,"library":"eslint-plugin-ckeditor5-rules","title":"eslint-plugin-ckeditor5-rules","description":"Official ESLint plugin used by the CKEditor 5 team for enforcing project-specific code style and linting rules. Current stable version is 15.0.0 (released as part of CKEditor 5 linters config). The plugin follows CKEditor 5's major/minor versioning policy, with breaking changes occurring in major releases. It provides rules for import validation, license headers, no-enum, module tag validation, changelog formatting, and more. Typically used via the eslint-config-ckeditor5 preset, but can be used standalone. Requires Node.js >=24.11.0. Differentiators: tightly coupled with CKEditor 5 development workflow; includes rules like `cross-package-imports`, `no-relative-imports`, and `allow-imports-only-from-main-package-entry-point` that enforce strict module boundaries.","status":"active","version":"15.0.0","language":"javascript","source_language":"en","source_url":"https://github.com/ckeditor/ckeditor5-linters-config","tags":["javascript","eslint","imports","config","lint","ckeditor","eslintplugin"],"install":[{"cmd":"npm install eslint-plugin-ckeditor5-rules","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-ckeditor5-rules","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-ckeditor5-rules","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency for plugin functionality","package":"eslint","optional":false}],"imports":[{"note":"ESM-only package since v13; does not provide CommonJS export","wrong":"const ckeditor5Rules = require('eslint-plugin-ckeditor5-rules')","symbol":"default","correct":"import ckeditor5Rules from 'eslint-plugin-ckeditor5-rules'"},{"note":"ESLint flat config requires plugin object, not string array","wrong":"plugins: ['ckeditor5-rules']","symbol":"plugins","correct":"plugins: { 'ckeditor5-rules': ckeditor5Rules }"},{"note":"Rule names must be prefixed with 'ckeditor5-rules/' in flat config","wrong":"'no-relative-imports': 'error'","symbol":"rules","correct":"'ckeditor5-rules/no-relative-imports': 'error'"}],"quickstart":{"code":"import { defineConfig } from 'eslint/config';\nimport ckeditor5Rules from 'eslint-plugin-ckeditor5-rules';\n\nexport default defineConfig([\n  {\n    plugins: {\n      'ckeditor5-rules': ckeditor5Rules\n    },\n    rules: {\n      'ckeditor5-rules/no-relative-imports': 'error',\n      'ckeditor5-rules/license-header': ['error', {\n        headerLines: [\n          '/**',\n          ' * @license Copyright (c) 2003-2026, CKSource Holding sp. z o.o. All rights reserved.',\n          ' * For licensing, see LICENSE.md or https://ckeditor.com/legal/ckeditor-oss-license',\n          ' */'\n        ]\n      }],\n      'ckeditor5-rules/no-enum': 'error'\n    }\n  }\n]);","lang":"javascript","description":"Minimal ESLint flat config using the plugin with two CKEditor 5 rules"},"warnings":[{"fix":"Use 'allow-imports-only-from-main-package-entry-point' rule instead","message":"Removed 'ckeditor-imports' rule in v14.0.0","severity":"breaking","affected_versions":">=14.0.0"},{"fix":"Remove the rule from your config; it is no longer needed","message":"Removed 'no-legacy-imports' rule in v14.0.0","severity":"breaking","affected_versions":">=14.0.0"},{"fix":"Use TypeScript union types instead of enums, or disable the rule if you must use enums","message":"The 'ckeditor5-rules/no-enum' rule is enabled by default in eslint-config-ckeditor5 since v15.0.0, disallowing enums unconditionally","severity":"deprecated","affected_versions":">=15.0.0"},{"fix":"Upgrade Node.js to 24.11.0 or later","message":"Requires Node.js >=24.11.0; older Node versions will cause runtime errors","severity":"gotcha","affected_versions":">=14.0.0"},{"fix":"Use import syntax and ESLint flat config","message":"ESM-only package; cannot be used with CommonJS require or older ESLint (legacy .eslintrc) formats","severity":"gotcha","affected_versions":">=13.0.0"},{"fix":"Ensure all 'node:' imports use the full URL (e.g., 'node:fs') or disable the rule","message":"Enabled 'enforce-node-protocol' rule for all JS/TS files in v13.0.0","severity":"breaking","affected_versions":">=13.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npm install --save-dev eslint-plugin-ckeditor5-rules' and verify the import is correct (ESM only)","cause":"Package not installed or incorrect import path","error":"Error: Cannot find module 'eslint-plugin-ckeditor5-rules'"},{"fix":"Use 'ckeditor5-rules/no-relative-imports': 'error' (include the prefix)","cause":"Rule name not prefixed correctly in flat config","error":"ESLint configuration error: [\"ckeditor5-rules/no-relative-imports\"] is not a valid rule"},{"fix":"Change to 'import ckeditor5Rules from 'eslint-plugin-ckeditor5-rules'' and ensure your project uses ESM","cause":"Using CommonJS require() on an ESM-only package","error":"TypeError: ckeditor5Rules is not a function or object"},{"fix":"Use 'ckeditor5-rules/allow-imports-only-from-main-package-entry-point' instead","cause":"Rule was removed in v14.0.0","error":"Unsupported rule: ckeditor5-rules/ckeditor-imports"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}