Skip to content

tsx linting error with @vue/[email protected] #3268

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
Dzinlife opened this issue Jan 9, 2019 · 2 comments
Closed

tsx linting error with @vue/[email protected] #3268

Dzinlife opened this issue Jan 9, 2019 · 2 comments

Comments

@Dzinlife
Copy link

Dzinlife commented Jan 9, 2019

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

@LinusBorg LinusBorg added needs team repro We acknowledged your report and will soon try to reproduce it scope: typescript labels Jan 10, 2019
@haoqunjiang haoqunjiang added bug and removed needs team repro We acknowledged your report and will soon try to reproduce it labels Jan 21, 2019
@haoqunjiang
Copy link
Member

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.

@haoqunjiang
Copy link
Member

Fixed in @vue/[email protected]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants