Comments (16)
The way that I solved it was by changing the package files locally since this repo doesn't seem very maintained:
- in
autoload/prettier/resolver/config.vim
I changed the functionprettier#resolver#config#resolve
by removing depracatedjsx-bracket-same-line
and changingloglevel
cli argument tolog-level
code:
" By default we will default to our internal
" configuration settings for prettier
function! prettier#resolver#config#resolve(config, hasSelection, start, end) abort
" Allow params to be passed as json format
" convert bellow usage of globals to a get function o the params defaulting to global
" TODO: Use a list, filter() and join() to get a nicer list of args.
let l:cmd = s:Flag_use_tabs(a:config) . ' ' .
\ s:Flag_tab_width(a:config) . ' ' .
\ s:Flag_print_width(a:config) . ' ' .
\ s:Flag_parser(a:config) . ' ' .
\ s:Flag_range_delimiter(a:config, a:hasSelection, a:start, a:end) . ' ' .
\ ' --semi=' .
\ get(a:config, 'semi', g:prettier#config#semi) .
\ ' --single-quote=' .
\ get(a:config, 'singleQuote', g:prettier#config#single_quote) .
\ ' --bracket-spacing=' .
\ get(a:config, 'bracketSpacing', g:prettier#config#bracket_spacing) .
\ ' --arrow-parens=' .
\ get(a:config, 'arrowParens', g:prettier#config#arrow_parens) .
\ ' --trailing-comma=' .
\ get(a:config, 'trailingComma', g:prettier#config#trailing_comma) .
\ ' --config-precedence=' .
\ get(a:config, 'configPrecedence', g:prettier#config#config_precedence) .
\ ' --prose-wrap=' .
\ get(a:config, 'proseWrap', g:prettier#config#prose_wrap) .
\ ' --html-whitespace-sensitivity ' .
\ get(a:config, 'htmlWhitespaceSensitivity', g:prettier#config#html_whitespace_sensitivity) .
\ ' --stdin-filepath="'.simplify(expand('%:p')).'"' .
\ ' --require-pragma=' .
\ get(a:config, 'requirePragma', g:prettier#config#require_pragma) .
\ ' --end-of-line=' .
\ get(a:config, 'endOfLine', g:prettier#config#end_of_line) .
\ ' --log-level error '.
\ ' --stdin '
return l:cmd
endfunction
- In
plugin/prettier.vim
I removed the following code:
" put > on the last line instead of new line
" default: 'false'
" See more: https://prettier.io/docs/en/options.html#jsx-brackets
let g:prettier#config#jsx_bracket_same_line = get(g:,'prettier#config#jsx_bracket_same_line', 'false')
from vim-prettier.
@bumasello Was there a pull request that fixed this issue?
from vim-prettier.
PR that solve the problem : #345
from vim-prettier.
It only solves the log-level issue,
jsx-bracket-same-line
is not there and is still deprecated @LordPax
@zoominGiladSher I just updated the log-level
locally at my env and it stopped complaining about the jsx-bracket-same-line
. It could be because I'm writing *.tsx
files at a Next.js personal project 🤔
Thanks @LordPax 🙏
from vim-prettier.
@JudeDavis1 yup this still happening.
from vim-prettier.
@nusendra yup, 2.5.1 seems to be the only viable option rn with this issue. I am unable to implement the fix shared by @zoominGiladSher for my lua config. I will try to look for the latest version that works without a hitch, 2.5.1 and forwards.
from vim-prettier.
This seems like a problem with the new version of Prettier (3.0.0) being a major version with breaking changes that are not yet supported by the plugin. Hoping that the creators will update it, but doubt it since it has not been committed to in a few years...
from vim-prettier.
So I have to uninstall prettier on windows and nvim and install an older version?
from vim-prettier.
It only solves the log-level issue, jsx-bracket-same-line
is not there and is still deprecated @LordPax
from vim-prettier.
@mitermayer Is this something you have the bandwidth to deal with?
from vim-prettier.
@bumasello i am also getting this issue still, why have you closed the issue?
from vim-prettier.
Also experiencing this issue.
from vim-prettier.
@bumasello Was there a pull request that fixed this issue?
is this available?
because I'm just download again the plugin and I don't see this has been fiexed
from vim-prettier.
Looks like this may be resolved in #345 according to @mitermayer .
from vim-prettier.
Still got this issue with prettier ^3. It's working fine on 2.5.1 version. So i will use this version (2.5.1) for now
from vim-prettier.
Why is this closed? This issue is still happening
from vim-prettier.
Related Issues (20)
- feature request to disable automatic mappings set by the plugin
- .eslintrc is ignored
- prettier hang on formatting a bigger file
- MacOS Monterey M1 plugin not loaded
- When endOfLine option set to 'crlf', ^M appear at the end of each line
- Prettier: failed to parse buffer — on mixed HTML/PHP file HOT 1
- Formatting on save stop when saving again
- Deletes comments in Ruby files HOT 3
- The same prettier doesn't work correctly on WSL
- plugin didn't work without installing eslint-config-prettier & eslint-plugin-prettier
- Request: check for filetype javascript (not just the .js and .jsx extensions) HOT 1
- Prettier auto format on Save not working. HOT 1
- Deprecated / Unknown options when using Prettier v3 HOT 3
- Keep show warning after save! HOT 1
- Error while resolving package dependencies HOT 3
- Error on manual trigger
- prettier runs with incorrect prettier configuration HOT 2
- Vim-Prettier is using its own defaults, not the defaults from prettier (in my case, trailingComma)
- `Failed to parse buffers` for Ruby files. 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 vim-prettier.