Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

feat: made BaseNode.parent non-optional#5252

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg commentedJun 26, 2022
edited by bradzacher
Loading

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


PR Checklist

Overview

Doesn't quite makeBaseNode'sparent property generic (a good next step?), but does makeProgram's propertyparent?: 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 vianode.parent.

@nx-cloud
Copy link

nx-cloudbot commentedJun 26, 2022
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commit3d65e74. 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 💌 fromNxCloud.

@typescript-eslint
Copy link
Contributor

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 onhttps://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitorsper day.

@netlify
Copy link

netlifybot commentedJun 26, 2022
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit4d55ee6
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/63587377879d070009a38c1e
😎 Deploy Previewhttps://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 yourNetlify site settings.

* while traversing.
*/
// The parent node of the current node
// (added in @typescript-eslint/types as ESLint adds it while traversing)
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Switched to an inline// comment so the/** */ jsdoc comment doesn't risk getting attached totype.

@JoshuaKGoldbergJoshuaKGoldberg changed the titlefeat\!: made BaseNode.parent non-optionalfeat!: made BaseNode.parent non-optionalJun 26, 2022
export function getRange(
node: Pick<ts.Node, 'getEnd' | 'getStart'>,
ast: ts.SourceFile,
): [number, number] {
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Program-typed values were getting passed in here. Having thenodePick out the only methods it needs stopped some type errors.

bradzacher reacted with thumbs up emoji
@@ -390,7 +387,7 @@ export class Converter {
params: typeParameters.map(typeParameter =>
this.convertType(typeParameter),
),
};
} as TSESTree.TSTypeParameterDeclaration;
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Is there a reason this and the other node don't usethis.createNode?

@codecov
Copy link

codecovbot commentedJun 26, 2022
edited
Loading

Codecov Report

Merging#5252 (3d65e74) intov6 (9851338) willincrease coverage by0.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
FlagCoverage Δ
unittest91.67% <97.50%> (+0.03%)⬆️

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

Impacted FilesCoverage Δ
...int-plugin/src/rules/consistent-type-assertions.ts88.88% <ø> (ø)
packages/eslint-plugin/src/rules/indent.ts92.85% <ø> (ø)
...ackages/eslint-plugin/src/rules/no-explicit-any.ts96.42% <ø> (ø)
packages/eslint-plugin/src/rules/no-redeclare.ts91.89% <ø> (ø)
...plugin/src/rules/no-redundant-type-constituents.ts93.89% <ø> (ø)
.../eslint-plugin/src/rules/no-useless-constructor.ts94.73% <ø> (ø)
...ackages/eslint-plugin/src/rules/prefer-as-const.ts100.00% <ø> (ø)
...ckages/scope-manager/src/referencer/VisitorBase.ts88.23% <50.00%> (ø)
packages/eslint-plugin/src/rules/array-type.ts97.14% <100.00%> (ø)
...lugin/src/rules/consistent-generic-constructors.ts94.87% <100.00%> (ø)
... and32 more

@JoshuaKGoldbergJoshuaKGoldberg marked this pull request as ready for reviewJune 26, 2022 00:51
@bradzacherbradzacher added breaking changeThis change will require a new major version to be released ASTPRs and Issues about the AST structure labelsJul 2, 2022
@bradzacherbradzacher added this to the6.0.0 milestoneJul 2, 2022
@bradzacherbradzacher changed the titlefeat!: made BaseNode.parent non-optionalfeat: made BaseNode.parent non-optionalJul 2, 2022
Andaristand others added2 commitsOctober 25, 2022 19:59
…pescript-eslint#5036)* refactor(utils)!: removed `TRuleListener` generic from the `createRule`* refactor!: removed `TRuleListener` generic from the `CLIEngine` and `RuleCreateFunction`* chore: document and refactor 'extra' to 'parserSettings' (typescript-eslint#5834)* chore(website): fix renamed Sponsorship docs link (typescript-eslint#5882)* docs: Mention wide globs performance implications in monorepos docs and parser README (typescript-eslint#5864)* docs: Mention wide globs performance implications in monorepos docs and parser readme* Update docs/linting/typed-linting/MONOREPOS.mdCo-authored-by: Josh Goldberg <git@joshuakgoldberg.com>Co-authored-by: Josh Goldberg <git@joshuakgoldberg.com>Co-authored-by: Adnan Hashmi <56730784+adnanhashmi09@users.noreply.github.com>
…ipt-eslint#3076)* feat: update TSImportType node* fix: update visitor keys* chore: document and refactor 'extra' to 'parserSettings' (typescript-eslint#5834)* chore(website): fix renamed Sponsorship docs link (typescript-eslint#5882)* docs: Mention wide globs performance implications in monorepos docs and parser README (typescript-eslint#5864)* docs: Mention wide globs performance implications in monorepos docs and parser readme* Update docs/linting/typed-linting/MONOREPOS.mdCo-authored-by: Josh Goldberg <git@joshuakgoldberg.com>Co-authored-by: Josh Goldberg <git@joshuakgoldberg.com>Co-authored-by: Adnan Hashmi <56730784+adnanhashmi09@users.noreply.github.com>
@bradzacherbradzacher changed the base branch frommain tov6October 26, 2022 01:40
JoshuaKGoldbergand others added5 commitsOctober 25, 2022 23:12
* feat(scope-manager): ignore ECMA version* chore: document and refactor 'extra' to 'parserSettings' (typescript-eslint#5834)* chore(website): fix renamed Sponsorship docs link (typescript-eslint#5882)* Remove much more* Fix WebLinter lint* docs: Mention wide globs performance implications in monorepos docs and parser README (typescript-eslint#5864)* docs: Mention wide globs performance implications in monorepos docs and parser readme* Update docs/linting/typed-linting/MONOREPOS.mdCo-authored-by: Josh Goldberg <git@joshuakgoldberg.com>* chore: add auto-canary release for v6 (typescript-eslint#5883)Co-authored-by: Adnan Hashmi <56730784+adnanhashmi09@users.noreply.github.com>
…TSInterfaceDeclaration and TSModuleDeclaration (typescript-eslint#4863)* chore: remove invalid properties from ast nodes* chore: remove invalid code in scope-manager and typescript-estree* chore: re-write snapshots that were using invalid properties* feat: remove modifiers union from ast typesCo-authored-by: Juan García <juank1809@gmail.com>Co-authored-by: Josh Goldberg <git@joshuakgoldberg.com>
* chore(utils)\!: remove (ts-)eslint-scope types* Remove eslint-scope dep* More file deletions
# Conflicts:#packages/eslint-plugin/src/rules/prefer-nullish-coalescing.ts#packages/utils/package.json
Copy link
Member

@bradzacherbradzacher left a comment

Choose a reason for hiding this comment

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

keanubeautiful

@JoshuaKGoldbergJoshuaKGoldberg merged commita4768f3 intotypescript-eslint:v6Nov 25, 2022
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsDec 3, 2022
@JoshuaKGoldbergJoshuaKGoldberg deleted the base-node-parent-non-optional branchMarch 8, 2023 22:39
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@bradzacherbradzacherbradzacher approved these changes

@armano2armano2Awaiting requested review from armano2

Assignees
No one assigned
Labels
ASTPRs and Issues about the AST structurebreaking changeThis change will require a new major version to be released
Projects
None yet
Milestone
6.0.0
Development

Successfully merging this pull request may close these issues.

Reworking theparent property on AST Nodes
5 participants
@JoshuaKGoldberg@bradzacher@Andarist@armano2@juank1809

[8]ページ先頭

©2009-2025 Movatter.jp