Shareable ESLint flat config for Availity projects designed to be used with Prettier and TypeScript
Requires Node 22+ and ESLint 9+.
yarn add --dev eslint-config-availityIf you need TypeScript support, also include
typescriptas adevDependency.
This package provides three ESLint flat config profiles, each targeting a different environment:
For Node.js and CLI projects. Includes airbnb-base, Prettier compatibility, and plugins for promises, Jest/Vitest (auto-detected), and unicorn. Uses ESM (sourceType: 'module') with ecmaVersion: 'latest'. If typescript is installed, TypeScript recommended rules are automatically applied to .ts/.tsx files. Enforces explicit file extensions in imports (required for Node ESM).
import base from 'eslint-config-availity';
export default [...base];For React + TypeScript browser applications. Extends the full Airbnb config (including React and JSX a11y rules), adds react-hooks, and uses the TypeScript parser. Includes all shared rules from the base profile without duplicating airbnb-base. TypeScript recommended rules are applied to .ts/.tsx files, react/prop-types is disabled for .tsx files, and unicorn/prefer-module is enforced. Import extensions are set to 'never' (bundlers handle resolution).
import browser from 'eslint-config-availity/browser';
export default [...browser];For projects scaffolded with @availity/workflow. Extends the browser profile and adds workflow-specific configuration: the @/ root-import resolver (mapped to project/app) and webpack DefinePlugin globals (__DEV__, __TEST__, __PROD__, __STAGING__).
import workflow from 'eslint-config-availity/workflow';
export default [...workflow];This package exports ESLint flat configs. Create an eslint.config.js in your project root.
import workflow from 'eslint-config-availity/workflow';
export default [
...workflow,
{
rules: {
'no-console': 'warn',
},
},
{
ignores: ['**/static/*'],
},
];If upgrading from a previous version, see the @availity/workflow upgrade guide. The @availity/workflow-upgrade tool automates the migration from .eslintrc to eslint.config.js.
- eslint-plugin-import
- eslint-plugin-jest (auto-detected)
- eslint-plugin-jsx-a11y
- eslint-plugin-promise
- eslint-plugin-react
- eslint-plugin-react-hooks
- eslint-plugin-unicorn
- @vitest/eslint-plugin (auto-detected)
- typescript-eslint (v8)
Recommended settings:
{
"printWidth": 120,
"singleQuote": true,
"trailingComma": "es5"
}ƒ
yarn # Install dependencies
yarn lint # Run ESLint
yarn test # Run tests- Create a branch from
master - Make changes to config files (
base.js,browser.js,workflow.js) - If adding or modifying a rule, add corresponding test coverage in
tests/rules.test.jsand the relevant fixture file - Run
yarn lint && yarn testto verify - Run
yarn eslint-checkto ensure no rules conflict with Prettier - Commit using conventional commits (enforced by commitlint)
- Push and open a PR
feat:— New rules or features (triggers minor version bump)fix:— Bug fixes (triggers patch version bump)feat!:orBREAKING CHANGE:— Breaking changes like enabling new error-level rules (triggers major version bump)chore:— Dependency updates, CI changes (no version bump)