typescript-eslint icon indicating copy to clipboard operation
typescript-eslint copied to clipboard

feat: made BaseNode.parent non-optional

Open JoshuaKGoldberg opened this issue 2 years ago • 4 comments

BREAKING CHANGE: changes the AST types in a non-backwards compatible way.


PR Checklist

Overview

Doesn't quite make BaseNode's parent property generic (a good next step?), but does make Program's property parent?: never.

I removed all checks like /if \(\w+\.parent/, /!\w+\.parent/, and /\w+\.parent ((&&)|(\|\|))/, then added back any that caused type checking complaints. Those were mostly from places that recursively went up the AST via node.parent.

JoshuaKGoldberg avatar Jun 26 '22 00:06 JoshuaKGoldberg

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 3d65e7424b99854e4429b290455c1db7abb8497d. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


✅ Successfully ran 47 targets

Sent with 💌 from NxCloud.

nx-cloud[bot] avatar Jun 26 '22 00:06 nx-cloud[bot]

Thanks for the PR, @JoshuaKGoldberg!

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.

typescript-eslint[bot] avatar Jun 26 '22 00:06 typescript-eslint[bot]

Deploy Preview for typescript-eslint ready!

Name Link
Latest commit 4d55ee69cc27bf3aaccb74d30a9dafa70b2af369
Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/63587377879d070009a38c1e
Deploy Preview https://deploy-preview-5252--typescript-eslint.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

netlify[bot] avatar Jun 26 '22 00:06 netlify[bot]

Codecov Report

Merging #5252 (3d65e74) into v6 (9851338) will increase coverage by 0.03%. The diff coverage is 97.50%.

Additional details and impacted files
@@            Coverage Diff             @@
##               v6    #5252      +/-   ##
==========================================
+ Coverage   91.64%   91.67%   +0.03%     
==========================================
  Files         358      358              
  Lines       12237    12232       -5     
  Branches     3591     3585       -6     
==========================================
  Hits        11214    11214              
+ Misses        721      719       -2     
+ Partials      302      299       -3     
Flag Coverage Δ
unittest 91.67% <97.50%> (+0.03%) :arrow_up:

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

Impacted Files Coverage Δ
...int-plugin/src/rules/consistent-type-assertions.ts 88.88% <ø> (ø)
packages/eslint-plugin/src/rules/indent.ts 92.85% <ø> (ø)
...ackages/eslint-plugin/src/rules/no-explicit-any.ts 96.42% <ø> (ø)
packages/eslint-plugin/src/rules/no-redeclare.ts 91.89% <ø> (ø)
...plugin/src/rules/no-redundant-type-constituents.ts 93.89% <ø> (ø)
.../eslint-plugin/src/rules/no-useless-constructor.ts 94.73% <ø> (ø)
...ackages/eslint-plugin/src/rules/prefer-as-const.ts 100.00% <ø> (ø)
...ckages/scope-manager/src/referencer/VisitorBase.ts 88.23% <50.00%> (ø)
packages/eslint-plugin/src/rules/array-type.ts 97.14% <100.00%> (ø)
...lugin/src/rules/consistent-generic-constructors.ts 94.87% <100.00%> (ø)
... and 32 more

codecov[bot] avatar Jun 26 '22 00:06 codecov[bot]