eslint-formatter-simple

A simple ESLint formatter. Formats ESLint results in a simple, human-readable manner.

Downloads in past

Stats

StarsIssuesVersionUpdatedCreatedSize
eslint-formatter-simple
020.0.13a year ago5 years agoMinified + gzip package size for eslint-formatter-simple in KB

Readme

eslint-formatter-simple
Table of Contents

Overview

A simple ESLint formatter. Formats ESLint results in a simple, human-readable manner.
  • Default ESLint output:


  • eslint-formatter-simple output:


  • eslint-formatter-simple output (no verbose via environment variable: ESLINT_CFS_VERBOSE=false):


Features

  • Warnings always listed before errors.
  • Warnings grouped with other warnings. Errors with errors.
  • Fixable issues and files containing fixable issues are highlighted green.
  • Prints a final output tree showing files with issues.
- Disable with environment variable ESLINT_CFS_VERBOSE=false.

Install

# npm
npm install eslint-formatter-simple --save-dev

# yarn
yarn add eslint-formatter-simple --dev

How To Use

Via CLI:
$ eslint --format="simple" file.js

# Disable verbose output:
$ ESLINT_CFS_VERBOSE=false eslint --format="simple" file.js

With webpack via eslint-loader:
module.exports = {
  entry: "...",
  module: {
    rules: [
      {
        test: /\.js$/,
        use: [
          {
            loader: "eslint-loader",
            exclude: /node_modules/,
            options: {
              formatter: require("eslint-formatter-simple")
            }
          }
        ]
      }
    ]
  }
};

Getting Exit Error

If getting an error like the following when running as a npm/yarn script:
error Command failed with exit code 1.

Check the following eslint issue here. The solution is to add the following to the end of the script.
{
  scripts: {
    lint: "eslint ...; exit 0"
  }
}

Miscellaneous

  • Made using Node.js v8.14.0 on a Linux machine running Ubuntu 16.04.5 LTS.

Contributing

Contributions are welcome! Found a bug, feel like documentation is lacking/confusing and needs an update, have performance/feature suggestions or simply found a typo? Let me know! :)
See how to contribute here.

License

This project uses the MIT License.