eslint-config-smarthr

raw JSON →
14.0.1 verified Sat Apr 25 auth: no javascript

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.

error 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.
cause 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.
error 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.
cause Rule removed in v14.0.0.
fix
Remove any references to the rule from your eslint config.
error ESLint couldn't find the config "smarthr" after the flat config upgrade.
cause Using extends: ['smarthr'] in .eslintrc format after migrating to flat config.
fix
Switch to flat config: import smarthr from 'eslint-config-smarthr' and spread.
breaking v14.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.
breaking v14.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.
breaking v13 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.
gotcha Package 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).
deprecated oxlint-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.
npm install eslint-config-smarthr
yarn add eslint-config-smarthr
pnpm add eslint-config-smarthr

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