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

feat: stricter parent types for the AST #9560

Merged
merged 3 commits into from
Jul 14, 2024
Merged

Conversation

bradzacher
Copy link
Member

PR Checklist

Overview

Adds all the parent types specified in #6225 and fixes the resulting type and linting errors.
Pretty straightforward here!

@bradzacher bradzacher added the breaking change This change will require a new major version to be released label Jul 14, 2024
@bradzacher bradzacher added this to the 8.0.0 milestone Jul 14, 2024
@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.

Copy link

netlify bot commented Jul 14, 2024

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 70edf59
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/6694564551a07f00081a3ff3
😎 Deploy Preview https://deploy-preview-9560--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 96 (🔴 down 2 from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (no change from production)
PWA: 80 (no change from production)
View the detailed breakdown and full score reports

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

@bradzacher bradzacher removed the breaking change This change will require a new major version to be released label Jul 14, 2024
Copy link

codecov bot commented Jul 14, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 87.90%. Comparing base (6bd4211) to head (70edf59).
Report is 1 commits behind head on v8.

Additional details and impacted files
@@            Coverage Diff             @@
##               v8    #9560      +/-   ##
==========================================
- Coverage   87.91%   87.90%   -0.02%     
==========================================
  Files         397      397              
  Lines       13558    13554       -4     
  Branches     3939     3936       -3     
==========================================
- Hits        11920    11915       -5     
- Misses       1324     1326       +2     
+ Partials      314      313       -1     
Flag Coverage Δ
unittest 87.90% <100.00%> (-0.02%) ⬇️

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

Files Coverage Δ
...internal/src/rules/no-typescript-default-import.ts 86.66% <100.00%> (ø)
...t-plugin/src/rules/class-literal-property-style.ts 100.00% <100.00%> (ø)
.../eslint-plugin/src/rules/class-methods-use-this.ts 86.95% <ø> (ø)
.../eslint-plugin/src/rules/method-signature-style.ts 88.88% <ø> (+1.08%) ⬆️
...ges/eslint-plugin/src/rules/no-extraneous-class.ts 97.36% <100.00%> (ø)
packages/eslint-plugin/src/rules/no-misused-new.ts 100.00% <100.00%> (ø)
...s/eslint-plugin/src/rules/no-restricted-imports.ts 94.87% <100.00%> (ø)
...slint-plugin/src/rules/no-unnecessary-qualifier.ts 100.00% <100.00%> (ø)
...lint-plugin/src/rules/no-unsafe-enum-comparison.ts 100.00% <100.00%> (ø)
.../eslint-plugin/src/rules/no-useless-constructor.ts 100.00% <100.00%> (ø)

... and 1 file with indirect coverage changes

@bradzacher bradzacher linked an issue Jul 14, 2024 that may be closed by this pull request
37 tasks
Copy link
Member

@kirkwaiblinger kirkwaiblinger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smart

@kirkwaiblinger kirkwaiblinger added the 1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge label Jul 14, 2024
packages/types/src/ts-estree.ts Outdated Show resolved Hide resolved
packages/types/src/ts-estree.ts Outdated Show resolved Hide resolved
Copy link
Member

@Josh-Cena Josh-Cena left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you know how we can keep this exhaustive into the future, or is it just do-it-as-you-please?

@bradzacher
Copy link
Member Author

I think that it's probably going to be very difficult to keep it exhaustive.
We can probably write a script which scans the AST declaration to find the best parent lists though?

Once we've declared it to a great extent once it should be trivial to keep it updated with any future AST changes.

@bradzacher bradzacher merged commit 78fd2f4 into v8 Jul 14, 2024
61 of 63 checks passed
@bradzacher bradzacher deleted the v8-6225-stricter-parents branch July 14, 2024 23:55
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 23, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
1 approval >=1 team member has approved this PR; we're now leaving it open for more reviews before we merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhancement: add strict parent types for nodes that have well-defined parents
3 participants