Skip to content

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

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

Closed
2 tasks done
caugner opened this issue Oct 21, 2021 · 0 comments · Fixed by #1684
Closed
2 tasks done

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

caugner opened this issue Oct 21, 2021 · 0 comments · Fixed by #1684
Labels

Comments

@caugner
Copy link

caugner commented Oct 21, 2021

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)

@caugner caugner changed the title vue/multi-word-component-names triggers error on "import Vue from 'vue'" in main.js vue/multi-word-component-names triggers error on "import Vue from 'vue'" in main.js Oct 21, 2021
@caugner caugner changed the title vue/multi-word-component-names triggers error on "import Vue from 'vue'" in main.js vue/multi-word-component-names complains about import Vue from 'vue' in main.js Oct 21, 2021
@caugner caugner changed the title vue/multi-word-component-names complains about import Vue from 'vue' in main.js vue/multi-word-component-names complains about import Vue from 'vue' in main.ts Oct 21, 2021
@ota-meshi ota-meshi added the bug label Oct 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants