Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update JS env and remove or update parserOptions.ecmaVersion #1991

Closed
@jonaskuske

Description

@jonaskuske

Tell us about your environment

  • ESLint version: 8.24.0
  • eslint-plugin-vue version: 9.5.1
  • Node version: 16.14.2

The problem you want to solve.

Currently,eslint-plugin-vue configures bothenv andparserOptions.ecmaVersion in its base config, with different ECMA versions – 2015 (ES6) and 2020:

ecmaVersion:2020,
sourceType:'module'
},
env:{
browser:true,
es6:true

Thees6 env means that globals that were added after 2015 can't be used without errors, likeBigInt,globalThis orWeakRef.

parser.ecmaVersion: 2020 means that parsing breaks on features like dynamic import or nullish assignments.

env automatically sets the version for the parser, but since this plugin explicitly configures the parser version in addition toenv, that doesn't work anymore when users change the env in their config. So if users specifyes2022: true as their env, the parser willnot automatically switch to 2022 syntaxas described in the ESLint docs but keep its 2020 config and continue to break on newer syntax.

Your take on the correct solution to problem.

  1. Bump the version for the supported JS environment toes2022 (latest). Or, if the outdated version config for the parser is intentional for compat, set the environment toes2020 to align it with the parser version.

  2. Either remove theparserOptions.ecmaVersion setting so it is automatically inferred fromenv, or set it tolatest so the parser won't get in the way.

Additional context

Here's a repro repo:https://github.com/jonaskuske/vue-eslint-repro

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


      [8]ページ先頭

      ©2009-2025 Movatter.jp