npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

eslint-config-amex

v17.1.3

Published

American Express' ESLint config

Readme

npm Health Check

ESLint configurations used at American Express.

👩‍💻 Hiring 👨‍💻

Want to get paid for your contributions to eslint-config-amex?

Send your resume to [email protected]

📖 Table of Contents

🤹‍ Usage

This config is compatible with ESLint >= 9.

Installation

npm install --save-dev eslint@^9.0.0 @eslint/compat@^2.0.0 eslint-config-amex

If using Jest for unit tests and browser tests

npm install --save-dev typescript eslint-plugin-jest@^29.0.0 eslint-plugin-jest-dom@^5.0.0

Configuration

Create a eslint.config.js file (or eslint.config.mjs if your package.json does not have "type": "module"). This Flat Config file is the new configuration format as of eslint@9. See https://eslint.org/docs/v9.x/use/configure/configuration-files for more details.

JavaScript

If working in JavaScript, your eslint.config.js should be:

import { fileURLToPath } from 'node:url';
import { defineConfig } from 'eslint/config';
import { includeIgnoreFile } from '@eslint/compat';
import amexJsConfig from 'eslint-config-amex';
import amexJsTestConfig from 'eslint-config-amex/test-config';
import amexBrowserTestConfig from 'eslint-config-amex/browser-test-config';
import amexIgnorePrettierRulesConfig from 'eslint-config-amex/ignore-prettier-rules-config';

const gitignorePath = fileURLToPath(new URL('.gitignore', import.meta.url));

export default defineConfig([
  includeIgnoreFile(gitignorePath),
  amexJsConfig(),
  amexJsTestConfig(),
  amexBrowserTestConfig(),
  amexIgnorePrettierRulesConfig(), // include if using Prettier in your project
]);

TypeScript

If working in TypeScript, your eslint.config.js should be:

import { fileURLToPath } from 'node:url';
import { defineConfig } from 'eslint/config';
import { includeIgnoreFile } from '@eslint/compat';
import amexTsConfig from 'eslint-config-amex/ts-config';
import amexTsTestConfig from 'eslint-config-amex/ts-test-config';
import amexBrowserTestConfig from 'eslint-config-amex/browser-test-config';
import amexIgnorePrettierRulesConfig from 'eslint-config-amex/ignore-prettier-rules-config';

const gitignorePath = fileURLToPath(new URL('.gitignore', import.meta.url));

export default defineConfig([
  includeIgnoreFile(gitignorePath),
  amexTsConfig(),
  amexTsTestConfig(),
  amexBrowserTestConfig(),
  amexIgnorePrettierRulesConfig(), // include if using Prettier in your project
]);

Overrides

Each of the config functions can be customized by supplying an object with the files, ignores, and rules properties, as defined in the ESLint docs. The files and ignores properties will completely override the default values for those configs, whereas the rules property will be merged with the existing rules for that config. For convenience, JS_FILES and JS_AND_TS_FILES constants are exported from eslint-config-amex/constants.

import amexJsConfig from 'eslint-config-amex';
import amexJsTestConfig from 'eslint-config-amex/test-config';
import { JS_FILES } from 'eslint-config-amex/constants';

export default defineConfig([
  // other configs
  amexJsConfig({
    ignores: [`**/src/ignore-directory/**/${JS_FILES}`],
  })
  amexJsTestConfig({
    files: [`**/custom-test-directory/**/${JS_FILES}`],
    rules: {
      'jest/no-large-snapshots': ['error', { maxSize: 100 }],
    }
  })
]);

For reference, these are the default files for each config.

| Config | Default Files Applied To | | ------------------------------------------------- | ----------------------------------------------------------------------- | | eslint-config-amex | **/*.{js,jsx,mjs,cjs,snap} | | eslint-config-amex/test-config | **/__{tests,mocks}__/**/*.{js,jsx,mjs,cjs,snap} | | eslint-config-amex/ts-config | **/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,snap} | | eslint-config-amex/ts-test-config | **/__{tests,mocks}__/**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,snap} | | eslint-config-amex/browser-test-config | **/__tests__/{browser,a11y}/**/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,snap} | | eslint-config-amex/ignore-prettier-rules-config | **/*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,snap} |

Linting vs Formatting

| | Linting | Formatting | | ---------------- | ------------------------------------------- | ------------------------------- | | Purpose | Used to improve code quality and catch bugs | Used to format and stylize code | | Recommended Tool | ESLint | Prettier |

Previously, formatting was done as part of linting by using eslint-plugin-prettier. However, this is no longer recommended.

If you want formatting in your repo, install Prettier and use the eslint-config-amex/ignore-prettier-rules-config config (see above) in order to disable any ESLint rules which may conflict with Prettier.

🏆 Contributing

We welcome Your interest in the American Express Open Source Community on Github. Any Contributor to any Open Source Project managed by the American Express Open Source Community must accept and sign an Agreement indicating agreement to the terms below. Except for the rights granted in this Agreement to American Express and to recipients of software distributed by American Express, You reserve all right, title, and interest, if any, in and to Your Contributions. Please fill out the Agreement.

Please feel free to open pull requests and see CONTRIBUTING.md to learn how to get started contributing.

🗝️ License

Any contributions made under this project will be governed by the Apache License 2.0.

🗣️ Code of Conduct

This project adheres to the American Express Community Guidelines. By participating, you are expected to honor these guidelines.