Registry / testing / eslint-config-smarthr

eslint-config-smarthr

JSON →
library14.0.1jsnpmunverified

A sharable ESLint config for SmartHR, designed for React + TypeScript projects. Latest stable version: 14.0.1 (April 2026). Requires ESLint 9+, React 16.8+, and TypeScript 3.4+. Provides a flat config (eslint.config.mjs) with opinionated rules for SmartHR codebase, including accessibility, import ordering, and best practices. Breaking changes in v14 include removal of a11y-delegate-element-has-role-presentation rule and expanded best-practice-for-spread-syntax. Also includes autofixers for smarthr-ui migrations. Supports oxlint via companion package oxlint-config-smarthr.

npm install eslint-config-smarthr
INSTALL
IMPORT
SIG · ESLINT-CONFIG-SMAR
E
eslint-config-smarthr
testingjavascriptv14.0.1
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.

default (config array)
import smarthr from 'eslint-config-smarthr'
const smarthr = require('eslint-config-smarthr')
Package exports an array of config objects for ESLint flat config (eslint.config.*). CommonJS require will fail as it uses ESM exports.
smarthr
import smarthr from 'eslint-config-smarthr'; export default [...smarthr, { /* overrides */ }]
export default { extends: ['smarthr'] }
Flat config does not use 'extends' property. You must spread the imported array. This changed from older eslint-config versions (v13 and below used .eslintrc format).
typescript-eslint
import tseslint from 'typescript-eslint'; export default tseslint.config(...smarthr, ...)
import { config } from 'typescript-eslint'
If combining with typescript-eslint v8+, use tseslint.config() helper, not direct spread. Package re-exports some TS rules but doesn't depend on typescript-eslint.

Shows how to install and configure eslint-config-smarthr in a flat config file with a project-specific override.

// eslint.config.mjs import smarthr from 'eslint-config-smarthr'; export default [ ...smarthr, { files: ['src/**/*.{ts,tsx}'], rules: { 'smarthr/a11y-heading-in-sectioning-content': 'warn', }, }, ]; // Then run: pnpm eslint . --ext .ts,.tsx
Debug
Known issues
breakingv14.0.0 removed a11y-delegate-element-has-role-presentation rule and added best-practice-for-interactive-element
fix
Remove references to the removed rule from your config. If you relied on it, apply the equivalent accessibility logic manually.
affects: >=14.0.0
breakingv14.0.0 changed best-practice-for-spread-syntax to check spread syntax inside objects and added autofix
fix
Review and update code that uses spread syntax inside objects; autofixer may change behavior.
affects: >=14.0.0
breakingv13 to v14 migration requires switching from .eslintrc to flat config (eslint.config.mjs)
fix
Replace extends array with import smarthr from 'eslint-config-smarthr' and spread the array.
affects: >=14.0.0
gotchaPackage uses ESM exports only; CommonJS require will throw 'ERR_REQUIRE_ESM'
fix
Use import syntax or enable ESM in your project (e.g., type: 'module' in package.json).
affects: >=14.0.0
deprecatedoxlint-config-smarthr is a separate package for oxlint; do not use eslint-config-smarthr with oxlint
fix
For oxlint projects, install and use oxlint-config-smarthr instead.
affects: >=0.0.0
Errors
Common errors & fixes
Error [ERR_REQUIRE_ESM]: require() of ES Module /node_modules/eslint-config-smarthr/index.js from /project/eslint.config.js not supported. Instead change the require of /node_modules/eslint-config-smarthr/index.js to a dynamic import() which is available in all CommonJS modules.
Using CommonJS require() for an ESM-only package.
fix
Use import smarthr from 'eslint-config-smarthr' and rename file to .mjs or set type: module.
Configuration for rule 'smarthr/a11y-delegate-element-has-role-presentation' is invalid. Definition for rule 'smarthr/a11y-delegate-element-has-role-presentation' was not found.
Rule removed in v14.0.0.
fix
Remove any references to the rule from your eslint config.
ESLint couldn't find the config "smarthr" after the flat config upgrade.
Using extends: ['smarthr'] in .eslintrc format after migrating to flat config.
fix
Switch to flat config: import smarthr from 'eslint-config-smarthr' and spread.
Upgrade
Version history
14.0.1latest on npm
Audit
Dependencies
eslintrequiredRequired as peer dependency to provide linting functionality
reactrequiredRequired as peer dependency because rules target React code
typescriptrequiredRequired as peer dependency for TypeScript linting rules
Agent activity
5 hits · last 30 days
node
4
Resources
eslint-config-smarthr — npm install eslint-config-smarthr · libregistry