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

eslines

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslines

Utility to process ESLint JSON reports

  • 0.0.8
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

eslines

eslines processes an ESLint JSON report and downgrades errors to warnings, except for those reported in lines modified within the current git branch.

How to use it

Install it:

npm install eslines

Add the default .eslines.json config file in you git repo:

{
	"rulesNotToDowngrade": [],
	"remote": "origin/master",
	"processors": {
		"default": "lines-modified"
	}
}

Run it:

eslint -f json . | eslines

Config file

eslines reads its configuration for a file named .eslines.json placed in the root of your git repository.

eslines has two ways of processing an ESLint report. We call them processors. The processor lines-modified will downgrade ESLint errors to warnings, except for lines modified in the topic branch. The processor parsing-errors takes the ESLint report and outputs a new one containing only Parsing Errors.

Options available through the config file:

  • rulesNotToDowngrade: an array containing valid ESLint rule ids. For any rule declared in this array, the lines-modified processor won't downgrade to warnings reported errors for these rules, no matter whether the line was modified or not.

  • remote: lines modified are determined by diffing this remote git branch against the current branch.

  • processors: through this object, it is possible to tell eslines which one to use by default and which one to use for particular branches. For example:

    "processors": { "default": "lines-modified", "master": "parsing-errors", "my/topic-branch": "parsing-errors" }

With the above configuration, when running on a git branch called master or my/topic-branch, eslines will report only parsing-errors. For any other branch, eslines will use the lines-modified processor.

Runtime options

The eslines Command Line Interface has the following options:

  • --processor or -p: choose an eslines processor at run-time. lines-modified will be used by default.

  • --format or -f: set any of ESLint default formatters as the output for eslines. stylish will be used by default.

  • --diff or -d: let you choose between two diff strategies:

    • index: to diff HEAD against the git index.
    • remote: to diff HEAD against the git remote. This is the default.

Some examples:

  • to get a report with junit format containing only the parsing errors:

    eslint -f json . | eslines -p parsing-errors -f junit

  • to get a report containing errors in lines modified within files at the git index

    eslint -f json . | eslines -d index

FAQs

Package last updated on 10 Sep 2016

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