Code Monkey home page Code Monkey logo

Comments (5)

zakhenry avatar zakhenry commented on June 16, 2024 1

@maxime1992 ok I've come up with a fix, it's somewhat simple as it just checks if the diff would be trailing whitespace only. Note that you have to be careful that prettier also runs on all your source files as the embedded snippets are also run through prettier. This caught me out as I was running yarn run prettier "**/*.{js,json,json5,scss,md,ts,html}" with yaml omitted, but the yaml embed in the fixture was being rewritten, causing a diff and the tests to fail.

from embedme.

maxime1992 avatar maxime1992 commented on June 16, 2024

I also just notice that it's an issue when running prettier as:

  • prettier adds an empty line at the end of a file (which can be the demo code used by embedme)
  • embedme doesn't trim the code when injecting it
  • prettier runs on CI and throws an errors as it wants to remove the last empty line on the code block

from embedme.

zakhenry avatar zakhenry commented on June 16, 2024

This issue is oddly complex - prettier's behavior differs depending on the detected code type of the code block. I'll have a think

from embedme.

zakhenry avatar zakhenry commented on June 16, 2024

πŸŽ‰ This issue has been resolved in version 1.9.0 πŸŽ‰

The release is available on:

Your semantic-release bot πŸ“¦πŸš€

from embedme.

maxime1992 avatar maxime1992 commented on June 16, 2024

Nice one πŸ™Œ I'll give a try asap :)

from embedme.

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.