{"id":14558,"library":"eslint-gitignore","title":"ESLint Gitignore Utility","description":"eslint-gitignore is a utility package designed to integrate patterns from `.gitignore` files directly into an ESLint configuration's `ignorePatterns` array. It was last published six years ago, with its sole version being `0.1.0`. The package appears to be abandoned, with no further updates or maintenance since its initial release. While it served a specific purpose at the time of its creation by programmatically parsing gitignore files, modern ESLint versions, particularly with the introduction of flat configurations, now offer native capabilities to achieve this through the `@eslint/compat` package's `includeIgnoreFile` utility. Therefore, its key differentiator has been superseded by core ESLint functionality, making it largely obsolete for new projects and potentially problematic for existing ones due to lack of maintenance.","status":"abandoned","version":"0.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/mysticatea/eslint-gitignore","tags":["javascript","eslint","gitignore"],"install":[{"cmd":"npm install eslint-gitignore","lang":"bash","label":"npm"},{"cmd":"yarn add eslint-gitignore","lang":"bash","label":"yarn"},{"cmd":"pnpm add eslint-gitignore","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency, required for ESLint configuration integration.","package":"eslint","optional":false}],"imports":[{"note":"This package is CommonJS-only, last published over 6 years ago. ESM imports are not supported.","wrong":"import { readGitignoreFiles } from 'eslint-gitignore'","symbol":"readGitignoreFiles","correct":"const { readGitignoreFiles } = require('eslint-gitignore')"},{"note":"The primary use case is within an `.eslintrc.js` file to populate the `ignorePatterns` array.","symbol":"ESLint Config Usage","correct":"module.exports = { ignorePatterns: readGitignoreFiles({ cwd: __dirname }) }"}],"quickstart":{"code":"const { readGitignoreFiles } = require('eslint-gitignore');\n\nmodule.exports = {\n  root: true,\n  env: {\n    browser: true,\n    es2021: true,\n    node: true\n  },\n  extends: [\n    'eslint:recommended',\n    'plugin:react/recommended',\n    'plugin:@typescript-eslint/recommended'\n  ],\n  parser: '@typescript-eslint/parser',\n  parserOptions: {\n    ecmaVersion: 'latest',\n    sourceType: 'module'\n  },\n  plugins: [\n    'react',\n    '@typescript-eslint'\n  ],\n  rules: {\n    // Example rule\n    'no-unused-vars': 'warn'\n  },\n  // Uses eslint-gitignore to incorporate .gitignore patterns\n  ignorePatterns: readGitignoreFiles({ cwd: __dirname })\n};\n\n// To run ESLint: npx eslint .","lang":"javascript","description":"Demonstrates how to integrate `readGitignoreFiles` into an ESLint CommonJS configuration file to respect `.gitignore` patterns."},"warnings":[{"fix":"Consider migrating to native ESLint features. For ESLint's flat config, use `@eslint/compat`'s `includeIgnoreFile` utility. For older `.eslintrc.*` configurations, manually maintain `.eslintignore` or the `ignorePatterns` array.","message":"This package is effectively abandoned, with no updates or maintenance for over 6 years. It is highly unlikely to be compatible with modern ESLint versions (e.g., v8, v9 with flat config) or newer Node.js runtimes without potential issues.","severity":"breaking","affected_versions":"All versions (0.1.0)"},{"fix":"For new projects or when upgrading ESLint, prefer using `includeIgnoreFile` from `@eslint/compat` if using flat config, or manually manage ignore patterns if on legacy configs. For example:\n```javascript\n// eslint.config.js (Flat Config)\nimport { defineConfig } from 'eslint/config';\nimport { includeIgnoreFile } from '@eslint/compat';\nimport { fileURLToPath } from 'node:url';\n\nconst gitignorePath = fileURLToPath(new URL('.gitignore', import.meta.url));\n\nexport default defineConfig([\n  includeIgnoreFile(gitignorePath),\n  // ... other configs\n]);\n```","message":"The functionality provided by `eslint-gitignore` is now natively supported and recommended directly within ESLint (especially with flat configurations using `@eslint/compat`). Relying on this abandoned package introduces unnecessary technical debt and potential compatibility problems.","severity":"gotcha","affected_versions":"All versions (0.1.0)"}],"env_vars":null,"last_verified":"2026-04-19T00:00:00.000Z","next_check":"2026-07-18T00:00:00.000Z","problems":[{"fix":"This package is CommonJS-only. Ensure you are using `const { readGitignoreFiles } = require('eslint-gitignore')` in a CJS environment.","cause":"Attempting to use `import { readGitignoreFiles } from 'eslint-gitignore'` in a modern ESM project, or incorrect `require` syntax.","error":"TypeError: readGitignoreFiles is not a function"},{"fix":"Verify that `cwd: __dirname` (or the correct path to your project root) is passed to `readGitignoreFiles`. Also, check for conflicting ignore patterns defined elsewhere in your `.eslintrc.js` or `.eslintignore` files.","cause":"Incorrect `options.cwd` parameter passed to `readGitignoreFiles` or conflicts with other `ignorePatterns` in the ESLint configuration.","error":"ESLint ignores files that are not in .gitignore or lints files that should be ignored."}],"ecosystem":"npm"}