Eslint-plugin-vue: vue-class-component support

Created on 1 May 2018  路  12Comments  路  Source: vuejs/eslint-plugin-vue

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

in consideration question

Most helpful comment

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.

All 12 comments

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

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.

Sorry guys, but unless class based API is an official one supported by Vue, we won鈥檛 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鈥檒l be covered.

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

@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 https://github.com/eslint/typescript-eslint-parser/issues/555, and i'm waiting for fixes to them to be merged

but as michalsnik mentioned we added some support for object components in badd05113630a79aaa1be29e4785308a08bacf65 6032f213bba901df65df71b16e18803f500e67a8

i hope thats answer your question

thank you @armano2 .

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.

@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

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

I still get this error...

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

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

Was this page helpful?
0 / 5 - 0 ratings