Comments (3)
Another example:
export const errorToIPFSError = (ipfsHash: string) => (error: Error) =>
isFetchTimeoutError(error)
? new IPFSTimeoutError(ipfsHash)
: new IPFSGenericError(ipfsHash, error)
// IS LINTED TO
export const errorToIPFSError = (ipfsHash: string) => (error: Error) =>
isFetchTimeoutError(error) ? new IPFSTimeoutError(ipfsHash) : new IPFSGenericError(ipfsHash, error)
Although the function body did fit in one line in this case, expressions involving ternary operators are more readable when split across lines. Eric seems to share this opinion.
const downloadClaim = (ipfsHash: string) =>
this.ipfs.cat(ipfsHash).rethrow(errorToIPFSError(ipfsHash))
// IS LINTED TO
const downloadClaim = (ipfsHash: string) => this.ipfs.cat(ipfsHash).rethrow(errorToIPFSError(ipfsHash))
Same story here. Though the function declaration and body could fit together in one line, splitting them in two lines makes the code more readable.
I'm becoming more and more convinced prettier greatly degrades the readability of the code.
from tslint-rules.
Didn't we note and agree to pull it?
from tslint-rules.
🎉 This issue has been resolved in version 2.0.0 🎉
The release is available on:
Your semantic-release bot 📦🚀
from tslint-rules.
Related Issues (19)
- Avoid ignoring returned promises HOT 2
- Fix, Semantic Release HOT 1
- Adjust member-ordering HOT 1
- Catch unused interfaces? HOT 2
- Configure semantic release HOT 4
- Disable no-implicit-dependencies HOT 1
- Dependency deprecation warning: travis-deploy-once (npm)
- Add immutable rules back in HOT 1
- Enforce Trailing Commas
- Don't break function call parameters into separate lines when there's only 1 parameter HOT 4
- no-any and no-unsafe-any HOT 3
- Issue with never prefixing interface names HOT 1
- Conflict with rules
- More rules to add HOT 2
- No Empty Return Blocks Rule Blocking Noop Function HOT 5
- Add dependencies label to renovate PRs HOT 1
- grouped-imports
- Action required: Greenkeeper could not be activated 🚨 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tslint-rules.