Skip to content

[2.5.0] still get Parsing error: '>' expected for Vue SFC (but Windows only?) #1133

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
GordonBlahut opened this issue Oct 23, 2019 · 1 comment
Labels
package: parser Issues related to @typescript-eslint/parser triage Waiting for team members to take a look

Comments

@GordonBlahut
Copy link

What code were you trying to parse?
Any Vue SFC.

e.g.

<template>
  <q-page :class="$screenStyles.pageClasses + ' column'" padding>
    <div class="flex items-stretch full-width" style="flex: 1 0 auto;">
      <div :class="['flex justify-center full-width', verticalCenter ? 'items-center': null]">
        <slot name="container-wrapper">
          <div class="container">
            <slot />
          </div>
        </slot>
      </div>
    </div>
  </q-page>
</template>

<script lang="ts">
import { Component, Prop, Vue, Watch } from "vue-property-decorator"

@Component
export default class AppPage extends Vue {
  @Prop({ default: false, type: Boolean })
  public verticalCenter!: boolean
}
</script>

What did you expect to happen?
Eslint to return lint warnings/errors including for .vue files.

What actually happened?

D:\WebClient\ClientApp\src\components\AppPage.vue
  16:14  error  Parsing error: '>' expected

for each .vue file with no other errors/warnings. .ts files are correctly handled.

This is only happening on Windows, same setup with same project on macOS returns expected results.

Not sure if it's possible that the recent improvements for vue SFCs in #1083 have a platform-specific issue?

Please let me know if there's anything else I can provide that would be helpful.

Versions

package version
@typescript-eslint/parser 2.5.0
TypeScript 3.6.4
ESLint 6.5.1
node 10.15.3
npm 6.9.0 (yarn 1.19.1)

.eslintrc.js

module.exports = {
  root: true,

  parserOptions: {
    parser: "@typescript-eslint/parser",
    sourceType: "module",
    // ecmaFeatures: {
    //   legacyDecorators: true
    // }
    project: "./tsconfig.json",
    extraFileExtensions: [
      ".vue"
    ],
  },

  env: {
    node: true
  },

  extends: [
    // https://github.com/vuejs/eslint-plugin-vue#priority-a-essential-error-prevention
    // consider switching to `plugin:vue/strongly-recommended` or `plugin:vue/recommended` for stricter rules.
    "eslint:recommended",
    "plugin:import/errors",
    "plugin:import/warnings",
    "plugin:import/typescript",
    "plugin:@typescript-eslint/recommended",
    "plugin:vue/essential"
  ],

  // required to lint *.vue files
  plugins: [
    "@typescript-eslint",
    "import",
    "vue",
  ],

  globals: {
    "ga": true, // Google Analytics
    "cordova": true,
    "__statics": true,
    "process": true
  },

  // add your custom rules here
  rules: {
    // allow async-await
    "generator-star-spacing": "off",
    // allow paren-less arrow functions
    "arrow-parens": "off",
    "comma-dangle": ["error", "always-multiline"],
    "one-var": "off",
    "import/first": "off",
    "import/named": "error",
    "import/namespace": "error",
    "import/default": "error",
    "import/export": "error",
    "import/extensions": "off",
    "import/no-unresolved": "off",
    "import/no-extraneous-dependencies": "off",
    "max-len": ["warn", { "code": 120 }],
    "no-trailing-spaces": "error",
    "indent": "off",
    // allow console.log during development only
    "no-console": process.env.NODE_ENV === "production" ? "error" : "off",
    // allow debugger during development only
    "no-debugger": process.env.NODE_ENV === "production" ? "error" : "off",
    "no-unused-vars": "off",
    "prefer-promise-reject-errors": "off",
    "quotes": "error",
    "semi": "off",
    "@typescript-eslint/explicit-function-return-type": "off",
    "@typescript-eslint/indent": ["error", 2],
    "@typescript-eslint/interface-name-prefix": "off",
    "@typescript-eslint/member-delimiter-style": ["warn", {
      "multiline": {
        "delimiter": "none"
      }
    }],
    "@typescript-eslint/no-explicit-any": "off",
    "@typescript-eslint/no-non-null-assertion": "off",
    "@typescript-eslint/no-unused-vars": ["warn", {
      "vars": "all",
      "args": "none",
      "ignoreRestSiblings": false,
    }],
    "@typescript-eslint/semi": ["error", "never"],
  }
}
@GordonBlahut GordonBlahut added package: parser Issues related to @typescript-eslint/parser triage Waiting for team members to take a look labels Oct 23, 2019
@GordonBlahut
Copy link
Author

GordonBlahut commented Oct 23, 2019

I tried out the canary release and it works as expected on Windows. I'm guessing the changes to paths in #1128 may have also fixed this.

So I guess there's nothing left to do here but use canary until next release.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
package: parser Issues related to @typescript-eslint/parser triage Waiting for team members to take a look
Projects
None yet
Development

No branches or pull requests

1 participant