typescript-eslint
typescript-eslint copied to clipboard
feat: made BaseNode.parent non-optional
BREAKING CHANGE: changes the AST types in a non-backwards compatible way.
PR Checklist
- [x] Addresses an existing open issue: fixes #1417
- [x] That issue was marked as accepting prs
- [x] Steps in CONTRIBUTING.md were taken
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.
☁️ 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
Node 14 - nx test @typescript-eslint/eslint-plugin --coverage=falseNode 18 - nx test @typescript-eslint/eslint-pluginnx run-many --target=lint --all --parallelNode 18 - nx test @typescript-eslint/type-utilsNode 18 - nx run-many --target=build --all --parallel --exclude website --exclude websiteNode 18 - nx test @typescript-eslint/utilsNode 18 - nx run-many --target=build --all --parallel --exclude website --exclude websiteNode 18 - nx test @typescript-eslint/typescript-estreeNode 18 - nx test @typescript-eslint/visitor-keysNode 18 - nx run-many --target=build --all --parallel --exclude website --exclude websiteNode 18 - nx run-many --target=build --all --parallel --exclude website --exclude websiteNode 18 - nx test @typescript-eslint/eslint-plugin-tslintNode 18 - nx run-many --target=build --all --parallel --exclude website --exclude websitenx run-many --target=typecheck --all --parallelNode 18 - nx test @typescript-eslint/scope-managerNode 18 - nx run-many --target=build --all --parallel --exclude website --exclude websiteNode 14 - nx test @typescript-eslint/scope-manager --coverage=falseNode 14 - nx test @typescript-eslint/typescript-estree --coverage=falseNode 14 - nx run-many --target=build --all --parallel --exclude website --exclude websiteNode 14 - nx run-many --target=build --all --parallel --exclude website --exclude websitenx run-many --target=build --all --parallel --exclude website --exclude websiteNode 14 - nx run-many --target=build --all --parallel --exclude website --exclude websitenx run-many --target=build --all --parallel --exclude website --exclude websiteNode 18 - nx test @typescript-eslint/parsernx run-many --target=build --all --parallel --exclude website --exclude websiteNode 18 - nx run-many --target=build --all --parallel --exclude website --exclude websiteNode 14 - nx test @typescript-eslint/ast-spec --coverage=falseNode 14 - nx run-many --target=build --all --parallel --exclude website --exclude websiteNode 14 - nx test @typescript-eslint/visitor-keys --coverage=falseNode 18 - nx test @typescript-eslint/ast-specNode 14 - nx test @typescript-eslint/eslint-plugin-tslint --coverage=falseNode 14 - nx test @typescript-eslint/type-utils --coverage=falseNode 14 - nx run-many --target=build --all --parallel --exclude website --exclude websiteNode 14 - nx run-many --target=build --all --parallel --exclude website --exclude websiteNode 14 - nx run-many --target=build --all --parallel --exclude website --exclude websiteNode 14 - nx test @typescript-eslint/utils --coverage=falseNode 18 - nx run-many --target=build --all --parallel --exclude website --exclude websiteNode 14 - nx test @typescript-eslint/parser --coverage=falseNode 14 - nx test @typescript-eslint/eslint-plugin-internal --coverage=falseNode 14 - nx run-many --target=build --all --parallel --exclude website --exclude websiteNode 14 - nx run-many --target=build --all --parallel --exclude website --exclude websiteNode 14 - nx run-many --target=build --all --parallel --exclude website --exclude websiteNode 18 - nx test @typescript-eslint/eslint-plugin-internalNode 18 - nx run-many --target=build --all --parallel --exclude website --exclude websiteNode 18 - nx run-many --target=build --all --parallel --exclude website --exclude websitenx run-many --target=build --all --parallel --exclude website --exclude websitenx run-many --target=build --all --parallel --exclude website --exclude website
Sent with 💌 from NxCloud.
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.
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...Use your smartphone camera to open QR code link. |
To edit notification comments on pull requests, go to your Netlify site settings.
Codecov Report
Merging #5252 (3d65e74) into v6 (9851338) will increase coverage by
0.03%. The diff coverage is97.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 |