Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

vue-class-component support #469

Closed
sobolevn opened this issue May 1, 2018 · 13 comments
Closed

vue-class-component support #469

sobolevn opened this issue May 1, 2018 · 13 comments

Comments

@sobolevn
Copy link

sobolevn commented May 1, 2018

Is vue-class-component support is available?
Docs does not have any information about it.

If it is not available, do you have any plans about it?

Things I have tried:

// @vue/component
export default class Comment extends Vue {
  get computedValue () {
    console.log(12)
  }
}

This does not work. However, linting export default {} components works fine.
Here's my full setup: https://github.com/wemake-services/wemake-vue-template

@upgle
Copy link

upgle commented May 5, 2018

I also wonder if there is a plan to support it.

@michalsnik
Copy link
Member

michalsnik commented Jul 11, 2018

It would require lots of tweaking. AST of Class is different than Object. I didn't give it a thought yet. But it might be wise to reconsider.

@michalsnik
Copy link
Member

Sorry guys, but unless class based API is an official one supported by Vue, we won’t introduce support for it, due to the technical complications and not many requests. We do however work on improving TypeScript support, so unless you use vue-class-component you’ll be covered.

@osman-mohamad
Copy link

vue-class-component is now officially supported by vue team . is there any news about this feature support ?

@armano2
Copy link
Contributor

armano2 commented Nov 25, 2018

@osman-mohamad i started working on it some time ago, but its not ready to be used by users.
there is also some issues with eslint/typescript-eslint-parser#555, and i'm waiting for fixes to them to be merged

but as michalsnik mentioned we added some support for object components in badd051 6032f21

@armano2
Copy link
Contributor

armano2 commented Nov 25, 2018

i hope thats answer your question

@osman-mohamad
Copy link

thank you @armano2 .

@maksnester
Copy link

Any chance that rules like prop order enforcement will work with vue-class-component in further releases?

I believe TS would be more and more valuable for vue users. But tooling around ts+vue looks unfinished mostly.

@armano2
Copy link
Contributor

armano2 commented Jan 1, 2019

@alendorff recently i'm fixing issues in https://github.com/JamesHenry/typescript-estree and https://github.com/eslint/typescript-eslint-parser to make it possible, it's going to take some time but we are on good path

@Djaler
Copy link

Djaler commented Feb 13, 2019

@armano2 here are new mantained version now - https://github.com/typescript-eslint/typescript-eslint

@gutisalex
Copy link

gutisalex commented Mar 25, 2020

I still get this error...

Expected 'this' to be used by class getter 'players'.eslint(class-methods-use-this)

@mariusheine
Copy link

Is there any progress or an alternative for using these eslint rules in combination with vue-class-component?

@Tonysmark
Copy link

got same issue, however this no mention from official documentation
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

10 participants