v-change-tags-order
v-change-tags-order
Changes the order of <script>
and <template>
tags in Vue single file components.
Usage
# In your Vue.js project
# If you want to put the `script` tag before the `template` tag
npx v-change-tags-order
# If you want to put the `template` tag before the `script` tag
npx v-change-tags-order --pattern 2
Args
args | default | description |
---|---|---|
pattern |
1 | In pattern 1, the script tag will be placed before the template tag.In pattern 2, the script tag will be placed after the template tag. |
ignore |
node_modules | What you want to exclude from changes, which can be set with the glob pattern. |
Recommend
After executing the command, it is recommended to set the rules in ESLint's vue/component-tags-order.
{
"vue/component-tags-order": ["error", {
"order": [ "script", "template", "style" ]
}]
}
Dependencies
@commitlint/cli: ^13.1.0@commitlint/config-conventional: ^13.1.0@types/cli-progress: ^3.9.2@types/glob: ^7.1.4@types/jest: ^27.0.1@types/yargs: ^17.0.2@typescript-eslint/eslint-plugin: ^4.29.1@typescript-eslint/parser: ^4.29.1eslint: ^7.32.0eslint-config-prettier: ^8.3.0husky: ^7.0.0jest: ^27.0.6lint-staged: >=10prettier: ^2.3.2semantic-release: ^17.4.5ts-jest: ^27.0.4ts-node: ^10.2.0typescript: ^4.3.5