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

eslint-config-prettier

Package Overview
Dependencies
Maintainers
1
Versions
72
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-config-prettier - npm Package Compare versions

Comparing version 1.5.0 to 1.6.0

4

CHANGELOG.md

@@ -0,1 +1,5 @@

### Version 1.6.0 (2017-04-05)
- Added: The [curly] rule. Thanks to Martin Rädlinger (@formatlos)!
### Version 1.5.0 (2017-03-04)

@@ -2,0 +6,0 @@

@@ -8,2 +8,3 @@ "use strict";

// script can distinguish them.)
curly: 0,
"max-len": 0,

@@ -10,0 +11,0 @@ "no-confusing-arrow": 0,

14

package.json
{
"name": "eslint-config-prettier",
"version": "1.5.0",
"version": "1.6.0",
"license": "MIT",

@@ -34,11 +34,11 @@ "author": "Simon Lydell",

"devDependencies": {
"ava": "^0.18.2",
"babel-eslint": "^7.1.1",
"ava": "^0.19.0",
"babel-eslint": "^7.2.1",
"dedent": "^0.7.0",
"eslint": "^3.17.0",
"eslint": "^3.19.0",
"eslint-config-google": "^0.7.1",
"eslint-plugin-flowtype": "^2.30.0",
"eslint-plugin-flowtype": "^2.30.4",
"eslint-plugin-prettier": "^2.0.1",
"eslint-plugin-react": "^6.10.0",
"prettier": "^0.21.0",
"eslint-plugin-react": "^6.10.3",
"prettier": "^0.22.0",
"rimraf": "^2.6.1"

@@ -45,0 +45,0 @@ },

@@ -108,2 +108,42 @@ # eslint-config-prettier [![Build Status][travis-badge]][travis]

### [curly]
If a block (for example after `if`, `else`, `for` or `while`) contains only one
statement, JavaScript allows omitting the curly braces around that statement.
This rule enforces if or when those optional curly braces should be omitted.
If you use the `"multi-line"` or `"multi-or-nest"` option, the rule can conflict
with prettier.
For example, the `"multi-line"` option allows this line:
```js
if (cart.items && cart.items[0] && cart.items[0].quantity === 0) updateCart(cart);
```
However, prettier might consider the line too long and turn it into the
following, which the `"multi-line"` option does _not_ allow:
```js
if (cart.items && cart.items[0] && cart.items[0].quantity === 0)
updateCart(cart);
```
[eslint-config-airbnb] config includes `curly` with the `"multi-line"` option
turned on by default. Since that config is very popular, it makes sense for
eslint-config-prettier to turn this rule off.
If you like this rule, it can be used just fine with prettier as long as you
don’t use the `"multi-line"` or `"multi-or-nest"` option.
Example configuration:
```json
{
"rules": {
"curly": ["error", "all"]
}
}
```
### [max-len]

@@ -241,6 +281,6 @@

- ESLint 3.17.0
- prettier 0.21.0
- eslint-plugin-flowtype 2.30.0
- eslint-plugin-react 6.10.0
- ESLint 3.19.0
- prettier 0.22.0
- eslint-plugin-flowtype 2.30.4
- eslint-plugin-react 6.10.3

@@ -308,2 +348,3 @@ Have new rules been added since those versions? Have we missed any rules? Is

[curly]: http://eslint.org/docs/rules/curly
[eslint-config-airbnb]: https://www.npmjs.com/package/eslint-config-airbnb

@@ -310,0 +351,0 @@ [eslint-plugin-flowtype]: https://github.com/gajus/eslint-plugin-flowtype

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