Comments (10)
No need, I found one: prettier/prettier#770
from prettier-vscode.
There is currently no option to disable it for some file pattern.
The extension does not run on JSON language, it runs on javascript and javascriptreact as specified here
Prettier throws an error on JSON object files and thus, the extension shouldn't do anything (a log in the developer tool)
Is this issue about JSON betting prettified or about a feature request?
from prettier-vscode.
It performs on JSON and sometimes on certain JS files, by removing empty lines breaks, which is super annoying :(
from prettier-vscode.
Do you have any other formatter installed (extension)? prettier does not remove single line breaks like on your JS file.
For the JSON file, removing lines is the behavior of vscode's embed formatter.
from prettier-vscode.
I don't think. editor.formatOnSave
is set to true
, and when prettier-vscode is disabled, it doesn't do that. Very strange.
from prettier-vscode.
About which file type are you speaking? Both?
Just to be sure about your JSON file. If you set "json.format.enable": false,
in your settings, does it still happen ? This is the embed json formatter.
Can you try [email protected] with the command line on your JS file?
Can you also test with all extensions disabled but prettier ?
I'm unable to reproduce your problem with the JS file. With the JSON file I think this is the embed formatter.
from prettier-vscode.
"json.format.enable": false
does the trick for the JSON files 👍
I disable every extensions except this one, and still encounter the problem. But it doesn't appear when I use the babylon parser (only appear with the flow parser)
I'll just use the babylon parser for now. Thanks for your precious help! :)
from prettier-vscode.
Still seems there is an issue tho. I cannot reproduce this issue with the flow parser and a minimal code. Is it possible for you to provide a minimal code which produce this error and your settings for prettier.
Note: I also tried with CRLF
from prettier-vscode.
I isolate the bug. Here is the minimal setup to reproduce it:
// @flow
import React, { Component } from 'react';
import { connect } from 'react-redux';
class MyClass extends Component {
render() {
return <span>8€</span>;
}
}
const mapStateToProps = (state, ownProps) => ({
navigation: ownProps.navigation,
});
const mapDispatchToProps = (dispatch, ownProps) => ({});
export default connect(mapStateToProps)(MyClass);
It doesn't happen if I remove the €
character, and seems not related to this plugin (does the same using prettier directly). I should create an issue on the prettier repo.
from prettier-vscode.
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.
from prettier-vscode.
Related Issues (20)
- nested prettier.config not taken into account HOT 2
- Text auto works
- ignorePath only accepts a string not an array
- CSS (aspect-ratio)
- prettier在vue项目中格式化的bug
- Inconsistent doctype case formatting HOT 2
- Editor scrolls to bottom when format large file using prettier HOT 2
- Extension only looks for .gitignore or .prettierignore when using Prettier v3, does not allow both HOT 1
- Use LanguageStatusItem API for the status bar item HOT 1
- prettier bug in Vue
- Prettier extension deletes line of code after pasting
- icons
- smdmsmrab.com.pk
- Prettier doesn't appear in the list of formatters HOT 5
- Installed Prettier extension does not format and gives following error: Cannot find module 'prettier' HOT 1
- `prettier-vscode` doesn't respond to changes in `prettier.config.mjs` until the workspace reloads HOT 4
- Cannot use any prettier plugins with `yarn 4 + PnP`
- Do not put css comments on new line HOT 1
- I have done all kinds of things but my prettier does not format on save. HOT 1
- I need to completely uninstall prettier an reinstall it. 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-vscode.