eslint-plugin-you-dont-need-lodash-underscore
Advanced tools
Comparing version 6.1.0 to 6.2.0
@@ -144,2 +144,17 @@ { | ||
}, | ||
"entries": { | ||
"compatible": true, | ||
"alternative": "Object.entries()", | ||
"ES6": true | ||
}, | ||
"toPairs": { | ||
"compatible": true, | ||
"alternative": "Object.entries()", | ||
"ES6": true | ||
}, | ||
"pairs": { | ||
"compatible": true, | ||
"alternative": "Object.entries()", | ||
"ES6": true | ||
}, | ||
@@ -146,0 +161,0 @@ "toLower": { |
{ | ||
"name": "eslint-plugin-you-dont-need-lodash-underscore", | ||
"version": "6.1.0", | ||
"version": "6.2.0", | ||
"description": "Check methods you can use natively without lodash/underscore", | ||
@@ -5,0 +5,0 @@ "repository": { |
@@ -1,2 +0,2 @@ | ||
## You don't (may not) need Lodash/Underscore [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cht8687/You-Dont-Need-Lodash-Underscore) | ||
# You don't (may not) need Lodash/Underscore [![Gitter](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/cht8687/You-Dont-Need-Lodash-Underscore) | ||
@@ -11,2 +11,3 @@ Lodash and Underscore are great modern JavaScript utility libraries, and they are widely used by Front-end developers. However, when you are targeting modern browsers, you may find out that there are many methods which are already supported natively thanks to ECMAScript5 [ES5] and ECMAScript2015 [ES6]. If you want your project to require fewer dependencies, and you know your target browser clearly, then you may not need Lodash/Underscore. | ||
## Voice of Developers | ||
@@ -124,2 +125,3 @@ | ||
1. [_.values](#_values) | ||
1. [_.toPairs](#_topairs) | ||
@@ -132,2 +134,3 @@ **[String](#string)** | ||
1. [_.trim](#_trim) | ||
1. [_.template](#_template) | ||
@@ -204,3 +207,3 @@ | ||
:-: | :-: | :-: | :-: | :-: | | ||
45.0 | 31.0 ✔ | Not supported | Not supported | 7.1 | | ||
45.0 ✔ | 31.0 ✔ | Not supported | Not supported | 7.1 ✔ | | ||
@@ -239,3 +242,3 @@ **[⬆ back to top](#quick-links)** | ||
:-: | :-: | :-: | :-: | :-: | | ||
45.0 | 25.0 ✔ | Not supported | Not supported | 7.1 | | ||
45.0 ✔ | 25.0 ✔ | Not supported | Not supported | 7.1 ✔ | | ||
@@ -276,3 +279,3 @@ **[⬆ back to top](#quick-links)** | ||
:-: | :-: | :-: | :-: | :-: | | ||
45.0 | 25.0 ✔ | Not supported | Not supported | 7.1 | | ||
45.0 ✔ | 25.0 ✔ | Not supported | Not supported | 7.1 ✔ | | ||
@@ -327,3 +330,3 @@ **[⬆ back to top](#quick-links)** | ||
:-: | :-: | :-: | :-: | :-: | | ||
1.0✔ | 1.0✔ | 5.5✔ | ✔ | ✔ | | ||
1.0 ✔ | 1.0 ✔ | 5.5 ✔ | ✔ | ✔ | | ||
@@ -384,7 +387,6 @@ **[⬆ back to top](#quick-links)** | ||
:-: | :-: | :-: | :-: | :-: | | ||
1.0✔ | 1.0✔ | 5.5✔ | ✔ | ✔ | | ||
1.0 ✔ | 1.0 ✔ | 5.5 ✔ | ✔ | ✔ | | ||
**[⬆ back to top](#quick-links)** | ||
### _.without | ||
@@ -412,3 +414,3 @@ :heavy_exclamation_mark:`Lodash only` | ||
:-: | :-: | :-: | :-: | :-: | | ||
1.0✔ | 1.5✔ | 9✔ | ✔ | ✔ | | ||
1.0 ✔ | 1.5 ✔ | 9 ✔ | ✔ | ✔ | | ||
@@ -540,3 +542,3 @@ **[⬆ back to top](#quick-links)** | ||
:-: | :-: | :-: | :-: | :-: | | ||
47✔ | 43 ✔ | Not supported | 34 | 9 | | ||
47 ✔ | 43 ✔ | Not supported | 34 ✔ | 9 ✔ | | ||
@@ -547,3 +549,3 @@ ### Browser Support for `array.indexOf` | ||
:-: | :-: | :-: | :-: | :-: | | ||
✔ | ✔ | ✔ | ✔| ✔ | | ||
✔ | ✔ | ✔ | ✔ | ✔ | | ||
@@ -628,3 +630,3 @@ **[⬆ back to top](#quick-links)** | ||
:-: | :-: | :-: | :-: | :-: | | ||
✔ | 3.0 ✔ | 9 ✔ | 10.5 | 4.0 | | ||
✔ | 3.0 ✔ | 9 ✔ | 10.5 ✔ | 4.0 ✔ | | ||
@@ -659,3 +661,3 @@ **[⬆ back to top](#quick-links)** | ||
:-: | :-: | :-: | :-: | :-: | | ||
✔ | 3.0 ✔ | 9 ✔ | 10.5 | 4.0 | | ||
✔ | 3.0 ✔ | 9 ✔ | 10.5 ✔ | 4.0 ✔ | | ||
@@ -684,3 +686,3 @@ **[⬆ back to top](#quick-links)** | ||
:-: | :-: | :-: | :-: | :-: | | ||
5✔ | 4.0 ✔ | 9 | 12 | 5 | | ||
5 ✔ | 4.0 ✔ | 9 ✔ | 12 ✔ | 5 ✔ | | ||
@@ -773,6 +775,7 @@ **[⬆ back to top](#quick-links)** | ||
:-: | :-: | :-: | :-: | :-: | | ||
✔ | 3.0 ✔ | 9 ✔ | 10.5 | 4.0 | | ||
✔ | 3.0 ✔ | 9 ✔ | 10.5 ✔ | 4.0 ✔ | | ||
**[⬆ back to top](#quick-links)** | ||
## Function | ||
@@ -848,3 +851,3 @@ | ||
:-: | :-: | :-: | :-: | :-: | | ||
25 | 15 | Not supported | ✔ | 9 | | ||
25 ✔ | 15 ✔ | Not supported | ✔ | 9 ✔ | | ||
@@ -893,3 +896,3 @@ **[⬆ back to top](#quick-links)** | ||
:-: | :-: | :-: | :-: | :-: | | ||
45✔ | 34✔ | No support | 32✔ | 9✔ | | ||
45 ✔ | 34 ✔ | No support | 32 ✔ | 9 ✔ | | ||
@@ -918,3 +921,3 @@ **[⬆ back to top](#quick-links)** | ||
:-: | :-: | :-: | :-: | :-: | | ||
5✔ | 4.0 ✔ | 9 | 12 | 5 | | ||
5 ✔ | 4.0 ✔ | 9 ✔ | 12 ✔ | 5 ✔ | | ||
@@ -925,3 +928,3 @@ **[⬆ back to top](#quick-links)** | ||
Retrieve all the names of the object's own enumerable properties. | ||
Retrieves all the given object's own enumerable property values. | ||
@@ -948,3 +951,28 @@ ```js | ||
### _.toPairs | ||
Retrieves all the given object's own enumerable property `[ key, value ]` pairs. | ||
```js | ||
// Underscore - also called with _.pairs | ||
// Lodash - also called with _.entries | ||
var result = _.toPairs({one: 1, two: 2, three: 3}) | ||
console.log(result) | ||
// output: [["one", 1], ["two": 2], ["three", 3]] | ||
// Native | ||
var result2 = Object.entries({one: 1, two: 2, three: 3}) | ||
console.log(result2) | ||
// output: [["one", 1], ["two": 2], ["three", 3]] | ||
``` | ||
### Browser Support | ||
![Chrome][chrome-image] | ![Firefox][firefox-image] | ![IE][ie-image] | ![Opera][opera-image] | ![Safari][safari-image] | ||
:-: | :-: | :-: | :-: | :-: | | ||
38 ✔ | 28 ✔ | Not supported | 25 ✔ | 7.1 ✔ | | ||
**[⬆ back to top](#quick-links)** | ||
## String | ||
@@ -971,3 +999,3 @@ | ||
:-: | :-: | :-: | :-: | :-: | | ||
41✔ | 24✔ | Not supported | Not supported | 9 | | ||
41 ✔ | 24 ✔ | Not supported | Not supported | 9 ✔ | | ||
@@ -1044,6 +1072,30 @@ **[⬆ back to top](#quick-links)** | ||
:-: | :-: | :-: | :-: | :-: | | ||
5.0✔ | 3.5✔ | 9.0✔ | 10.5✔ | 5.0✔ | | ||
5.0 ✔ | 3.5 ✔ | 9.0 ✔ | 10.5 ✔ | 5.0 ✔ | | ||
**[⬆ back to top](#quick-links)** | ||
### _.template | ||
:heavy_exclamation_mark: *Note this is an alternative implementation. Native template literals not escape html.* | ||
Create a template function. | ||
```js | ||
// Lodash/Underscore | ||
const compiled = _.template('hello <%= user %>!'); | ||
compiled({ 'user': 'fred' }); | ||
// Native | ||
const templateLitreal = (value) => `hello ${value.user}`; | ||
templateLiterlFunction({ 'user': 'fred' }); | ||
``` | ||
### Browser Support | ||
![Chrome][chrome-image] | ![Firefox][firefox-image] | ![IE][ie-image] | ![Opera][opera-image] | ![Safari][safari-image] | ||
:-: | :-: | :-: | :-: | :-: | | ||
41 ✔ | 34 ✔ | Not supported | 28 ✔ | 9 ✔ | | ||
**[⬆ back to top](#quick-links)** | ||
## Reference | ||
@@ -1055,2 +1107,3 @@ | ||
## Inspired by: | ||
@@ -1061,2 +1114,3 @@ | ||
# License | ||
@@ -1066,2 +1120,3 @@ | ||
[chrome-image]: https://raw.github.com/alrra/browser-logos/master/src/chrome/chrome_48x48.png | ||
@@ -1068,0 +1123,0 @@ [firefox-image]: https://raw.github.com/alrra/browser-logos/master/src/firefox/firefox_48x48.png |
@@ -7,3 +7,3 @@ 'use strict'; | ||
assert.equal(Object.keys(allRules).length, 36, 'Don\'t miss a rule 😄'); | ||
assert.equal(Object.keys(allRules).length, 39, 'Don\'t miss a rule 😄'); | ||
@@ -10,0 +10,0 @@ const ruleTester = new RuleTester(); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
41569
287
1102