{"id":19936,"library":"eslint-plugin-smarthr","title":"eslint-plugin-smarthr","description":"A sharable ESLint plugin for SmartHR applications, providing a comprehensive set of accessibility (a11y), best-practice, and import-related lint rules. Version 6.13.0 is the latest stable, released in April 2026. Developed by KUFU (tamatebako), it includes auto-fixers for SmartHR UI migrations (e.g., v91→v92, v92→v93), barrel import enforcement, and over 30 rules. Requires ESLint 9 (peer dependency). Differentiates from generic eslint plugins by being specifically tailored to SmartHR's design system and conventions, with active maintenance (multiple releases per month) and a focus on accessibility and migration assistance.","status":"active","version":"6.13.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/kufu/tamatebako","tags":["javascript","eslint","eslint-plugin","eslintplugin","smarthr"],"install":[{"cmd":"npm install eslint-plugin-smarthr","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-plugin-smarthr","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-plugin-smarthr","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"peer dependency; plugin requires ESLint 9 to function","package":"eslint","optional":false}],"imports":[{"note":"ESM-only since v6; CommonJS require is not supported. The default export is the plugin object.","wrong":"const smarthr = require('eslint-plugin-smarthr')","symbol":"eslint-plugin-smarthr (default)","correct":"import smarthr from 'eslint-plugin-smarthr'"},{"note":"Rules are not exported individually; they are referenced by name in the ESLint config (e.g., 'smarthr/a11y-anchor-has-href-attribute').","wrong":"import { a11yAnchorHasHrefAttribute } from 'eslint-plugin-smarthr'","symbol":"smarthr/a11y-anchor-has-href-attribute","correct":"import 'eslint-plugin-smarthr' (configure in eslint.config.js as 'smarthr/a11y-anchor-has-href-attribute')"},{"note":"v6 uses flat config only; the old .eslintrc format is unsupported. Use array spread to include recommended rules.","wrong":"module.exports = { plugins: ['smarthr'], extends: ['plugin:smarthr/recommended'] }","symbol":"flat config (eslint.config.js)","correct":"import smarthr from 'eslint-plugin-smarthr';\nexport default [...smarthr.configs.recommended];"}],"quickstart":{"code":"// Install: npm install --save-dev eslint eslint-plugin-smarthr\n\n// eslint.config.js (flat config)\nimport smarthr from 'eslint-plugin-smarthr'\n\nexport default [\n  {\n    ignores: ['dist/', 'node_modules/'],\n  },\n  ...smarthr.configs.recommended,\n  {\n    plugins: { smarthr },\n    rules: {\n      'smarthr/a11y-anchor-has-href-attribute': 'error',\n      'smarthr/require-barrel-import': ['error', { additionalBarrelFileNames: ['index.ts'] }],\n    },\n  },\n]\n\n// Then run: npx eslint .","lang":"typescript","description":"Shows how to install and configure eslint-plugin-smarthr using flat config, including recommended rules and custom rule settings."},"warnings":[{"fix":"Upgrade ESLint to ^9.0.0 or use eslint-plugin-smarthr v5 if ESLint 8 is required.","message":"ESLint 9 peer dependency: eslint-plugin-smarthr v6 requires ESLint 9. Older ESLint versions (8.x) are not supported.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Migrate to flat config using eslint.config.js. See quickstart example.","message":"Flat config only: v6+ no longer supports .eslintrc config format. Using 'extends' in .eslintrc will not work.","severity":"breaking","affected_versions":">=6.0.0"},{"fix":"Replace with 'best-practice-for-interactive-element' rule.","message":"Rule 'a11y-delegate-element-has-role-presentation' removed in v14 of config (plugin still present).","severity":"deprecated","affected_versions":">=6.13.0"},{"fix":"Use import syntax in an ES module (type: 'module' in package.json or .mjs extension).","message":"CommonJS require does not work: the plugin is ESM-only. Using require('eslint-plugin-smarthr') throws an error.","severity":"gotcha","affected_versions":">=6.0.0"},{"fix":"Reference rules in config as 'smarthr/rule-name'.","message":"Rule names are strings with 'smarthr/' prefix; direct named imports like import { a11yAnchorHasHrefAttribute } are not available.","severity":"gotcha","affected_versions":"all"}],"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-smarthr","cause":"Plugin not installed or not in node_modules.","error":"ESLint couldn't find the plugin 'eslint-plugin-smarthr'."},{"fix":"Change to import statement in an ES module: import smarthr from 'eslint-plugin-smarthr'","cause":"Using require() to load the plugin (CommonJS).","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module ... not supported."},{"fix":"Check rule name in the plugin documentation. Example: 'smarthr/a11y-anchor-has-href-attribute' (note hyphenation).","cause":"Rule name misspelled or not defined in the plugin version.","error":"Configuration for rule 'smarthr/a11y-anchor-has-href-attribute' is invalid: unknown rule."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}