sveltejs / svelte-atom

Syntax, diagnostics, and other smarts for Svelte in Atom
MIT License
30 stars 11 forks source link

A component can only have a default export #2

Closed AlexGustafsson closed 2 years ago

AlexGustafsson commented 5 years ago

Following the tutorial over at https://svelte.dev/tutorial/declaring-props, I've declared a component which looks like this:

<script>
  export let answer;
</script>

<p>The answer is {answer}</p>

However, I get a linter error from "svelte" saying that "A component can only have a default export". Clearly this must be wrong.

Any ideas of what could be causing this?

shellscape commented 5 years ago

@UnwrittenFun ping

jamesbirtles commented 5 years ago

I've neglected the atom plugin a bit so its quite out of date. Will try to push a new version soon

CREEATION commented 4 years ago

@UnwrittenFun 🏓 😋

itay-grudev commented 4 years ago

@UnwrittenFun Any update on this?

eaviles commented 4 years ago

@UnwrittenFun ping :(

itay-grudev commented 4 years ago

+1

platypusjones commented 4 years ago

+2 this is pretty rough for Atom users.

infuzz commented 4 years ago

pong ?

Rich-Harris commented 4 years ago

@UnwrittenFun if transferring this repo to the sveltejs org would help, by making it easier for other people to help out on this project, let me know. I wouldn't personally have the first clue about maintaining an Atom plugin but I'm sure we can muddle through between us (at least to upgrade it to Svelte 3)

eaviles commented 4 years ago

@UnwrittenFun @Rich-Harris I'll be happy to help with maintenance or contributions. Let me know.

jamesbirtles commented 4 years ago

@Rich-Harris Happy to transfer this. I think/hope updating would mostly be a matter of installing the latest version of the language server (Grammar might need updating a little?)

Rich-Harris commented 4 years ago

Excellent, thank you — will keep an eye out for the transfer

jamesbirtles commented 4 years ago

@Rich-Harris Have requested transfer to you as I can't do it to the svelte org without being a member

Rich-Harris commented 4 years ago

@UnwrittenFun gah, I just saw this but the link had already expired — can I trouble you to transfer it again?

jamesbirtles commented 4 years ago

@Rich-Harris Sent 😄

Rich-Harris commented 4 years ago

Thank you! It's now part of the sveltejs organisation: https://github.com/sveltejs/svelte-atom

the0neWhoKnocks commented 4 years ago

Is there a workaround for this? Just opened up the sapper-template for the first time, and the linter is already saying "nope".

the0neWhoKnocks commented 4 years ago

Round 1 Ok, so I've partially worked around this. Went into <user>/.atom/packages/ide-svelte and ran npm i svelte-language-server@0.10.3 (since a new version's been published, but the addon has the version pinned). That got rid of the lint error, but seems to have now brought in a Typescript lint info message Variable 'segment' implicitly has an 'any' type, but a better type may be inferred from usage.

I don't have Typescript enabled in the project, would be nice if this was an opt-in toggle in the addon.

Round 2 Ok, I've worked around this. Went into <user>/.atom/packages/ide-svelte and ran npm i svelte-language-server@0.10.76 (since a new version's been published, but the addon has the version pinned). That got rid of the lint error.

TKO The above worked on load of a file, but as soon as I tried to edit anything I got Parsing error: Unexpected token < (Fatal). Tried a bunch of different versions after that, and same result. So I'm callin' it quits for now. Would be nice if there was a base package for syntax highlighting, and other packages for all the bells and whistles.

dkotik commented 3 years ago

Fix in the works?

the0neWhoKnocks commented 3 years ago

@dkotik https://github.com/sveltejs/language-tools/pull/160. Who knows when/if it'll get any traction.

Honestly though, it seems all the eggs have gone into the VS Code basket, which is a bummer.

mlsvrts commented 3 years ago

@dkotik You can update the language server version manually, run npm install, and then reboot atom. Or you can just try out my forked package (https://atom.io/packages/ide-svelte-2), which updates the svelte language server to 0.11.0

That alone works fine on my projects, but feel free to report any issues and I'll have a go at fixing them.

dkotik commented 3 years ago

@mlsvrts ok, I updated ide-svelte/package.json with (and it worked! what a marvelous person you are - can we be friends? I am dkotik on twitter):

  "dependencies": {
    "atom-languageclient": "^0.9.9",
    "svelte-language-server": "0.11.0"
  },

I deleted .lock file and ran npm install

rixo commented 2 years ago

Should be fixed in 1.0.0 that include the last version of Language Server (which is very big jump :sweat_smile: ).