Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

eslint-gitignore

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-gitignore

A utility for ESLint respecting `.gitignore` files.

  • 0.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

eslint-gitignore

npm version Downloads/month Build Status codecov Dependency Status

A utility for ESLint respecting .gitignore files.

💿 Installation

Use npm or a compatible tool.

$ npm install -D eslint eslint-gitignore

📖 Usage

Use it in your .eslintrc.js file. For example:

const { readGitignoreFiles } = require("eslint-gitignore")

module.exports = {
  // Your config.

  ignorePatterns: readGitignoreFiles({ cwd: __dirname })
};

Then run ESLint!

readGitignoreFiles(options)

It finds .gitignore files, reads the found files, then converts the patterns in the found files to be able to use as ignorePatterns of ESLint config.

If you use eslint --debug CLI option, this function prints debug information.

Arguments
  • options.cwd (string) ... Specify the current working directory. Default is process.cwd(). This should be the directory where your .eslintrc.js file exists.
  • options.patterns (string[]) ... Specify glob patterns to find .gitignore files. Default is ["**/.gitignore", "!**/node_modules/**"]. Please be careful to ignore unrelated directories.
Return Value
  • (string[]) ... The ignorePatterns value.

📰 Changelog

See GitHub Releases.

❤️ Contributing

Welcome contributing!

Please use GitHub's Issues/PRs.

Development Tools

  • npm test ... Run tests. It generates code coverage into coverage directory.
  • npm run watch ... Run tests when files are edited.
  • npm version <patch|minor|major> ... Bump a new version.

Keywords

FAQs

Package last updated on 11 Jun 2020

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc