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)
- feat: add support for @let syntax in Angular HOT 2
- Issue formating large HTML file HOT 2
- [Vue] Incorrect syntax error for tag-like string in template literals
- Not formatting any xml files if file extension is not explicitly defined HOT 4
- Cannot find package 'prettier-plugin-svelte again HOT 2
- Ugly output in logical expression with long membe rexpression and object literal
- `--experimental-ternaries` along with `--no-semi` produces incorrect code
- Release 3.3 HOT 1
- Incorrect line breaks in object destructuring expressions when exceeding line width
- Ignore global gitignore or global prettierignore
- Add support for "with" keyword in import attributes HOT 1
- let multi variable declarators one line HOT 1
- Unexpected line break in `assert { type: "json" }`
- Some empty lines is being removed in markdown YAML frontmatter HOT 3
- Bug, prettier messed up my js file HOT 2
- resolveConfigFile bug? HOT 2
- 3.3.0 regression - link definitions / references in markdown cause incorrect wrapping with prose-wrap always
- How to remove the automatic add {" "} ? HOT 3
- handlebars attrbutes changed: {{@x.y.z}} becomes {{@x}} HOT 4
- Cannot read properties of undefined (reading 'unit') 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 prettier.