ESLint v7.4.0 released

by Kai Cataldo - 3 July 2020

We just pushed ESLint v7.4.0, which is a minor release upgrade of ESLint. This release adds some new features and fixes several bugs found in the previous release.

Highlights

Shortly after the v7.3.0 release, we received an issue that eslint-config-airbnb was breaking because it used Infinity in a rule config. Infinity should have been forbidden by the rule's option schema, but a bug in Ajv, the JSON schema validator that ESLint uses, incorrectly allowed Infinity when an integer was specified. This was finally caught because the v7.3.0 release included a change that fixed an unrelated issue by serializing rule configs. ESLint expects rule configs to be JSON-serializable for consistency between all supported JSON, YAML, and JS .eslintrc formats, and it relies on this property in the --cache and --print-config command line options.

Updating eslint-config-airbnb to use Number.MAX_SAFE_INTEGER instead of Infinity is the ideal solution but would have taken too long. Since this was the only reported issue and isolated to eslint-config-airbnb rather than end-user configs, we implemented an exception that replaced Infinity with Number.MAX_SAFE_INTEGER and released it in v7.3.1, which allowed us to preserve the unrelated bug fix.

After the v7.3.1 release, we received another issue that an eslint-plugin-unicorn rule was directing users to use regular expression instances, which are not JSON-serializable. Unlike eslint-config-airbnb, where the non-serializable value was isolated to a single dependency, end user configs for eslint-plugin-unicorn include regular expressions, so fixing all of them is not practical.

We're therefore reverting the original change for the v7.4.0 release and will be finding another solution. This will unblock regular linting for users whose rule configs include non-JSON-serializable values, though the --cache and --print-config command line options may exhibit undefined behavior in those cases. A future major version of ESLint will enforce that rule configs contain only JSON-serializable values, and we anticipate that enhancements to RuleTester will help rule authors prepare their schemas for that.

Enhancements

Bug Fixes

Documentation