Lint JavaScript code embedded in block comments (e.g., JSDoc, YUIDoc code fences) using ESLint. Version 0.3.1 is the latest stable release; the package has low release cadence and is in maintenance mode. It does not provide its own rules but leverages existing ESLint configurations (eslint:recommended or eslint:all) on code blocks within comments. A key differentiator is enabling code quality checks on documentation examples, though it lacks active development and may not support ESLint versions beyond 8.x.
npm install eslint-plugin-doc-code-blocksNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Configures the plugin and a separate config to lint code blocks with custom rules, then runs eslint with that config.
Consider using '@eslint/plugin-markdown' or 'eslint-plugin-markdown' for similar functionality with better maintenance.
Prefer 'plugin:doc-code-blocks/recommended' which uses 'eslint:recommended', or define explicit rules.
Always run eslint with a dedicated config for code blocks (e.g., --config .doc.eslintrc.js).
Continue using .eslintrc.* files; plugin will not work with flat config introduced in ESLint 9.
Install the plugin globally: npm i -g eslint-plugin-doc-code-blocks
Ensure rule values are valid ESLint rule severity (e.g., 'error', 2) or an array: 'semi': ['error', 'always']
Set parserOptions: { 'sourceType': 'module' } in your .doc.eslintrc.js.