Skip to content
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

Valid 'no-cycle' value #2250

Merged
merged 1 commit into from Jun 27, 2020

Conversation

boeric
Copy link

@boeric boeric commented Jun 21, 2020

With the just released eslint 7.3.0, the rule no-cycle's maxDepth value of Infinity is converted to null by eslint, which is invalid. This PR changes maxDepth from Infinity to Number.MAX_VALUE

Copy link
Collaborator

@ljharb ljharb left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See #2249. This is a valid value; it’s a bug in eslint v7.3.0. Stick to eslint v7.2 for now.

@boeric
Copy link
Author

boeric commented Jun 21, 2020

Ok, thanks for quick reply. Wonder if there is some kind of JSON.parse(JSON.stringify()) going on in 7.3.0, as a JSON value of Infinity is stringified out as null. Ran out of time to debug 7.3.0. But this is going to be a problem for a lot of people until a fix is available. Also wonder about the quality of the test suite of eslint as eslint-config-airbnb is becoming a bit of a standard

@ljharb
Copy link
Collaborator

ljharb commented Jun 21, 2020

Yes, that’s the exact bug - see #2246, #2245, and eslint/eslint#13427

@boeric
Copy link
Author

boeric commented Jun 21, 2020

@ljharb Thanks for the links. Will be closing this. Also, posted this FYI: eslint/eslint#13427 (comment)

@ljharb
Copy link
Collaborator

ljharb commented Jun 21, 2020

No need to close it; i'll repurpose it if eslint doesn't fix this quickly.

@boeric
Copy link
Author

boeric commented Jun 21, 2020

Ok @ljharb, I'll leave it as is

@davidjbradshaw
Copy link
Contributor

What's the objection to using Number.MAX_VALUE over Infinity? It has support all the way back to IE 4

@ljharb ljharb force-pushed the Fix-no-cycle-rule-for-eslint-7.3.0 branch from 13c3812 to 7e076c7 Compare June 23, 2020 05:56
@boeric
Copy link
Author

boeric commented Jun 23, 2020

Changed to Number.MAX_SAFE_INTEGER as per eslint/eslint#13427 (comment), and eslint/eslint#13435

@ljharb
Copy link
Collaborator

ljharb commented Jun 23, 2020

@boeric I'm not comfortable using that value. I'll force push this back to the final implementation, which will pass tests once eslint-plugin-import has a release.

@ljharb ljharb force-pushed the Fix-no-cycle-rule-for-eslint-7.3.0 branch from 9da160e to 7e076c7 Compare June 23, 2020 17:06
@boeric
Copy link
Author

boeric commented Jun 23, 2020

@ljharb what is specifically wrong with Number.MAX_SAFE_INTEGER? Also don't understand what = does. Sorry if silly questions...

@ljharb
Copy link
Collaborator

ljharb commented Jun 23, 2020

It's not an equals sign, it's an infinity sign. The next release of eslint-plugin-import will treat the same as Infinity.

@boeric
Copy link
Author

boeric commented Jun 23, 2020

@ljharb I need to upgrade my eye glasses... I see what you're doing, thanks. I'll be closing this PR

@ljharb
Copy link
Collaborator

ljharb commented Jun 23, 2020

@boeric please leave it open; i'll be merging it once eslint-plugin-import is released.

@boeric
Copy link
Author

boeric commented Jun 23, 2020

@ljharb Ok

@ljharb ljharb force-pushed the Fix-no-cycle-rule-for-eslint-7.3.0 branch from 7e076c7 to c5bee75 Compare June 27, 2020 20:39
@ljharb ljharb merged commit c5bee75 into airbnb:master Jun 27, 2020
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.

None yet

3 participants