Registry / testing / eslint-plugin-smarthr

eslint-plugin-smarthr

JSON →
library6.13.0jsnpmunverified

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.

npm install eslint-plugin-smarthr
INSTALL
IMPORT
SIG · ESLINT-PLUGIN-SMAR
E
eslint-plugin-smarthr
testingjavascriptv6.13.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

eslint-plugin-smarthr (default)
import smarthr from 'eslint-plugin-smarthr'
const smarthr = require('eslint-plugin-smarthr')
ESM-only since v6; CommonJS require is not supported. The default export is the plugin object.
smarthr/a11y-anchor-has-href-attribute
import 'eslint-plugin-smarthr' (configure in eslint.config.js as 'smarthr/a11y-anchor-has-href-attribute')
import { a11yAnchorHasHrefAttribute } from 'eslint-plugin-smarthr'
Rules are not exported individually; they are referenced by name in the ESLint config (e.g., 'smarthr/a11y-anchor-has-href-attribute').
flat config (eslint.config.js)
import smarthr from 'eslint-plugin-smarthr'; export default [...smarthr.configs.recommended];
module.exports = { plugins: ['smarthr'], extends: ['plugin:smarthr/recommended'] }
v6 uses flat config only; the old .eslintrc format is unsupported. Use array spread to include recommended rules.

Shows how to install and configure eslint-plugin-smarthr using flat config, including recommended rules and custom rule settings.

// Install: npm install --save-dev eslint eslint-plugin-smarthr // eslint.config.js (flat config) import smarthr from 'eslint-plugin-smarthr' export default [ { ignores: ['dist/', 'node_modules/'], }, ...smarthr.configs.recommended, { plugins: { smarthr }, rules: { 'smarthr/a11y-anchor-has-href-attribute': 'error', 'smarthr/require-barrel-import': ['error', { additionalBarrelFileNames: ['index.ts'] }], }, }, ] // Then run: npx eslint .
Debug
Known issues
breakingESLint 9 peer dependency: eslint-plugin-smarthr v6 requires ESLint 9. Older ESLint versions (8.x) are not supported.
fix
Upgrade ESLint to ^9.0.0 or use eslint-plugin-smarthr v5 if ESLint 8 is required.
affects: >=6.0.0
breakingFlat config only: v6+ no longer supports .eslintrc config format. Using 'extends' in .eslintrc will not work.
fix
Migrate to flat config using eslint.config.js. See quickstart example.
affects: >=6.0.0
deprecatedRule 'a11y-delegate-element-has-role-presentation' removed in v14 of config (plugin still present).
fix
Replace with 'best-practice-for-interactive-element' rule.
affects: >=6.13.0
gotchaCommonJS require does not work: the plugin is ESM-only. Using require('eslint-plugin-smarthr') throws an error.
fix
Use import syntax in an ES module (type: 'module' in package.json or .mjs extension).
affects: >=6.0.0
gotchaRule names are strings with 'smarthr/' prefix; direct named imports like import { a11yAnchorHasHrefAttribute } are not available.
fix
Reference rules in config as 'smarthr/rule-name'.
affects: all
Errors
Common errors & fixes
ESLint couldn't find the plugin 'eslint-plugin-smarthr'.
Plugin not installed or not in node_modules.
fix
Run: npm install --save-dev eslint-plugin-smarthr
Error [ERR_REQUIRE_ESM]: require() of ES Module ... not supported.
Using require() to load the plugin (CommonJS).
fix
Change to import statement in an ES module: import smarthr from 'eslint-plugin-smarthr'
Configuration for rule 'smarthr/a11y-anchor-has-href-attribute' is invalid: unknown rule.
Rule name misspelled or not defined in the plugin version.
fix
Check rule name in the plugin documentation. Example: 'smarthr/a11y-anchor-has-href-attribute' (note hyphenation).
Upgrade
Version history
6.13.0latest on npm
Audit
Dependencies
eslintrequiredpeer dependency; plugin requires ESLint 9 to function
Agent activity
4 hits · last 30 days
node
4
Resources
eslint-plugin-smarthr — npm install eslint-plugin-smarthr · libregistry