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

chore: use named import forutil#7669

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

Conversation

antfu
Copy link
Contributor

@antfuantfu commentedSep 18, 2023
edited
Loading

PR Checklist

(sorry for sending this PR without an issue, as I consider it a straightforward refactor)

Overview

Currently, we are mixing the usage for* as util and named import in different rules (and even both in the same file).

I think named import is a generally better syntax as it enables tree-shaking, improves overall consistency, and would helphttps://github.com/eslint-stylistic/eslint-stylistic to migrate away those formatting rules (we want tree-shaking to avoid bundling all utils again).

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@antfu!

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 commentedSep 18, 2023
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commit05b5cab
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/65265ff2969e2c000765c7c0
😎 Deploy Previewhttps://deploy-preview-7669--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 (no change from production)
Accessibility: 100 (no change from production)
Best Practices: 92 (no change from production)
SEO: 98 (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 yourNetlify site configuration.

@nx-cloud
Copy link

nx-cloudbot commentedSep 18, 2023
edited
Loading

☁️ Nx Cloud Report

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

📂 See all runs for this CI Pipeline Execution


✅ Successfully ran 19 targets

Sent with 💌 fromNxCloud.

@antfuantfu changed the titlerefactor: use named export forutilchore(refactor): use named export forutilSep 18, 2023
@antfuantfu changed the titlechore(refactor): use named export forutilchore: use named export forutilSep 18, 2023
@antfuantfu changed the titlechore: use named export forutilchore: use named import forutilSep 18, 2023
@antfu
Copy link
ContributorAuthor

antfu commentedSep 18, 2023
edited
Loading

The failing tests seem to be inherited from the main bench.

@JoshuaKGoldberg
Copy link
Member

as it enables tree-shaking

We never use dynamic lookups, so shouldn't bundlers be able to tree shake them? This feels like an issue with bundlers not supporting a very reasonable style IMO.

@antfu
Copy link
ContributorAuthor

Well, to my surprise,rollup does tree-shake well (but I guess you need to be careful not reference the object entirely, it's not a concern with the current codebase).

Then, I think the issue would fall into mainly consistency/preferences. In that case, I don't have strong opinions over which.

JoshuaKGoldberg reacted with thumbs up emojiarmano2 reacted with thumbs down emoji

@Josh-Cena
Copy link
Member

I prefer named imports. The nameutil by itself doesn't add much info.

@JoshuaKGoldberg
Copy link
Member

@typescript-eslint/triage-team I'm up for merging this as-is (so, moving to named imports), for consistency's sake and because tree shaking can be complex sometimes even when everything is configured well. Any objections?

JoshuaKGoldberg
JoshuaKGoldberg previously approved these changesOct 10, 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.

Approving knowing that we might have to clean some stuff up after merging frommain.

@JoshuaKGoldbergJoshuaKGoldberg added the 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelOct 10, 2023
JamesHenry
JamesHenry previously approved these changesOct 10, 2023
@JamesHenry
Copy link
Member

Thanks@antfu!

Josh-Cena
Josh-Cena previously approved these changesOct 10, 2023
type,
ts.TypeFlags.Undefined,
);
const typeIncludesNull =util.isTypeFlagSet(
const typeIncludesNull =tsutils.isTypeFlagSet(
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldbergOct 10, 2023
edited
Loading

Choose a reason for hiding this comment

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

Aha! A behavior change. Might be from a merge. I'll fix.

Confusingly, the twoisTypeFlagSet functions aren't the same.

@JoshuaKGoldbergJoshuaKGoldberg dismissed stale reviews fromJosh-Cena,JamesHenry, and themself viad683758October 10, 2023 21:04
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.

I got through oneutil.isTypeFlagSet ->tsutils.isTypeFlagSet swap, but it looks like there are still a few more. Requesting changes on fixing that up please. Onceyarn lint passes I think we'll be good to go!

@JoshuaKGoldbergJoshuaKGoldberg added awaiting responseIssues waiting for a reply from the OP or another party and removed 1 approval>=1 team member has approved this PR; we're now leaving it open for more reviews before we merge labelsOct 10, 2023
@antfu
Copy link
ContributorAuthor

Should be good now :)

@JoshuaKGoldbergJoshuaKGoldberg merged commitafee34c intotypescript-eslint:mainOct 11, 2023
@JoshuaKGoldbergJoshuaKGoldberg removed the awaiting responseIssues waiting for a reply from the OP or another party labelOct 11, 2023
@JoshuaKGoldberg
Copy link
Member

Thanks!

@antfuantfu deleted the refactor/util-export branchOctober 11, 2023 11:35
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsOct 19, 2023
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@armano2armano2armano2 left review comments

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg requested changes

@JamesHenryJamesHenryJamesHenry left review comments

@Josh-CenaJosh-CenaJosh-Cena left review comments

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@antfu@JoshuaKGoldberg@Josh-Cena@JamesHenry@armano2

[8]ページ先頭

©2009-2025 Movatter.jp