meteorlxy / eslint-plugin-prettier-vue

:ok_hand: ESLint plugin for Prettier formatting, which is better for Vue SFC
MIT License
115 stars 9 forks source link

Parsing error: '=' expected #9

Closed petr-motejlek closed 3 years ago

petr-motejlek commented 4 years ago

Hey,

I recently stumbled upon this project, trying to get our TypeScript+Vue project working with ESLint and Prettier, including a reasonable subset of Prettier+Vue ESLint rules.

eslint-plugin-prettier-vue does seem to work at first glance, however, there are a couple instances where it is having trouble parsing our templates, it seems.

Examples

<template>
  <v-row>
    <v-col
      v-if="show"
      xl="4"<!-- vue-prettier/vue complains about expecting '=' here; not sure why -->
    >
   ...
<template>
  <loading :is-loading="isLoading">
    <v-card>
      <v-card-title>
        <h1 v-show="controller.$isNotFound">
          <v-icon left><!-- "v-icon" is underlined with the same error -->
            close
           ...
<template>
  <loading :is-loading="isLoading">
    <v-card>
      <v-card-title>
        <h1 v-show="controller.$isNotFound">
          <v-icon left>
            close<!-- "close" is underlined and the same error is reported there -->

I've cut the examples down, but I think the erroneous places are quite well visible there. It seems to me like the "v-*" directives might be throwing something off. Not sure what, though.

Here's an excerpt from our package.json's ESLint section

  "eslintConfig": {
    "parser": "vue-eslint-parser",
    "extends": [
      "plugin:@typescript-eslint/recommended",
      "plugin:vue/recommended",
      "plugin:prettier-vue/recommended"
    ],
    "settings": {
      "prettier-vue": {
        "SFCBlocks": {
          "template": false
        }
      }
    },
    "env": {
      "node": true,
      "es6": true
    },
    "parserOptions": {
      "parser": "@typescript-eslint/parser",
      "ecmaVersion": 2019,
      "sourceType": "module"
    },
    "rules": {}
  },

Cheers!

meteorlxy commented 4 years ago

Sorry for delay. However I cannot reproduce your issue. Could you please provide a reproduce repo?

petr-motejlek commented 4 years ago

Hi there. I will certainly try.

meteorlxy commented 3 years ago

Closing as no feedback yet.