Skip to content

docs: fix block-order default value #2745

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mrleblanc101
Copy link

fix: #2744

Copy link

changeset-bot bot commented May 14, 2025

⚠️ No Changeset found

Latest commit: 6606256

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@ntnyq
Copy link
Contributor

ntnyq commented May 15, 2025

The docs is aligned with the default options:

const DEFAULT_ORDER = Object.freeze([['script', 'template'], 'style'])

The issue owner need to provide more information about his code, config, expect behavior and actually behavior.

@mrleblanc101
Copy link
Author

mrleblanc101 commented May 15, 2025

@ntnyq Why is there a nested array ? It's not explained anywhere... All the example use flat array

@ntnyq
Copy link
Contributor

ntnyq commented May 15, 2025

@ntnyq Why is there a nested array ? It's not explained anywhere... All the example use flat array

The default option means leave scripts and templates as it's original order, but moves all styles to the bellow.

The schema of options defined in here:

schema: [
{
type: 'object',
properties: {
order: {
type: 'array',
items: {
oneOf: [
{ type: 'string' },
{ type: 'array', items: { type: 'string' }, uniqueItems: true }
]
},
uniqueItems: true,
additionalItems: false
}
},
additionalProperties: false
}
],

And there are examples in https://eslint.vuejs.org/rules/block-order.html#order-script-template-style-default.

@mrleblanc101
Copy link
Author

@ntnyq There is one, out of all the others, and it's not explained.
Maybe there should be an explanation on the syntax ?

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

Successfully merging this pull request may close these issues.

Issue in documentation for vue/block-order
2 participants