JSPM

coffeelint-prefer-fewer-parens

0.1.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 11
  • Score
    100M100P100Q47606F
  • License MIT

Detects situations where you *could have* avoided using parens

Package Exports

  • coffeelint-prefer-fewer-parens

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (coffeelint-prefer-fewer-parens) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

coffeelint-prefer-fewer-parens

Detects situations where you could have avoided using parens

Overview

This project defines a CoffeeLint rule named prefer_fewer_parens.

This rule detects situations where you could have used implicit parens.

CoffeeLint has a rule named no_implicit_parens. This is "sort of" the opposite of that.

Before

runLater(->
  anotherFn(1, 2)
  gulp.fn(someArg)
      .pipe(anotherArg)
      .pipe(lastArg)

)
alert(1)
alert(1, 2)

After

runLater ->
  anotherFn 1, 2
  gulp.fn(someArg)
      .pipe(anotherArg)
      .pipe lastArg

alert 1
alert 1, 2

See the specs for additional examples.

Installation

  1. Setup CoffeeLint in your project and verify that it works
  2. Add this module as a devDependency: npm install -D coffeelint-prefer-fewer-parens
  3. Update your coffeelint.json configuration file as described below.

Configuration

Add the following snippet to your coffeelint.json config:

{
  "prefer_fewer_parens": {
    "module": "coffeelint-prefer-fewer-parens",
    "level": "warn"
  }
}