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
Docs: deprecate experimentalObjectRestSpread #9986
Merged
Merged
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree that we should deprecate the option, but I'm not sure it would be a good idea to remove the option in 5.0.0. There are a lot of configs that use it now, so it might be better not to break those configs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hm.
I understand your sight, but the migration is not hard. I don't think that we should be afraid the change in a major version up. This removing means we remove experimental node types
ExperimentalRestProperty
andExperimentalSpreadProperty
. It would be valuable to the plugin ecosystem since we can simplify confusing rest/spread node types.@eslint/eslint-team What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe another solution would be to make the
experimentalObjectRestSpread
option generateRestElement
andSpreadElement
nodes rather thanExperimentalRestProperty
andExperimentalSpreadProperty
, so that rules would only need to deal with one node type.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the least confusing option is to remove it in the next major release. I'm all for removing one-off syntax enabling features in favor of real language versions. However, I'm also slightly concerned with the pain this could cause.
It seems unlikely, but what if someone has their config setup so that they're writing, say, ES6 and are using object rest/spread but don't want to allow other ES6+ syntax (using Babel)? Removing this option would force them to update the
ecmaVersion
to keep linting their codebase, I think?Again, seems like an unlikely case. I'm fine with breaking changes, but want to make sure everyone has a clear upgrade path.
These one-off syntax features are proving to be pretty difficult to work with!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, that's a solution. Though I am still thinking better to remove
experimentalObjectRestSpread
option...We have done similar change in 2.0.0: https://eslint.org/docs/user-guide/migrating-to-2.0.0#language-options. In that case, some users asked a way to disable syntactic features that Node.js doesn't support. Our answer was "
node/no-unsupported-feature
reports the syntax you cannot use in specific Node version."Anyway, I believe we should remove
experimentalObjectRestSpread
as soon as possible because:experimentalObjectRestSpread
has a bug about duplication check for ES modules. I really want to remove the double management.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the in-depth response. I think I'm leaning towards removal in v5.0.0 as well, given the points made by @mysticatea.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My concern is that there are an extremely large number of users relying on
experimentalObjectRestSpread
right now, and if we remove it then almost all of those users will get parsing errors after upgrading. To fix the errors will need to figure out what's going on and how to update their configs. It might be particularly confusing for people who are using shareable configs, because they might not even be aware that they were relying on experimental features.In the past, we've tried to minimize the number of "required config changes" that users need to make in order to upgrade. I think it could cause significant problems for users if we remove the property without having it deprecated for awhile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, I'll open another issue to decide removal timing. This issue focuses on showing the depreciation to users.