Launch Week Day 1: Socket for Jira Is Now Available.Learn More
Socket
Book a DemoSign in
Socket

eslint-config-flat-gitignore

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-flat-gitignore

.gitignore support for ESLint Flat Config

latest
Source
npmnpm
Version
2.3.0
Version published
Weekly downloads
1M
0.05%
Maintainers
1
Weekly downloads
 
Created
Source

eslint-config-flat-gitignore

npm version npm downloads bundle JSDocs License

.gitignore support for ESLint Flat Config.

Usage

npm i -D eslint-config-flat-gitignore
// eslint.config.js
import gitignore from 'eslint-config-flat-gitignore'

export default [
  // recommended putting it at the first
  gitignore(),
  // your other configs here
]

By default it will only looks for .gitignore but NOT .eslintignore, as we would recommended move away from .eslintignore to declare directly in eslint.config.js for single source of truth. If you still want it, you can pass the files option to specify the files to look for.

gitignore({
  files: [
    '.gitignore',
    '.eslintignore',
  ]
})

By default, this plugin throws if any of the ignore files are missing. This can be disabled by passing setting the strict option to false.

gitignore({
  files: [
    '.gitignore',
    '.eslintignore',
  ],
  strict: false,
})

By default, this plugin will try to look up the directory tree and match the first .gitignore file. You can disable this by setting the root option to true, or specify the files option to a specific path.

gitignore({
  root: true
})

If you want to include recursive .gitignore files (for example in monorepos), enable the recursive option.

gitignore({
  recursive: true,
})

If you want recursive discovery but need to skip specific directory names, pass an object to recursive with skipDirs.

gitignore({
  recursive: {
    // Skip any directory with this name at any depth
    skipDirs: ['dist', 'coverage'],
  },
})

skipDirs matches directory names (not paths) and applies in addition to the built-in skipped directories: .git and node_modules.

This plugin will also automatically detect git submodule file .gitmodules and ignore all files under the submodule dirs. If you want to disable or customize this behavior, you can pass the filesGitModules option.

gitignore({
  filesGitModules: [], // disable
  filesGitModules: ['path/to/.gitmodules'], // customize
})

Sponsors

Sponsors

License

MIT License © 2023-PRESENT Anthony Fu

Keywords

eslint-config

FAQs

Package last updated on 24 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts