Skip to content

Commit

Permalink
fix(eslint): set different vue block order for vue2/3
Browse files Browse the repository at this point in the history
  • Loading branch information
ModyQyW committed Mar 22, 2024
1 parent 6b817df commit a8401a1
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions src/eslint/configs/vue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ const vue3Rules = {
...pluginVue.configs['vue3-strongly-recommended'].rules,
...pluginVue.configs['vue3-recommended'].rules,
...pluginVueScopedCss.configs['vue3-recommended'].rules,
'vue/block-order': [
'error',
{
order: ['script', 'template', 'style'],
},
],
'vue/component-api-style': [
'error',
['script-setup', 'composition', 'composition-vue2', 'options'],
Expand Down Expand Up @@ -52,6 +58,12 @@ const vue2Rules = {
...pluginVue.configs['strongly-recommended'].rules,
...pluginVue.configs.recommended.rules,
...pluginVueScopedCss.configs.recommended.rules,
'vue/block-order': [
'error',
{
order: ['template', 'script', 'style'],
},
],
'vue/component-api-style': ['error', ['script-setup', 'composition']],
'vue/custom-event-name-casing': ['error', 'kebab-case'],
'vue/v-if-else-key': 'warn',
Expand Down Expand Up @@ -184,12 +196,6 @@ export function vue(options: VueOptions = {}): Config[] {
// too ideal for business
'vue-scoped-css/enforce-style-type': 'off',
// Uncategorized
'vue/block-order': [
'error',
{
order: ['script', 'template', 'style'],
},
],
'vue/block-tag-newline': [
'error',
{
Expand Down

0 comments on commit a8401a1

Please sign in to comment.