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. TypeScript 5.2+ and 6.0.x are supported.
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 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__). Vitest rules are included automatically since workflow projects use Vitest as their test runner.
import workflow from 'eslint-config-availity/workflow';
export default [...workflow];Test runner rules are opt-in via named exports. Add the appropriate export for your test runner alongside your base config:
import base, { withJest } from 'eslint-config-availity';
export default [...base, ...withJest];Requires jest and eslint-plugin-jest to be installed:
yarn add --dev jest eslint-plugin-jestimport base, { withVitest } from 'eslint-config-availity';
export default [...base, ...withVitest];Requires @vitest/eslint-plugin to be installed:
yarn add --dev @vitest/eslint-pluginimport base, { withNodeTest } from 'eslint-config-availity';
export default [...base, ...withNodeTest];Requires eslint-node-test to be installed as a peer dependency, and ESLint >=10.4:
yarn add --dev eslint-node-test eslint@^10Each runner export can also be imported directly from
eslint-config-availity/test-runnersif you prefer not to import from the main entry.
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 (opt-in via
withJest) - eslint-plugin-jsx-a11y
- eslint-plugin-promise
- eslint-plugin-react
- eslint-plugin-react-hooks
- eslint-plugin-unicorn
- @vitest/eslint-plugin (opt-in via
withVitest) - eslint-node-test (opt-in via
withNodeTest, optional peer dependency) - 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,testRunners.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)
Releases are fully automated via Release Please:
- Commits merged to
masterare analyzed by Release Please, which maintains an open release PR that accumulates changes and updatesCHANGELOG.mdand the version inpackage.json. - When you're ready to release, merge the Release Please PR.
- Merging triggers Release Please to create a GitHub Release and tag automatically.
- The publish workflow runs on the new release: installs dependencies, runs lint and tests, then publishes to npm with provenance via
npm publish --provenance.
No manual npm publish or tagging is needed. Commit message format (conventional commits) directly controls the version bump — this is why commit conventions are enforced.
If the automated release ever fails, the Publish Release (Manual) workflow in GitHub Actions can be triggered manually from the Actions tab as a fallback.