ESLint Configuration
@availity/workflow projects use eslint-config-availity with ESLint's flat config format.
Setup
Install the config and its required peer dependencies:
yarn add eslint eslint-config-availity --dev
Create eslint.config.js at your project root:
import workflow from 'eslint-config-availity/workflow';
export default [
...workflow,
{
ignores: ['**/coverage/', '**/build/', '**/dist/'],
},
];
The workflow profile is the recommended choice for @availity/workflow and @availity/workflow-vite projects. It includes Vitest rules automatically.
With TypeScript
If your project uses TypeScript, add the import resolver:
import workflow from 'eslint-config-availity/workflow';
export default [
...workflow,
{
settings: {
'import/resolver': {
typescript: {},
},
},
},
{
ignores: ['**/coverage/', '**/build/', '**/dist/'],
},
];
Test runner rules
The workflow profile bundles Vitest rules automatically. If you are using the browser profile instead, opt in explicitly:
Vitest
yarn add @vitest/eslint-plugin --dev
import browser from 'eslint-config-availity/browser';
import { withVitest } from 'eslint-config-availity';
export default [...browser, ...withVitest];
Jest
yarn add eslint-plugin-jest --dev
import browser from 'eslint-config-availity/browser';
import { withJest } from 'eslint-config-availity';
export default [...browser, ...withJest];
Running
av lint
Or directly:
npx eslint .
Migrating from .eslintrc
If you're upgrading from an older project using .eslintrc.yml or .eslintrc.json:
- Delete the old config file (
.eslintrc.yml,.eslintrc.json, or.eslintrc.js) - Install
eslintas a devDependency if not already present:yarn add eslint --dev - Create
eslint.config.jsas shown above - Remove any individual ESLint plugins from
devDependencies— they're bundled ineslint-config-availity:eslint-plugin-importeslint-plugin-jsx-a11yeslint-plugin-react@typescript-eslint/eslint-plugin@typescript-eslint/parser
The @availity/workflow-upgrade tool can automate this migration:
npx @availity/workflow-upgrade