vim-prettier
vim-prettier copied to clipboard
Bug: correctly formatting on `<Leader>p`, incorrectly formatting on save
Do you want to request a feature or report a bug? Bug
What is the current/expected behavior?
current behavior: respecting let g:prettier#config#semi = 'false' on <Leader>p, but not on file save
expected behavior: same behavior on <Leader> p and file save
What version of vim-prettier are you using - (output of :PrettierVersion) ? 1.0.0-alpha
What version of prettier are you using - (output of :PrettierCliVersion) ? 1.16.4^@
What is your prettier executable path - (output of :PrettierCliPath) ? ../client/node_modules/.bin/prettier
Did this work in previous versions of vim-prettier and/or prettier ? Not sure
Hi @n-xlkt ,
Thanks for reporting this issue, just to make sure i understood.
- When using
<Leader> pyou get the formatting as you expected - When saving a file the auto formatting is not matching the one from
<Leader> p?
Can you provide a minimal sample code for me to reproduce and look into it ?
thanks a lot!
For sure! Hope this clarifies.
original sample:
import React, { Component, Fragment } from "react"
import { Row, Col } from 'react-bootstrap'
import { Link } from 'react-router-dom'
const overdueReview = {
color: '#F15B4E'
}
using <Leader> p:
import React, { Component, Fragment } from 'react'
import { Row, Col } from 'react-bootstrap'
import { Link } from 'react-router-dom'
const overdueReview = {
color: '#F15B4E'
}
using :w:
import React, { Component, Fragment } from "react";
import { Row, Col } from "react-bootstrap";
import { Link } from "react-router-dom";
const overdueReview = {
color: "#F15B4E"
};
here's pertinent samples from my dots:
" ale linting events
let b:ale_fixers = ['prettier']
let g:ale_fix_on_save = 1
let g:ale_sign_error = '❌'
let g:ale_sign_warning = '⚠️'
" prettier
let g:prettier#config#print_width = 100
let g:prettier#config#semi = 'false'
let g:prettier#config#trailing_comma = 'none'
let g:prettier#config#single_quote = 'true'```