ESLint flat config helper that automatically applies .gitignore patterns to ESLint's ignore list. Current stable version is 2.3.0, with monthly releases. Key differentiators: supports recursive .gitignore discovery (monorepos), git submodule detection via .gitmodules, strict mode (throws on missing ignore files by default), and the ability to specify custom ignore file paths. Only works with ESLint flat config (ESLint v9+). ESM-only since v2.0.0. Maintained by Anthony Fu.
npm install eslint-config-flat-gitignoreVerified import paths — ran on the pinned version, not inferred.
Shows basic setup: import the default function and call it as the first config item in ESLint flat config array.
Use import instead of require, or upgrade to Node.js with --experimental-require-module (unstable).
Migrate to ESLint v9 flat config. See ESLint migration guide.
Set strict: false if you expect .gitignore to be missing, or ensure the file exists.
Upgrade to v2.3.0 and enable recursive: true for monorepo support.
Pass files: ['.gitignore', '.eslintignore'] if you need both.
Upgrade to v1 or later, update import and usage.
Change eslint.config.js to use import syntax, or rename to .mjs and use import.
Use flat config array: export default [ gitignore(), ... ] instead of extends.
Import default: import gitignore from 'eslint-config-flat-gitignore'
Run npm install eslint-config-flat-gitignore --save-dev and ensure node_modules is accessible.