Skip to content

False positive vue/no-parsing-error on non-trivial slot name #276

@homersimpsons

Description

@homersimpsons

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I'm using eslint-plugin-vue.
  • I'm sure the problem is a parser problem. (If you are not sure, search for the issue in eslint-plugin-vue repo and open the issue in eslint-plugin-vue repo if there is no solution.
  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

What version of ESLint are you using?

9.34.0

What version of eslint-plugin-vue and vue-eslint-parser are you using?

  • vue-eslint-parser@10.2.0
  • eslint-plugin-vue@10.4.0

What did you do?

Configuration
import { defineConfig } from "eslint/config"; import globals from 'globals' import js from "@eslint/js"; import vue from 'eslint-plugin-vue' export default defineConfig([{ files: ["**/*.js", "**/*.vue"], plugins: { js, vue }, extends: [ js.configs.recommended, ...vue.configs['flat/recommended'], ], languageOptions: { sourceType: 'module', globals: { ...globals.browser, ...globals.jest, } }, rules: { indent: ["error", 2], "vue/no-v-html": "off", "keyword-spacing": "warn", "object-curly-spacing": ["warn", "always", { objectsInObjects: true }], "comma-spacing": ["warn", { before: false, after: true }], "key-spacing": ["warn", { afterColon: true }], "no-unused-vars": ["error", { argsIgnorePattern: "^_", caughtErrorsIgnorePattern: "^_" }], "vue/valid-v-model": "off", "vue/no-deprecated-v-on-native-modifier": "warn", // TODO: Fix the issues "vue/multi-word-component-names": "warn", // TODO: Fix the issues "vue/no-deprecated-destroyed-lifecycle": "warn", // TODO: Fix the issues "vue/no-deprecated-v-bind-sync": "warn", // TODO: Fix the issues "vue/no-mutating-props": "warn", // TODO: Fix the issues "vue/no-deprecated-slot-attribute": "warn", // TODO: Fix the issues "vue/no-useless-template-attributes": "warn", // TODO: Fix the issues "vue/no-deprecated-filter": "warn", // TODO: Fix the issues }, }])
<template v-slot:head(foo.bar)>

For example in the following context:

// App.vue <script setup> import Foobar from './Foobar.vue' </script> <template> <Foobar> <template v-slot:head(foo.bar)> foo bar </template> </Foobar> </template>
// Foobar.vue <template> <div> <slot name="head(foo.bar)" /> </div> </template>

What did you expect to happen?

This should report no error

What actually happened?

It reports vue/no-parsing-error and vue/valid-v-slot errors

Link to Minimal Reproducible Example

https://play.vuejs.org/#eNp9kTFPwzAQhf/KyUtBKskAU1WQCuoAAyBg9JIml9TFsS3bCZGq/HfOTlKIVHU7v/fZfvY7so0xSdsgW7G1y60wHhz6xjxwJWqjrYfNLofS6hoWSUpzgBdcrdOBJo4WHmsjM4+0AlgTFQcaJwPaGye1X+0xK65KrZNdZq9HCIAEIGHck85PC5fSNJPZknmXa1WKKjk4rSj9McCc5bo2QqJ9M15o5ThbQXSCl0mpf16i5m2Dy0nP95h/n9EPrgsaZ+8WHdoWOTt5PrMV+sHefr5iR/PJrHXRSKIvmB/otGxCxgF7bFRBsf9xMe1z7ECo6sttO4/KTY8KQQPZR54zauXpwtP/4t4md3EfVz394lhoaH/+64Vopw5DcaCyGu85m/XHGaRjRwM+76j/BUHHxIc=

Additional comments

I originally reported this in vuejs/eslint-plugin-vue#1229 (comment) and was suggested to report it here in vuejs/eslint-plugin-vue#1229 (comment) because of the vue/no-parsing-error lint.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions