npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

eslint-formatter-git-log

v0.6.4

Published

ESLint Formatter featuring Git Author, Date, and Hash

Downloads

1,452

Readme

eslint-formatter-git-log

ESLint Formatter featuring Git Author, Date, and Hash

NPM version NPM downloads Build Status Maintainability

Table of Contents

🌩 Installation

npm install --save-dev eslint eslint-formatter-git-log

🕹 Usage

To use the default configuration, set ESLint's --format option to git-log as follows:

eslint --format git-log './src/**/*.js'

👀 Examples

Full Report

By default, a report of every Error or Warning in the Codebase is displayed:

screenshot

Personalised Reports

When an emailRegExp is provided such as /[email protected]/, a report is shown that relates only to changes you yourself have made.

  1. Create a file in your project which follows the structure below.

    const gitLogFormatter = require('eslint-formatter-git-log');
    
    module.exports = gitLogFormatter.withConfig({
      emailRegExp: /[email protected]/,
    });
  2. Set ESLint's --format option to your customised version instead of git-log:

    eslint --format ./path/to/your/custom-formatter.js './src/**/*.js'

screenshot

Contributor Reports

To extend personalised reports to your Team, the Git Committer Email is needed.

gitLogFormatter.getUserEmail()

An optional helper is available at gitLogFormatter.getUserEmail() which reads git config user.email and feeds it through git check-mailmap.

const gitLogFormatter = require('eslint-formatter-git-log');

module.exports = gitLogFormatter.withConfig({
  emailRegExp: new RegExp(gitLogFormatter.getUserEmail()),
});

$GIT_COMMITTER_EMAIL

Alternatively, if your Team each have their $GIT_COMMITTER_EMAIL Environment Variable exported and reachable, then the following is enough.

const gitLogFormatter = require('eslint-formatter-git-log');

module.exports = gitLogFormatter.withConfig({
  emailRegExp: new RegExp(process.env.GIT_COMMITTER_EMAIL),
});

References

⚖️ Configuration

This example lists every available option with its corresponding default value. You don't need to provide a value for every configuration item, just the ones you want to change.

const chalk = require('chalk');
const gitLogFormatter = require('eslint-formatter-git-log');

module.exports = gitLogFormatter.withConfig({
  // If set, only show result when Author Email matches this pattern
  emailRegExp: undefined,
  // Whitespace to insert between items when formatting
  gutter: '  ',
  // Translations for plain text used when formatting
  label: {
    error: 'error',
    warning: 'warning'
  },
  // Increase if you have files with 1000s of lines
  locationColumnWidth: 8,
  // Which methods of https://github.com/chalk/chalk to use when formatting
  style: {
    // eg. "error"
    error: chalk.red,
    // eg. "/Users/guybrush/Dev/grogrates/src/index.js"
    filePath: chalk.underline,
    // eg. "warning"
    warning: chalk.yellow,
    // eg. "161:12"
    location: chalk.dim,
    // eg. "no-process-exit"
    rule: chalk.dim,
    // eg. "bda304e570"
    commit: chalk.magenta,
    // eg. "(1 year, 2 months ago)"
    date: chalk.greenBright,
    // eg. "<[email protected]>"
    email: chalk.blueBright,
  },
});

🙋🏽‍♂️ Getting Help

Get help with issues by creating a Bug Report or discuss ideas by opening a Feature Request.

👀 Other Projects

If you find my Open Source projects useful, please share them ❤️

🤓 Author

I'm Jamie Mason from Leeds in England, I began Web Design and Development in 1999 and have been Contracting and offering Consultancy as Fold Left Ltd since 2012. Who I've worked with includes Sky Sports, Sky Bet, Sky Poker, The Premier League, William Hill, Shell, Betfair, and Football Clubs including Leeds United, Spurs, West Ham, Arsenal, and more.

Follow JamieMason on GitHub      Follow fold_left on Twitter