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: add.kind toTSModuleDeclaration#6443

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

Merged
bradzacher merged 6 commits intomainfrom6440-add-kind-to-module-ast
Feb 10, 2023

Conversation

bradzacher
Copy link
Member

@bradzacherbradzacher commentedFeb 9, 2023
edited
Loading

PR Checklist

Overview

The primary change in this PR is the addition of the new.kind property toTSModuleDeclaration to help consumers identify what keyword was used to declare the module declaration.

With the addition of this property it also allowed me to provide better union types to clearly define when a module might be missing a body, have a string id, etc.

cc@fisker

@bradzacherbradzacher added the ASTPRs and Issues about the AST structure labelFeb 9, 2023
@nx-cloud
Copy link

nx-cloudbot commentedFeb 9, 2023
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commite020917. 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,@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 onhttps://opencollective.com/typescript-eslint.

@netlify
Copy link

netlifybot commentedFeb 9, 2023
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commite020917
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/63e5b1d7242c4e00085609e1
😎 Deploy Previewhttps://deploy-preview-6443--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.

@fisker
Copy link
Contributor

Love you, man.

@fisker
Copy link
Contributor

fisker commentedFeb 9, 2023
edited
Loading

I'm not familiar with TypeScript.

Just a reminder, do you knowModuleExpression?

Have you thought about how these two will work once TypeScript support it?

Should we wrap body inProgram? Or is it a "program"?

@bradzacher
Copy link
MemberAuthor

Yeah it's a "program".

Semantically there's a few declarations that aren't allowed inside of a TSModuleDeclaration that are allowed within a Program body. At some point we might make them syntax errors.

I assume that a module expression will be the same as a fully-fledged Program with no restrictions.

@fisker
Copy link
Contributor

I think "ModuleExpression" need update anywayestree/estree#238 (comment)

JoshuaKGoldberg
JoshuaKGoldberg previously approved these changesFeb 9, 2023
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Great! 🚀

}
if (id.type !== AST_NODE_TYPES.Identifier) {
throw new Error('`namespace`s must have an Identifier id');
}

Choose a reason for hiding this comment

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

I'll just note that#6247 adds an option to throw or not throw on these errors. Potential merge conflict in the making.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Yeah these errors are just there for fun tbh.
I actually could have left it all typed asany (which is whatconverChild returns). But I added slightly stricter checks just because.

But these constrains are all actually covered by syntax checks in TS itself so they won't ever get hit.

@bradzacher
Copy link
MemberAuthor

Also - this is waiting until your migration PR lands so I don't need to make changes to the old test infra.

JoshuaKGoldberg reacted with thumbs up emojiJoshuaKGoldberg reacted with laugh emoji

@codecov
Copy link

codecovbot commentedFeb 10, 2023
edited
Loading

Codecov Report

Merging#6443 (e020917) intomain (24fdfc8) willdecrease coverage by0.06%.
The diff coverage is52.94%.

Additional details and impacted files
@@            Coverage Diff             @@##             main    #6443      +/-   ##==========================================- Coverage   90.66%   90.61%   -0.06%==========================================  Files         371      371                Lines       12664    12677      +13       Branches     3722     3728       +6     ==========================================+ Hits        11482    11487       +5- Misses        845      853       +8  Partials      337      337
FlagCoverage Δ
unittest90.61% <52.94%> (-0.06%)⬇️

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

Impacted FilesCoverage Δ
packages/typescript-estree/src/convert.ts84.89% <52.94%> (-0.79%)⬇️

@bradzacherbradzacher merged commit2f948df intomainFeb 10, 2023
@bradzacherbradzacher deleted the 6440-add-kind-to-module-ast branchFebruary 10, 2023 03:05
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsFeb 18, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg left review comments

Assignees
No one assigned
Labels
ASTPRs and Issues about the AST structure
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AST change proposal: ImproveTSModuleDeclaration
3 participants
@bradzacher@fisker@JoshuaKGoldberg

[8]ページ先頭

©2009-2025 Movatter.jp