v4.0.0
4.0.0 (2020-08-31)
This release comes just a few months after the v3 release due to the much faster than expected turnaround on optional chaining by ESTree. Read on for more details!
Summary of Changes
Breaking:
- feat: support new ESTree optional chaining representation (#2308) (a4bd2a815447867132ce1f6dda574e608834b794)
- feat: consume new scope analysis package (#2039) (abb0617e7cda636064193c65c73f8f8c08d8cb56)
- feat(eslint-plugin): [ban-ts-comment] change default for
ts-expect-error to allow-with-description (#2351) (ef85b7b92cf7b83e708bc85b58baca295955d5c8)
- feat(eslint-plugin): [typedef] remove all default options (#2352) (13bd4dd11fc478a18a70e9e71853f099f0833330)
- fix: correct decorator traversal for AssignmentPattern (#2375) (5ab473c07d43da70ddf8827efc8678c376fb15ab)
- feat(eslint-plugin): [no-unnecessary-condition][strict-boolean-expressions] add option to make the rules error on files without
strictNullChecks turned on (#2345) (ee5b194e6cb813e8aed0f2889b51d12a2b6964e4)
- feat(typescript-estree): switch to globby (#2418) (789c439a8a80d1c3dc5d6c7ca4c5ae4d1d889a5b)
Non-Breaking:
- feat(eslint-plugin): add
consistent-type-imports rule (#2367) (ba9295b774765c293c94c5e82c26804ded25180d)
- feat: add
downlevel-dts to all packages with type declarations (a25718358e2c198e387a79d7f175baaa951ad547)
- feat(eslint-plugin): add extension rule
@typescript-eslint/no-redeclare (#2039) (abb0617e7cda636064193c65c73f8f8c08d8cb56)
- feat(eslint-plugin): add extension rule
@typescript-eslint/no-shadow (#2039) (abb0617e7cda636064193c65c73f8f8c08d8cb56)
Breaking Changes
AST Changes
Support official ESTree optional chaining syntax (#2204)
When TS 3.7 released with optional chaining in November 2019, the feature was still a Stage-3 TC39 spec. This meant that ESTree[1] did not yet have an official AST representation defined, as they only officially support Stage-4 specs.
This meant that we either had to block on TS 3.7 support, unofficially support optional chaining, or find an interim representation to use. As we had no clear timeframe around which both optional chaining would move to Stage-4, and when the ESTree AST for it would be defined, we decided the first two options were sub-optimal, and instead chose to the existing babel-eslint AST representation. This representation has been in the ecosystem for a while and was supported by a variety of plugins.
Recently, ESTree agreed upon and merged an AST for optional chaining, which is vastly different to babel-eslint's representation. ESLint and their parser espree have already implemented and released support for this new AST as of ESLint v7.5.0.
In order to correct course to match the future of the ecosystem, we've update our AST to match the new, official representation.
This means a few things right now:
- The ESLint core rules will have complete support for optional chaining, without need for extension rules 🎉
- you will need to upgrade to at least ESLint 7.5.0 in order to have support in lint rules
- Users might have to wait for plugins outside this project to update their logic to support this new AST.
Going forward, we're trying to be a bit more conservative with our choice of AST representation to help prevent this migration pain, at the cost of not being able to write lint rules for new features.
[1] ESTree is the AST representation used in the ESLint ecosystem (amongst other things). It's collectively governed by a number of projects. https://github.com/estree/estree/
... (truncated)