eslint-config-expensify

raw JSON →
2.0.110 verified Sat Apr 25 auth: no javascript

Expensify’s sharable ESLint configuration, based on Airbnb’s style guide, with React and JSX a11y support. Current stable version is 2.0.110. Released automatically via GitHub Actions on merge. Provides two configs: default (full) and legacy. Requires eslint, eslint-plugin-import, eslint-plugin-react, and eslint-plugin-jsx-a11y as peer dependencies. Automatically versioned and published via CI.

error Error: Cannot find module 'eslint-plugin-import'
cause Missing peer dependency.
fix
npm install --save-dev eslint-plugin-import
error Error: Cannot find module 'eslint-config-expensify'
cause Package not installed or not in node_modules.
fix
npm install eslint-config-expensify --save-dev
error Configuration for rule 'react/jsx-filename-extension' is invalid
cause Using incorrect rule config shape.
fix
Ensure the rule is an array with severity and options, e.g., [1, { extensions: ['.jsx'] }].
breaking v2+ dropped support for Node <16 and ESLint <8. If you are on an older version, extend must be updated or you will see parser/plugin errors.
fix Upgrade Node to >=16 and ESLint to >=8, or stay on v1.x.
deprecated The legacy config (eslint-config-expensify/legacy) is deprecated and will be removed in a future major version.
fix Migrate to the default config and remove legacy references.
gotcha Missing peer dependencies: eslint-plugin-import, eslint-plugin-react, eslint-plugin-jsx-a11y must be installed or ESLint will error.
fix Run 'npm install --save-dev eslint-plugin-import eslint-plugin-react eslint-plugin-jsx-a11y'.
gotcha Automatic version bump on merge: do not manually bump version in package.json; CI handles it. Conflicts may arise if you do.
fix Let CI bump version; only change rules in your PR.
npm install eslint-config-expensify
yarn add eslint-config-expensify
pnpm add eslint-config-expensify

Shows how to set up an .eslintrc.js file using the Expensify config with a custom rule override.

// .eslintrc.js
module.exports = {
  extends: ['expensify'],
  rules: {
    'react/jsx-filename-extension': [1, { extensions: ['.jsx'] }],
  },
};