unicorn/no-array-push-push - breaks stream.push
See original GitHub issueunicorn/no-array-push-push
combines .push
, but it can’t do this if the .push
is for something that is not an array, like stream
.
Before
const stream = new Readable();
stream.push('attachment content');
stream.push(null); // end of file
After
const stream = new Readable();
stream.push('attachment content', null); // end of file
// ^^^^ null is not a valid encoding
Issue Analytics
- State:
- Created 3 years ago
- Comments:6 (3 by maintainers)
Top Results From Across the Web
eslint-plugin-unicorn/no-array-push-push.md at main - GitHub
Enforce combining multiple Array#push() into one call. This rule is enabled in the ✓ recommended config. This rule is automatically fixable by the ......
Read more >eslint-plugin-unicorn - npm
Name Description ✓ 🔧 💡
consistent‑destructuring Use destructured variables over properties. ✓ 🔧 💡
custom‑error‑definition Enforce correct Error subclassing. 🔧
empty‑brace‑spaces Enforce no spaces between braces....
Read more >eslint-plugin-unicorn/readme.md - UNPKG
54, "unicorn/no-array-for-each": "error",. 55, "unicorn/no-array-method-this-argument": "error",. 56, "unicorn/no-array-push-push": "error",.
Read more >eslint-plugin-unicorn - npm Package Health Analysis - Snyk
Disallow using the this argument in array methods. ✓,,. no-array-push-push, Enforce combining multiple Array#push() into one call.
Read more >Hydraulic Disk brake piston not fully retracting
Use a brake block to push both pistons evenly back into the caliper. Pull the lever with the block in to align. Refit...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
But you have to end the stream with
null
. Alternatively, we could just ignore if the instance is calledstream
.I understand that, my point is doing this is not really very useful,