Skip to content

vue/multi-word-component-names complains about import Vue from 'vue' in main.ts #1670

Closed
@caugner

Description

@caugner

Checklist

  • I have tried restarting my IDE and the issue persists.
  • I have read the FAQ and my problem is not listed.

Tell us about your environment

  • ESLint version: v7.32.0
  • eslint-plugin-vue version: v7.20.0
  • Node version: v14.17.6
  • Operating System: Ubuntu 20.04 LTS in WSL2 (Windows 10)

Please show your full configuration:

module.exports = {
  root: true,
  env: {
    node: true,
  },
  extends: [
    'plugin:vue/recommended',
    '@vue/prettier/recommended',
    '@vue/prettier/@typescript-eslint',
    '@vue/typescript/recommended',
  ],
  rules: {
    'vue/block-lang': ['error', { script: { lang: 'ts' } }],
    'vue/component-api-style': ['error', ['composition']],
    'vue/component-name-in-template-casing': [
      'error',
      'PascalCase',
      { registeredComponentsOnly: false, ignores: ['i18n'] },
    ],
    'vue/match-component-file-name': [
      'error',
      {
        extensions: ['vue'],
        shouldMatchCase: true,
      },
    ],
    'vue/no-computed-properties-in-data': ['error'],
    'vue/no-deprecated-data-object-declaration': ['error'],
    'vue/no-deprecated-destroyed-lifecycle': ['error'],
    'vue/no-deprecated-events-api': ['error'],
    'vue/no-deprecated-filter': ['error'],
    'vue/no-deprecated-inline-template': ['error'],
    'vue/no-deprecated-props-default-this': ['error'],
    'vue/no-deprecated-router-link-tag-prop': ['error'],
    'vue/no-deprecated-scope-attribute': ['error'],
    'vue/no-deprecated-slot-attribute': ['error'],
    'vue/no-deprecated-v-bind-sync': ['error'],
    'vue/no-deprecated-v-on-number-modifiers': ['error'],
    'vue/no-deprecated-vue-config-keycodes': ['error'],
    'vue/no-empty-component-block': ['error'],
    'vue/no-template-target-blank': ['error'],
    'vue/no-undef-properties': ['error'],
    'vue/no-unused-refs': ['error'],
    'vue/no-use-computed-property-like-method': ['error'],
    'vue/no-v-text': ['error'],
    'vue/multi-word-component-names': ['error'],
    'vue/padding-line-between-blocks': ['error', 'always'],
    'vue/require-explicit-emits': ['error'],
    'vue/v-for-delimiter-style': ['error', 'in'],
    'vue/valid-next-tick': ['error'],
    // Conflict with prettier
    'no-extra-semi': 'off',
    '@typescript-eslint/no-extra-semi': 'off',
  },
  overrides: [
    {
      files: [
        '**/__tests__/*.{j,t}s?(x)',
        '**/tests/unit/**/*.spec.{j,t}s?(x)',
      ],
      env: {
        jest: true,
      },
    },
  ],
}

What did you do?

// src/main.ts
import Vue from 'vue'
import VueCompositionAPI, { h } from '@vue/composition-api'
import i18n from '@/i18n'
import router from '@/router'
import store from '@/store'
// ...

Vue.use(VueCompositionAPI)

new Vue({
    i18n,
    router,
    store,
    setup() {
        return () => h(App)
    },
}).$mount('#app')

Run yarn lint on the code base.

What did you expect to happen?

No vue/multi-word-component-names errors should be reported in non-component files.

What actually happened?

A vue/multi-word-component-names error was reported in the main.ts file:

error: Component name "/var/www/html/src/main" should always be multi-word (vue/multi-word-component-names) at src/main.ts:1:1:
> 1 | import Vue from 'vue'

Repository to reproduce this issue

(closed source)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions