Coder Social home page Coder Social logo

Add prettier config about attractions HOT 6 CLOSED

illright avatar illright commented on May 9, 2024
Add prettier config

from attractions.

Comments (6)

aabounegm avatar aabounegm commented on May 9, 2024 1

@illright Now that we no longer have <svelte:options> in the source code, maybe it's worth giving this another shot?

from attractions.

illright avatar illright commented on May 9, 2024

Will do!

from attractions.

illright avatar illright commented on May 9, 2024

Okay, so I tried setting it up, you can see it in the prettier branch. It's currently doing weird stuff with Svelte files, transforming the attractions/popover/popover-button.svelte file into this:

<script>
  import { createEventDispatcher } from 'svelte';
  import classes from '../utils/classes.js';

  let _class = null;
  export { _class as class };

  const dispatch = createEventDispatcher();
</script>

<svelte:options tag="a-popover-button" /><button
  type="button"
  class={classes('popover-button', _class)}
  on:click={e => dispatch('click', { nativeEvent: e })}
  {...$$restProps}
>
  <slot />
</button>

<style src="./popover-button.scss">
</style>

I am mostly bothered by that svelte:options thing. Have you encountered anything similar? Any ideas how to fix it?

from attractions.

RikuVan avatar RikuVan commented on May 9, 2024

oh, that is a bit annoying. Not an issue I was aware of. Have you been using prettier locally already in your editor with Svelte (just wondering of this is an issue when using config)? If you can't get it working maybe the minimum is to add a comment to disable prettier with the project until the bug for this whitespace removal is resolved.

from attractions.

illright avatar illright commented on May 9, 2024

Nope, haven't used Prettier before. I'm thinking of opening an issue on the Svelte Prettier config about this and hold on to merging that branch until they fix it

from attractions.

RikuVan avatar RikuVan commented on May 9, 2024

seems to be an issue already in the plugin repo about putting options at the top: sveltejs/prettier-plugin-svelte#73

When I use prettier, I does move options to the markup part of the code but it doesn't remove whitespace between it and the next element. I suppose that is something in the prettier settings.

from attractions.

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.