{"id":19591,"library":"eslint-config-smarthr","title":"eslint-config-smarthr","description":"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.","status":"active","version":"14.0.1","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/kufu/tamatebako","tags":["javascript","eslint"],"install":[{"cmd":"npm install eslint-config-smarthr","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-config-smarthr","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-config-smarthr","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Required as peer dependency to provide linting functionality","package":"eslint","optional":false},{"reason":"Required as peer dependency because rules target React code","package":"react","optional":false},{"reason":"Required as peer dependency for TypeScript linting rules","package":"typescript","optional":false}],"imports":[{"note":"Package exports an array of config objects for ESLint flat config (eslint.config.*). CommonJS require will fail as it uses ESM exports.","wrong":"const smarthr = require('eslint-config-smarthr')","symbol":"default (config array)","correct":"import smarthr from 'eslint-config-smarthr'"},{"note":"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).","wrong":"export default { extends: ['smarthr'] }","symbol":"smarthr","correct":"import smarthr from 'eslint-config-smarthr'; export default [...smarthr, { /* overrides */ }]"},{"note":"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.","wrong":"import { config } from 'typescript-eslint'","symbol":"typescript-eslint","correct":"import tseslint from 'typescript-eslint'; export default tseslint.config(...smarthr, ...)"}],"quickstart":{"code":"// eslint.config.mjs\nimport smarthr from 'eslint-config-smarthr';\n\nexport default [\n  ...smarthr,\n  {\n    files: ['src/**/*.{ts,tsx}'],\n    rules: {\n      'smarthr/a11y-heading-in-sectioning-content': 'warn',\n    },\n  },\n];\n\n// Then run: pnpm eslint . --ext .ts,.tsx","lang":"javascript","description":"Shows how to install and configure eslint-config-smarthr in a flat config file with a project-specific override."},"warnings":[{"fix":"Remove references to the removed rule from your config. If you relied on it, apply the equivalent accessibility logic manually.","message":"v14.0.0 removed a11y-delegate-element-has-role-presentation rule and added best-practice-for-interactive-element","severity":"breaking","affected_versions":">=14.0.0"},{"fix":"Review and update code that uses spread syntax inside objects; autofixer may change behavior.","message":"v14.0.0 changed best-practice-for-spread-syntax to check spread syntax inside objects and added autofix","severity":"breaking","affected_versions":">=14.0.0"},{"fix":"Replace extends array with import smarthr from 'eslint-config-smarthr' and spread the array.","message":"v13 to v14 migration requires switching from .eslintrc to flat config (eslint.config.mjs)","severity":"breaking","affected_versions":">=14.0.0"},{"fix":"Use import syntax or enable ESM in your project (e.g., type: 'module' in package.json).","message":"Package uses ESM exports only; CommonJS require will throw 'ERR_REQUIRE_ESM'","severity":"gotcha","affected_versions":">=14.0.0"},{"fix":"For oxlint projects, install and use oxlint-config-smarthr instead.","message":"oxlint-config-smarthr is a separate package for oxlint; do not use eslint-config-smarthr with oxlint","severity":"deprecated","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use import smarthr from 'eslint-config-smarthr' and rename file to .mjs or set type: module.","cause":"Using CommonJS require() for an ESM-only package.","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."},{"fix":"Remove any references to the rule from your eslint config.","cause":"Rule removed in v14.0.0.","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."},{"fix":"Switch to flat config: import smarthr from 'eslint-config-smarthr' and spread.","cause":"Using extends: ['smarthr'] in .eslintrc format after migrating to flat config.","error":"ESLint couldn't find the config \"smarthr\" after the flat config upgrade."}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}