{"id":25498,"library":"eslint-plugin-annotation","title":"eslint-plugin-annotation","description":"ESLint plugin providing lint rules to validate and auto-correct code based on JSDoc-like annotations in comments. Current stable version 1.1.6, released 2023. Supports Node 12, 14, 16+. Differentiators: allows enforcing sort order, uniqueness, and date format via annotation comments, with autofix support for sort and unique rules. Lightweight, no external runtime dependencies beyond ESLint peer dependency.","status":"active","version":"1.1.6","language":"javascript","source_language":"en","source_url":"https://github.com/ronparkdev/eslint-plugin-annotation","tags":["javascript","eslint","eslintplugin","eslint-plugin","import","relative","modules","autofix"],"install":[{"cmd":"npm install eslint-plugin-annotation","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-annotation","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-annotation","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency required for plugin to function","package":"eslint","optional":false}],"imports":[{"note":"ESLint plugins are typically loaded via plugins array in config; explicit import only needed for programmatic use.","wrong":"const annotation = require('eslint-plugin-annotation')","symbol":"plugin","correct":"import annotation from 'eslint-plugin-annotation'"},{"note":"ESM-only; named export for rules object.","wrong":"","symbol":"rules","correct":"import { rules } from 'eslint-plugin-annotation'"},{"note":"ESM-only; configs export for presets.","wrong":"const configs = require('eslint-plugin-annotation').configs","symbol":"configs","correct":"import { configs } from 'eslint-plugin-annotation'"}],"quickstart":{"code":"// .eslintrc.js\nmodule.exports = {\n  plugins: ['annotation'],\n  rules: {\n    'annotation/format-date': 'error',\n    'annotation/sort-keys': 'error',\n    'annotation/sort': 'error',\n    'annotation/unique': 'error',\n  },\n};\n\n// For programmatic usage (ESM):\n// import annotation from 'eslint-plugin-annotation';\n// const linter = new ESLint({ plugins: { annotation } });","lang":"javascript","description":"Shows ESLint config to enable all four rules and optional programmatic usage import."},"warnings":[{"fix":"Add the appropriate annotation comment above the target code block.","message":"Rules only work if annotation comments are present in the code (e.g., @sort, @unique). Without them, rules silently pass.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use --fix-dry-run to preview changes.","message":"Autofix for sort and sort-keys rules may change array or object order unexpectedly; review before committing.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Upgrade Node to supported version.","message":"Plugin only supports Node ^12.22.0 || ^14.17.0 || >=16.0.0; older Node versions not supported.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install eslint-plugin-annotation --save-dev'","cause":"Plugin not installed or not in node_modules.","error":"Error: Failed to load plugin 'annotation' declared in '.eslintrc.js': Cannot find module 'eslint-plugin-annotation'"},{"fix":"Update ESLint to version 8 or later: 'npm install eslint@latest --save-dev'","cause":"ESLint version incompatible (may need ESLint >=8).","error":"Oops! Something went wrong! :(. ESLint: 7.x encountered an unexpected error."},{"fix":"Ensure annotation comment is on its own line above the target, e.g., '// @sort' or '/* @sort */'","cause":"Syntax error in annotation or using wrong format.","error":"Parsing error: The keyword '@sort' is not supported"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}