ESLint Gitignore Utility

0.1.0 · abandoned · verified Sun Apr 19

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.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to integrate `readGitignoreFiles` into an ESLint CommonJS configuration file to respect `.gitignore` patterns.

const { readGitignoreFiles } = require('eslint-gitignore');

module.exports = {
  root: true,
  env: {
    browser: true,
    es2021: true,
    node: true
  },
  extends: [
    'eslint:recommended',
    'plugin:react/recommended',
    'plugin:@typescript-eslint/recommended'
  ],
  parser: '@typescript-eslint/parser',
  parserOptions: {
    ecmaVersion: 'latest',
    sourceType: 'module'
  },
  plugins: [
    'react',
    '@typescript-eslint'
  ],
  rules: {
    // Example rule
    'no-unused-vars': 'warn'
  },
  // Uses eslint-gitignore to incorporate .gitignore patterns
  ignorePatterns: readGitignoreFiles({ cwd: __dirname })
};

// To run ESLint: npx eslint .

view raw JSON →