{"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,"search_vec":"'14.0.1':19 '16.8':26 '2026':21 '3.4':29 '9':24 'a11y':56 'a11y-delegate-element-has-role-presentation':55 'access':42 'also':71 'april':20 'autofix':73 'best':46,66 'best-practice-for-spread-syntax':65 'break':48 'chang':49 'codebas':40 'companion':82 'config':3,8,33,86 'deleg':57 'design':11 'element':58 'eslint':2,7,23,89 'eslint-config-smarthr':1 'eslint.config.mjs':34 'expand':64 'flat':32 'import':43 'includ':41,52,72 'javascript':88 'latest':16 'migrat':78 'opinion':36 'order':44 'oxlint':80,85 'oxlint-config-smarthr':84 'packag':83 'practic':47,67 'present':61 'project':15 'provid':30 'react':13,25 'remov':53 'requir':22 'role':60 'rule':37,62 'sharabl':6 'smarthr':4,10,39,76,87 'smarthr-ui':75 'spread':69 'stabl':17 'support':79 'syntax':70 'typescript':14,28 'ui':77 'v14':51 'version':18 'via':81","created_at":"2026-04-25T11:18:36.641505+00:00","updated_at":"2026-04-25T11:18:36.641505+00:00","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,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/eslint-config-smarthr","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-17","next_check":"2026-07-24","install_tag":null}}