Comments (5)
@oclyde This is intended behavior. We intentionally don't split if there's only one specifier in the import
from prettier.
https://prettier.io/docs/en/rationale.html#imports
from prettier.
Same issue with export = { name1 }
style syntax.
from prettier.
I've been working on some changes locally which might help fix that. Will send a PR soon.
from prettier.
There's still an issue when one import exceeds the max line length.
As an example...
import { ExtremlyLongComponentNameWithoutSpaces } from 'extremly/long/path/to/component.ts';
...could be handled by...
import {
ExtremlyLongComponentNameWithoutSpaces
} from 'extremly/long/path/to/component.ts';
Not too crucial though, but still it could be solved. Worked around by adding a comment, which is doing the trick and prevents the one-line formatting, if someone runs into the same issue:
import {
ExtremlyLongComponentNameWithoutSpaces
// won't be reset by prettier!
} from 'extremly/long/path/to/component.ts';
from prettier.
Related Issues (20)
- Non-idempotent formatting of Angular templates (new lines being inserted on each run) HOT 1
- yaml with folded multiline string and "--prose-wrap always" improperly wraps (and is not idempotent) HOT 3
- documentation request: yaml and prose-wrap
- Enforce consistent use of file extensions in import statements HOT 1
- Unstable formatting of javascript method chains HOT 1
- Dependencies required by scripts/build/utils.js are not reflected in package.json HOT 1
- Give us the option to only apply a plugin on a file HOT 1
- Prettier breaks vue2 syntax when using filters in template
- [MDX] Does not keep indentation in multiline strings HOT 1
- Issue when running prettier for any APEX class in my project HOT 1
- Range formatting doesn't work
- VSCode prettier extension and the `prettier --write .` giving two different results HOT 2
- In less file, automatically insert space between ) and ` HOT 2
- prettier leaves "prettier-ignore" statements in code HOT 3
- CLI: Exit code is 0 when --check is specified and "no parser could be inferred" (since version 3.1)
- Ignore CDATA in HTML or option to ignore it HOT 3
- Prettier adding trailing comma after implicit returns and after last param in function call in vue 2 projects HOT 2
- Add an option to optinaly disable changes introduced in 2.3.0 HOT 2
- JS multi-line comments are not formatted when there are spaces between lines that are created with `*` HOT 1
- Cannot read properties of undefined (reading 'languages') 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.