Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

vue/sort-keys runOutsideVue option #1865

Closed
@lukethompson

Description

@lukethompson

What rule do you want to change?
vue/sort-keys add option to give the ability to only run inside of Vue. My team likes to alphabetize ourprops,computed,methods etc... but we do not want to enforce all object keys being sorted.

vue/sort-keys does already have arunOutsideVue option but it is not used in the rule.

Does this change cause the rule to produce more or fewer warnings?
Fewer if the option is set.

How will the change be implemented? (New option, new default behavior, etc.)?
vue/sort-keys already hasoptions.runOutsideVue, the default value istrue passingfalse doesn't do anything. The change will use the value passed by this option to allow users to ignore sorting outside of vue.

Please provide some example code that this change will affect:

// runOutsideVue: falseexport default {    methods: {       // Will sort keys inside of `methods`, `props`, `computed` etc...        createArticle () {            return this.createEntity({                // Will ignore keys not on a Vue instance                id: 1,                type: 'article',                attributes: { createdAt: new Date() }            })        },        deleteArticle (id) {}    },}

What does the rule currently do for this code?
options.runOutsideVue exists but is not used. Currently all object keys are sorted by this rule.

What will the rule do after it's changed?
Use theoptions.runOutsideVue option, currently is defaulted totrue so this change will have no impact on existing uses.

Additional context
This change will somewhat address the issue here#630

I have already implemented this change and will link the PR below.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp