Skip to content
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

The template root requires exactly one element #1439

Closed
2 tasks done
alexcroox opened this issue Feb 12, 2021 · 0 comments · Fixed by #1448
Closed
2 tasks done

The template root requires exactly one element #1439

alexcroox opened this issue Feb 12, 2021 · 0 comments · Fixed by #1448

Comments

@alexcroox
Copy link

alexcroox commented Feb 12, 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: 7.19.0
  • eslint-plugin-nuxt version: 2.0.0 ("eslint-plugin-vue": "^7.5.0")
  • Node version: v12.16.1
  • Operating System: Mac OS 10.15.7

Please show your full configuration:

module.exports = {
  root: true,

  env: {
    browser: true,
    node: true
  },

  parserOptions: {
    parser: 'babel-eslint'
  },

  extends: [
    '@nuxtjs',
    'prettier',
    'prettier/vue',
    'plugin:prettier/recommended',
    'plugin:nuxt/recommended',
    'plugin:vue-a11y/base',
    'plugin:cypress/recommended',
    'plugin:@intlify/vue-i18n/recommended'
  ],

  plugins: ['prettier', '@intlify/vue-i18n', 'vue-a11y', 'cypress'],

  rules: {
    'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
    // https://eslint.org/docs/rules/padding-line-between-statements
    'padding-line-between-statements': [
      'error',
      { blankLine: 'always', prev: ['const', 'let', 'var'], next: '*' },
      { blankLine: 'any', prev: ['const', 'let', 'var'], next: ['const', 'let', 'var'] },
      { blankLine: 'always', prev: ['case', 'default'], next: '*' },
      { blankLine: 'always', prev: 'directive', next: '*' },
      { blankLine: 'always', prev: 'function', next: '*' },
      { blankLine: 'always', prev: '*', next: 'function' },
      { blankLine: 'always', prev: 'if', next: '*' },
      { blankLine: 'always', prev: '*', next: 'if' },
      { blankLine: 'any', prev: 'directive', next: 'directive' }
    ],
    'lines-between-class-members': ['error', 'always'],
    'prefer-template': 'error',
    'vue/prop-name-casing': ['error', 'camelCase'],
    'vue/attribute-hyphenation': 'off',
    'vue/component-name-in-template-casing': [
      'error',
      'PascalCase',
      { registeredComponentsOnly: false, ignores: ['/^component/', '/^client-only/'] }
    ],
    'vue/new-line-between-multi-line-property': [
      'error',
      {
        minLineOfMultilineProperty: 2
      }
    ],
    'vue/require-name-property': 'error',
    'vue/object-curly-spacing': ['error', 'always'],
    'vue/padding-line-between-blocks': ['error', 'always'],

    'nuxt/no-cjs-in-config': 'off',
    'nuxt/require-func-head': ['error'],

    'import/no-mutable-exports': 'off',

    // https://eslint-plugin-vue-i18n.intlify.dev/rules/#recommended
    '@intlify/vue-i18n/no-html-messages': ['error'],
    '@intlify/vue-i18n/no-missing-keys': ['error'],
    '@intlify/vue-i18n/no-raw-text': 'off',
    '@intlify/vue-i18n/no-v-html': 'error',
    '@intlify/vue-i18n/key-format-style': ['error', 'camelCase'],
    '@intlify/vue-i18n/no-duplicate-keys-in-locale': [
      'error',
      {
        ignoreI18nBlock: false
      }
    ],
    '@intlify/vue-i18n/no-dynamic-keys': 'error',
    '@intlify/vue-i18n/no-unused-keys': [
      'off',
      {
        extensions: ['.js', '.vue']
      }
    ],

    'vue-a11y/label-has-for': 'off',
    'vue-a11y/form-has-label': 'off',
    'vue-a11y/no-onchange': 'off',
    'vue-a11y/click-events-have-key-events': 'off'
  },

  overrides: [
    {
      // https://stackoverflow.com/a/50101673/241465
      files: ['*.spec.js'],
      rules: {
        'no-unused-expressions': 'off'
      }
    }
  ],

  settings: {
    'vue-i18n': {
      localeDir: 'locales/*.json'
    }
  },

  ignorePatterns: ['ios/*', 'android/*']
}

What did you do?

<template>
  <Link :to="to" class="flex items-center">
    <span v-if="prefixIcon || $slots.prefix" class="mr-1">
      <slot name="prefix">
        <FontAwesomeIcon v-if="prefixIcon" :icon="prefixIcon" fixedWidth />
      </slot>
    </span>

    <slot />
  </Link>
</template>

What did you expect to happen?
No errors

What actually happened?
image

ota-meshi added a commit that referenced this issue Mar 2, 2021
ota-meshi added a commit that referenced this issue Mar 2, 2021
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 a pull request may close this issue.

1 participant