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

v4.0.0 breaking changes #2330

Merged
merged 16 commits into from Aug 29, 2020
Merged

v4.0.0 breaking changes #2330

merged 16 commits into from Aug 29, 2020

Conversation

bradzacher
Copy link
Member

@bradzacher bradzacher commented Jul 27, 2020

BREAKING CHANGE:

This is just a PR to increase visibility of breaking changes that are will be merged for the upcoming 4.0.0 release.

We will rebase merge this PR into master to preserve the history.

These changes are available on NPM under the rc-v4 tag

Release notes:
https://github.com/typescript-eslint/typescript-eslint/releases/tag/v4.0.0-rc

@bradzacher bradzacher added the breaking change This change will require a new major version to be released label Jul 27, 2020
@bradzacher bradzacher added this to the 4.0.0 milestone Jul 27, 2020
@typescript-eslint
Copy link
Contributor

Thanks for the PR, @bradzacher!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@codecov
Copy link

codecov bot commented Jul 27, 2020

Codecov Report

Merging #2330 into master will decrease coverage by 0.21%.
The diff coverage is 90.11%.

@@            Coverage Diff             @@
##           master    #2330      +/-   ##
==========================================
- Coverage   93.16%   92.94%   -0.22%     
==========================================
  Files         287      289       +2     
  Lines        9186     9272      +86     
  Branches     2528     2583      +55     
==========================================
+ Hits         8558     8618      +60     
- Misses        301      320      +19     
- Partials      327      334       +7     
Flag Coverage Δ
#unittest 92.94% <90.11%> (-0.22%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...gin-internal/src/rules/no-poorly-typed-ts-props.ts 88.88% <ø> (ø)
packages/eslint-plugin/src/configs/all.ts 100.00% <ø> (ø)
packages/eslint-plugin/src/rules/ban-ts-comment.ts 95.45% <ø> (-0.20%) ⬇️
...int-plugin/src/rules/consistent-type-assertions.ts 86.48% <ø> (ø)
...es/eslint-plugin/src/rules/no-array-constructor.ts 100.00% <ø> (ø)
...kages/eslint-plugin/src/rules/no-empty-function.ts 77.14% <0.00%> (-6.65%) ⬇️
...ages/eslint-plugin/src/rules/no-empty-interface.ts 95.83% <0.00%> (-0.33%) ⬇️
...nt-plugin/src/rules/no-extra-non-null-assertion.ts 100.00% <ø> (ø)
...ges/eslint-plugin/src/rules/no-misused-promises.ts 100.00% <ø> (ø)
...ages/eslint-plugin/src/rules/no-require-imports.ts 100.00% <ø> (ø)
... and 44 more

@bradzacher
Copy link
Member Author

Just as a heads up - I was planning on merging this today, however due to the TS 4.0 release, we had to bump the version ranges.

I don't want to force people to do a major version upgrade to remove the console logs, so I'm going to delay this slightly.
So instead, I'll be looking to merge this next weekend (30th Aug)

…rror` to `allow-with-description` (#2351)

BREAKING CHANGE:

Default rule options is a breaking change.
Fixes #2146
BREAKING CHANGE:
- Removed decorators property from several Nodes that could never semantically have them (FunctionDeclaration, TSEnumDeclaration, and TSInterfaceDeclaration)
- Removed AST_NODE_TYPES.Import. This is a minor breaking change as the node type that used this was removed ages ago.
bradzacher and others added 7 commits August 29, 2020 10:59
…sions] add option to make the rules error on files without `strictNullChecks` turned on (#2345)
Fixes #2398

If the user has a particularly large node_modules folder and uses globs for `parserOption.project`, then the `glob` library can spend a decent chunk of time searching the `node_modules` folder.
In some cases, this can be on the order of hundreds to thousands of milliseconds.
This wouldn't be a problem, but for safety and correctness during a persistent parse, we have to do this check for every call to the parser (i.e. every file that's being linted).
Over a whole project, this can easily add up to many, many seconds wasted.

Previously, we:
- applied the project globs, one by one
- then manually excluded `tsconfig`s from the list.

This meant that we are always slow. I remember I did this because I had issues getting `glob`'s `ignore` option to work at all.

## The solution

`globby` is a better glob library:
- it accepts an array of globs, which saves us doing manual looping
- it supports exclusion globs (globs prefixed with `!`), which  are evaluated as part of the glob process
- it has caching built in by default

This allows us to evaluate all of the `project` globs at once, as opposed to one at a time (so should be less duplicated work).
This also allows us to evaluate the `projectFolderIgnoreList` at the same time as the `project` globs (so should be no useless work done).

All of these together should cut the glob evaluation time down to ~50ms for the first parse, and ~2ms for each parse after that (due to caching).
For comparison, previously, in bad cases we would spend ~3-500ms, per project, per parsed file.

Example to illustrate how much faster this can potentially be:
For a project that provides 2 globs and has 100 files.
Before: 300ms * 2 * 100 = 60,000ms (60s)
After: 50ms + 2 * 100 = 250ms

This should also save a non-trival amount of time in other, more optimal setups.

BREAKING CHANGE:
- removes the ability to supply a `RegExp` to `projectFolderIgnoreList`, and changes the meaning of the string value from a regex to a glob.
@bradzacher bradzacher merged commit 4ff8c43 into master Aug 29, 2020
@bradzacher bradzacher deleted the v4 branch August 29, 2020 22:11
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.