Vue-cli: tsx linting error with @vue/[email protected]

Created on 9 Jan 2019  路  2Comments  路  Source: vuejs/vue-cli

Version

3.2.0

Reproduction link

https://github.com/Dzinlife/vue-tsx-test

Environment info

Environment Info:

  System:
    OS: macOS 10.14.2
    CPU: (8) x64 Intel(R) Core(TM) i7-3635QM CPU @ 2.40GHz
  Binaries:
    Node: 10.12.0 - /usr/local/bin/node
    Yarn: yarn install v0.24.6
info No lockfile found.
[1/4] Resolving packages...
[2/4] Fetching packages...
[3/4] Linking dependencies...
[4/4] Building fresh packages...
success Saved lockfile.
Done in 17.57s. - /usr/local/bin/yarn
    npm: 6.4.1 - /usr/local/bin/npm
  Browsers:
    Chrome: 71.0.3578.98
    Firefox: 57.0
    Safari: 12.0.2
  npmPackages:
    @vue/babel-helper-vue-jsx-merge-props:  1.0.0-beta.1
    @vue/babel-plugin-transform-vue-jsx:  1.0.0-beta.1
    @vue/babel-preset-app:  3.3.0
    @vue/babel-preset-jsx:  1.0.0-beta.1
    @vue/babel-sugar-functional-vue:  1.0.0-beta.1
    @vue/babel-sugar-inject-h:  1.0.0-beta.1
    @vue/babel-sugar-v-model:  1.0.0-beta.1
    @vue/babel-sugar-v-on:  1.0.0-beta.1
    @vue/cli-overlay:  3.3.0
    @vue/cli-plugin-babel: ^3.3.0 => 3.3.0
    @vue/cli-plugin-eslint: ^3.3.0 => 3.3.0
    @vue/cli-plugin-typescript: ^3.3.0 => 3.3.0
    @vue/cli-service: ^3.3.0 => 3.3.0
    @vue/cli-shared-utils:  3.3.0
    @vue/component-compiler-utils:  2.5.0
    @vue/eslint-config-standard: ^4.0.0 => 4.0.0
    @vue/eslint-config-typescript: 3.2.0 => 3.2.0
    @vue/preload-webpack-plugin:  1.1.0
    @vue/web-component-wrapper:  1.2.0
    babel-helper-vue-jsx-merge-props:  2.0.3
    babel-plugin-transform-vue-jsx:  4.0.1
    eslint-plugin-vue:  4.7.1
    vue: ^2.5.21 => 2.5.21
    vue-class-component: ^6.3.2 => 6.3.2
    vue-eslint-parser:  2.0.3
    vue-hot-reload-api:  2.3.1
    vue-loader:  15.5.1
    vue-property-decorator: ^7.2.0 => 7.2.0
    vue-router: ^3.0.2 => 3.0.2
    vue-style-loader:  4.1.2
    vue-template-compiler: ^2.5.21 => 2.5.21
    vue-template-es2015-compiler:  1.6.0
    vuex: ^3.0.1 => 3.0.1
  npmGlobalPackages:
    @vue/cli: 3.2.1

Steps to reproduce

update to @vue/[email protected], tsx code linting failed

error: Parsing error: Unterminated regular expression literal

What is expected?

tsx linting correct on @vue/[email protected] and before, this error only happens on version 3.2.0

What is actually happening?

tsx code can't be parsing correct in vue render function

bug typescript

All 2 comments

My fault. Updating typescript-eslint-parser could be a breaking change. Our tests didn't cover this case because we expected people to use .tsx extension for such use cases rather than .vue.

The problem here is that typescript-eslint-parser v21 adds a feature that switches jsx option by filename, which, in this case, overrides the jsx flag set by plugin:vue/essential.

Fixed in @vue/[email protected]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eladcandroid picture eladcandroid  路  3Comments

wahidrahim picture wahidrahim  路  3Comments

OmgImAlexis picture OmgImAlexis  路  3Comments

miyamoto-san picture miyamoto-san  路  3Comments

sanderswang picture sanderswang  路  3Comments