Comments (6)
Should jscodefmt sort JSX props? I heard refmt does something like that. I haven't tried it yet.
Rewrite expression using ternary operator
Those are not safe operations to do in JavaScript. They may change the actual output of a program. So it's probably better to have a lint rule do them.
from prettier.
Good points, a few of them are already fixed on master from other comments, and the rest get into some difficult heuristics but it's worth seeing what we can do. I spent some time on JSX but there's definitely more things we could do.
I need to reduce the amount of time I'm working on this soon. I will slowly tweak things over time but it'd be great if those who proposed changes could actually open PRs. I will write more docs soon about how the printer works to aid this.
from prettier.
@vjeux Makes sense.
from prettier.
Probably a space before ( for anonymous generator functions
I don't think I want to do this. For consistency we'd have to put a space with anon functions too (function (
) which starts to get annoying. I don't think function*() { ... }
looks bad and is consistent. This is one of those things where once you see if a few times you'll think it looks fine.
from prettier.
For the ...(foo && bar || meep)
case, at least insert parens: ...((foo && bar) || meep)
. Operator precedence is sometimes surprising.
from prettier.
I am closing this to reduce noise since people have filed individual issues for most of the issues listed here.
from prettier.
Related Issues (20)
- Ugly logical expression break in Vue `v-if`
- [bug] [yaml] list indent fix can result in invalid yaml or change the meaning of existing yaml
- HTML 'strict' whitespace sometimes injecting a '>'
- Bug with type assertion around yield expression
- Prettier breaks Markdown alert syntax
- Prettier changes meaning of HTML+JS code when using tags that look like self-closing HOT 3
- Comment in last line of YAML files gets leading newline trimmed HOT 1
- Typescript: Prettier incorrectly breaks up constructor properties from modifiers when there is a decorator and comment before it HOT 1
- [Documentation] Pre-Commit Hook Usage case caveat
- Still the error "Error: Comment "Hello" was not printed. Please report this error!" even though I have added a comment in the Doc. HOT 1
- [JavaScript] Comments between ternary operator formatting result is ugly HOT 2
- Prettier wrong formatting of Angular flow HOT 3
- Markdown undesirable formatting behaviour when new text added to paragraph HOT 1
- Error when file names HOT 4
- Can we have a CLI flag that allows ignoring .gitignore and/or .prettierignore please? HOT 2
- Unstable block comment for implemented interfaces (TypeScript) (moved and non-idempotent)
- Markdown lists with extra indent lead to unstable formatting behavior
- [SCSS] Put unary boolean operator in front of expression when wrapping HOT 3
- Incorrect JavaScript configuration caching behavior
- Omitting a key does not does not work on the Config type
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 prettier.