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
Config json cloning is a BREAKING CHANGE! #13447
Comments
You can try regex in string ? in your case, like ignore: [ '^FOOBAR\\.js$', ['^FOOBAR\\.js$', 'i'] ] but yeah , this was a breaking change. |
what do you think revert the change? we can reconsider introducing it in a major release(eslint v8) |
I did mention that earlier, #13034 (comment). +1 for that |
I personally think this change should be reverted (even though I understand it was considered a bug fix, because the intention was always to have ESLint configs be serializable). @eslint/eslint-tsc I know there was other discussion of this while I was on vacation. Would someone like to fill us in on what the final decision was? |
The discussion was to wait and see how many bug reports we received before deciding whether to revert or not. We had just one report of the use of This case is more concerning because it involves encouraging end users to use regular expressions in their configs (vs one isolated instance of With this new data, I’m in favor of reverting the change. |
well, seems we have reached a consensus to revert it. will make a PR later! |
@btmills @mysticatea Would love to hear your opinions as well :) |
👍 for reverting. |
Agreed with @nzakas - this is the sort of end-user case we were looking for that would indicate we need to revert. A couple things we could do in addition to reverting:
|
Note that the cloning isn't the issue; it's using JSON to clone that's the issue. A proper deep cloning algorithm would work fine and preserve the fix that cloning originally solved. |
Marking as accepted since the entire TSC is in favor of reverting. |
@ljharb Yeah, that was also explored. I believe the reason that implementation was not chosen was due to challenges with potential circular references. |
@kaicataldo yeah, that gets tricky, but i'd expect that to be handleable with a WeakMap, and mapping "original object" to "cloned object", prior to iterating over the original object to clone copies into the cloned object, and always looking up a cloned object in the map before creating a new one. |
similar to #13034 (comment) ? |
Related: #13034 (comment)
Tell us about your environment
What parser (default, Babel-ESLint, etc.) are you using?
eslint-mdx
Please show your full configuration:
Configuration
What did you do? Please include the actual source code causing the issue, as well as the command that you used to run ESLint.
<!-- README.md -->
What did you expect to happen?
no error
What actually happened? Please include the actual, raw output from ESLint.
The error occurres because the ESLint config is json cloned since v7.3.0, and this breaks
Regxp
option ofunicorn/filename-case
, I don't think this is an invalid usage.The text was updated successfully, but these errors were encountered: