Code Monkey home page Code Monkey logo

Comments (16)

zoominGiladSher avatar zoominGiladSher commented on June 5, 2024 19

The way that I solved it was by changing the package files locally since this repo doesn't seem very maintained:

  1. in autoload/prettier/resolver/config.vim I changed the function prettier#resolver#config#resolve by removing depracated jsx-bracket-same-line and changing loglevel cli argument to log-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
  1. 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.

gregorywaynepower avatar gregorywaynepower commented on June 5, 2024 3

@bumasello Was there a pull request that fixed this issue?

from vim-prettier.

LordPax avatar LordPax commented on June 5, 2024 1

PR that solve the problem : #345

from vim-prettier.

caiangums avatar caiangums commented on June 5, 2024 1

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.

nusendra avatar nusendra commented on June 5, 2024 1

@JudeDavis1 yup this still happening.

from vim-prettier.

AmoghCreator avatar AmoghCreator commented on June 5, 2024 1

@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.

zoominGiladSher avatar zoominGiladSher commented on June 5, 2024

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.

bumasello avatar bumasello commented on June 5, 2024

So I have to uninstall prettier on windows and nvim and install an older version?

from vim-prettier.

zoominGiladSher avatar zoominGiladSher commented on June 5, 2024

It only solves the log-level issue, jsx-bracket-same-line is not there and is still deprecated @LordPax

from vim-prettier.

gregorywaynepower avatar gregorywaynepower commented on June 5, 2024

@mitermayer Is this something you have the bandwidth to deal with?

from vim-prettier.

nickhealy avatar nickhealy commented on June 5, 2024

@bumasello i am also getting this issue still, why have you closed the issue?

from vim-prettier.

brandishcode avatar brandishcode commented on June 5, 2024

Also experiencing this issue.

from vim-prettier.

jrledezma avatar jrledezma commented on June 5, 2024

@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.

gregorywaynepower avatar gregorywaynepower commented on June 5, 2024

Looks like this may be resolved in #345 according to @mitermayer .

from vim-prettier.

nusendra avatar nusendra commented on June 5, 2024

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.

JudeDavis1 avatar JudeDavis1 commented on June 5, 2024

Why is this closed? This issue is still happening

from vim-prettier.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.