eslint-config-flat-gitignore
TypeScript icon, indicating that this package has built-in type declarations

0.1.5 • Public • Published

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
})

Sponsors

License

MIT License © 2023-PRESENT Anthony Fu

Package Sidebar

Install

npm i eslint-config-flat-gitignore

Weekly Downloads

99,316

Version

0.1.5

License

MIT

Unpacked Size

11 kB

Total Files

8

Last publish

Collaborators

  • antfu