Skip to content

Nuxt vue/no-dupe-keys disallows TypeScript and default params support #1687

Closed
@daniluk4000

Description

@daniluk4000

What rule do you want to change?
vue/no-dupe-keys behavior in 8.0.0

Does this change cause the rule to produce more or fewer warnings?

  1. When using TypeScript, asyncData values must be duplicated in data in order to make them typed
  2. I may not return all params in asyncData, in that case data property will work like default value.

How will the change be implemented? (New option, new default behavior, etc.)?
Rollback asyncData support for vue/no-dupe-keys

Please provide some example code that this change will affect:

export default Vue.extend({
    async asyncData() {
        return {
            isPopupVisible: true,
        };
    },
    data() {
        return {
            isPopupVisible: false,
        };
    },
    mounted() {
        this.isPopupVisible = true;
        //...
     }
});

What does the rule currently do for this code?
Duplicated key 'isPopupVisible'.(vue/no-dupe-keys) for data property. If I remove it from data, I will get Property 'isPopupVisible' does not exist on type 'CombinedVueInstance >>'

What will the rule do after it's changed?
This code works as intended.

Additional context
изображение

изображение

New behavior leaves no choice but to disable this rule or place eslint-ignore everywhere. Yet, I have to stay on 7.x.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions