Skip to content

Availity/eslint-config-availity

Repository files navigation

eslint-config-availity

Shareable ESLint flat config for Availity projects designed to be used with Prettier and TypeScript

License NPM Link

Installation

Requires Node 22+ and ESLint 9+.

yarn add --dev eslint-config-availity

If you need TypeScript support, also include typescript as a devDependency.

Profiles

This package provides three ESLint flat config profiles, each targeting a different environment:

Base (eslint-config-availity)

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];

Browser (eslint-config-availity/browser)

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];

Workflow (eslint-config-availity/workflow)

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];

Usage

This package exports ESLint flat configs. Create an eslint.config.js in your project root.

Adding project-specific rules

import workflow from 'eslint-config-availity/workflow';

export default [
    ...workflow,
    {
        rules: {
            'no-console': 'warn',
        },
    },
    {
        ignores: ['**/static/*'],
    },
];

Migrating from .eslintrc

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.

Included Configs and Plugins

Configs

Plugins

Prettier

Recommended settings:

{
    "printWidth": 120,
    "singleQuote": true,
    "trailingComma": "es5"
}

Contributing

ƒ

Setup

yarn          # Install dependencies
yarn lint     # Run ESLint
yarn test     # Run tests

Development workflow

  1. Create a branch from master
  2. Make changes to config files (base.js, browser.js, workflow.js)
  3. If adding or modifying a rule, add corresponding test coverage in tests/rules.test.js and the relevant fixture file
  4. Run yarn lint && yarn test to verify
  5. Run yarn eslint-check to ensure no rules conflict with Prettier
  6. Commit using conventional commits (enforced by commitlint)
  7. Push and open a PR

Commit conventions

  • feat: — New rules or features (triggers minor version bump)
  • fix: — Bug fixes (triggers patch version bump)
  • feat!: or BREAKING CHANGE: — Breaking changes like enabling new error-level rules (triggers major version bump)
  • chore: — Dependency updates, CI changes (no version bump)

License

MIT

About

Shareable ESLint config for Availity projects

Topics

Resources

License

Stars

Watchers

Forks

Contributors