Code Monkey home page Code Monkey logo

Comments (11)

kddnewton avatar kddnewton commented on May 18, 2024 1

@infotexture Yeah that option was dropped after feedback from the community when I opened the PR to merge this plugin into prettier core.

from plugin-xml.

gtwohig avatar gtwohig commented on May 18, 2024 1

@kddnewton too bad that it was dropped as lack of this feature is a blocker for us going to 1.0.

Use case: we are cleaning up/standardizing formatting on XML that is returned to us via the Salesforce metadata API. They (salesforce) do not include a space before the ?> on the xml version line nor do they on self closing elements. With xmlSelfClosingSpace: false the only files with a diff after the pull are ones that have a substantive change. This allows pretty-quick to run super fast because only a few files need to be prettified. With the 1.0 behavior we have thousands of files with whitespace only diffs that need to be cleaned up by prettier eliminating the significant speed improvements we get from pretty-quick.

from plugin-xml.

kddnewton avatar kddnewton commented on May 18, 2024 1

Ehh alright. You convinced me. I'll release that today.

from plugin-xml.

kddnewton avatar kddnewton commented on May 18, 2024

This is now on master as xmlSelfClosingSpace

from plugin-xml.

infotexture avatar infotexture commented on May 18, 2024

@kddeisz 🙏 Thanks for the initial implementation in b415dcf for 0.5.0.

The new option seems to work fine when added to the Prettier configuration file, for example as:

# .prettierrc.yaml

# https://github.com/prettier/plugin-xml/issues/11
xmlSelfClosingSpace: false

— but I get a warning when passing the new option via the CLI:

$ prettier --write "index.dita" --parser=xml --xmlSelfClosingSpace false
[warn] Ignored unknown option --xmlSelfClosingSpace=false.
index.dita 21ms

from plugin-xml.

kddnewton avatar kddnewton commented on May 18, 2024

@infotexture yeah on the command line it's --xml-self-closing-space.

from plugin-xml.

infotexture avatar infotexture commented on May 18, 2024

@kddeisz Ah, right, easy to forget that. See #48 ☝️ for a proposal.

from plugin-xml.

infotexture avatar infotexture commented on May 18, 2024

@kddnewton The changelog says the xmlSelfClosingSpace option that fixed this issue was removed from the 1.0.0 release.

Does that mean all instances of <foo/> will revert to <foo />, or is there some other way to preserve the tighter spaceless syntax in self-closing elements and XML declarations?

from plugin-xml.

infotexture avatar infotexture commented on May 18, 2024

I also have client projects that are sticking with the previous version for this reason. 😞

from plugin-xml.

infotexture avatar infotexture commented on May 18, 2024

Much appreciated.
Thank you. 🙏

from plugin-xml.

gtwohig avatar gtwohig commented on May 18, 2024

Thanks @kddnewton excited to be on the latest version and everything seems to be working great!

from plugin-xml.

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.