{"id":25512,"library":"eslint-plugin-grommet","title":"eslint-plugin-grommet","description":"An ESLint plugin providing lint rules for enforcing Grommet component best practices and accessibility (a11y). Current stable version is 0.2.0, released September 2023. It includes rules like anchor-label, formfield-htmlfor-id, button-icon-a11ytitle, etc. The plugin follows a semver-like cadence with minor feature releases. Key differentiators: it complements Grommet's own a11y guidance and reduces manual review for common misuses. Peer dependency: eslint ^7.31.0.","status":"active","version":"0.2.0","language":"javascript","source_language":"en","source_url":"https://github.com/grommet/eslint-plugin-grommet","tags":["javascript","eslint","eslintplugin","eslint-plugin","grommet","accessibility"],"install":[{"cmd":"npm install eslint-plugin-grommet","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-grommet","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-grommet","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency required to run the plugin","package":"eslint","optional":false}],"imports":[{"note":"Use 'plugin:grommet/recommended' to activate recommended rules. Plugins section is optional if using config only, but required for custom rule overrides.","wrong":"// Missing plugins or extension prefix\n{\n  \"extends\": [\"grommet/recommended\"]\n}","symbol":"plugin (recommended config)","correct":"// .eslintrc\n{\n  \"extends\": [\"plugin:grommet/recommended\"],\n  \"plugins\": [\"grommet\"]\n}"},{"note":"Rule names must be prefixed with 'grommet/'.","wrong":"{\n  \"rules\": {\n    \"anchor-label\": \"error\"\n  }\n}","symbol":"specific rule","correct":"// .eslintrc\n{\n  \"rules\": {\n    \"grommet/anchor-label\": \"error\"\n  }\n}"},{"note":"Package is 'eslint-plugin-grommet', not scoped.","wrong":"const plugin = require('@grommet/eslint-plugin-grommet');","symbol":"require in Node.js (CJS)","correct":"const plugin = require('eslint-plugin-grommet');"}],"quickstart":{"code":"// Install: npm install --save-dev eslint eslint-plugin-grommet\n// .eslintrc.json\n{\n  \"extends\": [\"plugin:grommet/recommended\"],\n  \"plugins\": [\"grommet\"],\n  \"rules\": {\n    \"grommet/anchor-label\": \"error\",\n    \"grommet/formfield-htmlfor-id\": \"warn\"\n  }\n}","lang":"json","description":"Shows installation and configuration to enable recommended rules and customize specific rules like 'anchor-label' and 'formfield-htmlfor-id'."},"warnings":[{"fix":"Use 'extends: [\"plugin:grommet/recommended\"]' and only disable rules sparingly after understanding consequences.","message":"Recommended config overrides may suppress important a11y checks.","severity":"gotcha","affected_versions":">=0.1.1"},{"fix":"Upgrade ESLint to >=7.31.0 (as per peerDependencies).","message":"ESLint peer dependency must be ^7.31.0 or later; older versions may cause unexpected behavior.","severity":"gotcha","affected_versions":">=0.1.0"},{"fix":"If you need to override any rule, include \"plugins\": [\"grommet\"] in .eslintrc.","message":"Plugins array may be omitted if only using recommended config, but then custom rules won't work without it.","severity":"gotcha","affected_versions":">=0.1.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 --save-dev eslint-plugin-grommet","cause":"Package not installed or symlinked incorrectly.","error":"ESLint couldn't find the plugin \"eslint-plugin-grommet\"."},{"fix":"Use 2 for error, 1 for warn, or 0 for off, or ensure your config format allows severity strings (ESLint supports strings).","cause":"Using a string like 'error' instead of numeric severity in some old config format.","error":"Configuration for rule \"grommet/anchor-label\" is invalid: Severity should be one of: 0, 1, 2 (off, warn, error)."},{"fix":"Ensure plugin is in plugins array and you're using v0.2.0 or later.","cause":"Plugin not loaded or rule not available in the version.","error":"Rule 'grommet/formfield-htmlfor-id' is not defined in the config."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}