Skip to content

Conversation

@romansp
Copy link
Contributor

@romansp romansp commented Sep 8, 2025

Description

PR switches to ecmaVersion: 'latest' per recommendation from eslint documentation https://eslint.org/docs/latest/use/configure/language-options#specifying-javascript-options.

In most cases, we recommend using the default of "latest" to ensure you’re always using the most recent ECMAScript version.

For example current value of ecmaVersion: 2022 doesn't support import attributes which prevents eslint from parsing file when such import is encountered. This can be demonstrated in eslint's playground. Playground shows Parsing error: Unexpected token with when Unexpected var, use let or const instead should be displayed instead.

Few notes:

  1. First I thought about using a fixed 2025 or even 2026 version but I guess we'll be still chasing similar issues each time new syntax gets added. With latest config stays in sync with what version of parser eslint ships.
  2. Even though latest is default when config is omitted still thought it would be clearer to set it explicitly to latest.

Linked Issues

Discord conversation: https://discord.com/channels/937808017016119440/937977751472840704/1413393048817373245

Additional context

Not sure if this is a breaking change? Most likely not.

@netlify
Copy link

netlify bot commented Sep 8, 2025

Deploy Preview for melodious-froyo-4871f8 ready!

Name Link
🔨 Latest commit 04cbc65
🔍 Latest deploy log https://app.netlify.com/projects/melodious-froyo-4871f8/deploys/68be68ea0d74be0008fe111c
😎 Deploy Preview https://deploy-preview-756--melodious-froyo-4871f8.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@antfu antfu merged commit 2031bf7 into antfu:main Sep 8, 2025
4 checks passed
@romansp romansp deleted the use-ecmaVersion-latest branch September 8, 2025 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants