This issue was track work to ensure vim-prettier plays nicely with prettier 2.x
Will update the description of this issue in the next few days when I get a better idea on the scope
Did some preliminary work on local branch and will add some tasks that need to be done in order to address this issue:
vim-prettier defaults to match prettier 2.x and move existing defaults to classic presetprettier 1.x prettier 2.xclassic preset Not sure if this comment belongs in this issue, so let me know and I'll move it:
I'm seeing a strange issue that trailing commas are being removed in vim-prettier when in use with prettier version 2.0.1. I have no configuration file and all g:prettier lines are removed from my vimrc file.
Executing prettier --write file.js on the command line does the right thing (trailing commas are added).
Hi @mikabytes thanks for adding this info to this issue. I will work on it over the weekend, if you find any other issues please comment in here.
Thanks a lot !
I'm having a similar issue with parens; I think it's because this plugin's defaults no longer line up with prettier's.
Maybe it's possible to only pass the cli arguments when those options are defined?
Thanks for your work on this @mitermayer !
That's awesome @mitermayer
Yes, can confirm that the parens issue. Just noticed that one myself.
Using prettier 2, causes the plugin to fail with 'failed to parse buffer'. I cannot use it any longer until there is a fix for this.
Sorry all, been kept busy with family at home (3 kids). I have a fix for supporting it already. Will publish a new version today.
Sorry for the delay in this issue and any inconvenience
@stevematdavies ^^
I had to remove this plugin. pitifully it doesn't work. I think It format my code with the default prettier setting. but doesn't take my local settings.
the following are my local settings:
prettier version
"prettier": "^2.0.5",
.pretierrc
{
"singleQuote": true
}
.eslintrc.js
module.exports = {
root: true,
env: {
browser: true,
node: true
},
parserOptions: {
parser: 'babel-eslint',
ecmaVersion: 2018,
sourceType: 'module'
},
extends: [
'prettier',
'prettier/react',
'plugin:react-hooks/recommended',
'plugin:prettier/recommended',
'plugin:jsx-a11y/recommended'
],
plugins: ['react', 'react-hooks', "jsx-a11y"],
// add your custom rules here
rules: {
'react/prop-types': 1,
'prettier/prettier': [
'error',
{
endOfLine: 'auto',
singleQuote: true
},
],
}
}
.stylelintrc
{
'extends': ['stylelint-prettier/recommended'],
'plugins': [
'stylelint-declaration-use-variable',
'stylelint-order'
],
'rules': {
"prettier/prettier": [true, {"singleQuote": true}],
'unicode-bom': 'never',
'sh-waqar/declaration-use-variable': [['/color/', 'background', 'background-color', 'font-size']],
'order/order': [
"custom-properties",
"declarations"
],
'order/properties-alphabetical-order': true
}
}
Most helpful comment
Sorry all, been kept busy with family at home (3 kids). I have a fix for supporting it already. Will publish a new version today.
Sorry for the delay in this issue and any inconvenience