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

Don't report user-definedcreateApp function invue/one-component-per-file#2203

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

Draft
candy-Tong wants to merge6 commits intovuejs:master
base:master
Choose a base branch
Loading
fromcandy-Tong:master

Conversation

candy-Tong
Copy link

No description provided.

@candy-Tongcandy-Tongforce-pushed themaster branch 2 times, most recently fromed050e9 to257c814CompareJune 1, 2023 08:54
Copy link
Member

@FloEdelmannFloEdelmann left a comment

Choose a reason for hiding this comment

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

Thanks for implementing a fix! I have one comment, see below :)

@FloEdelmannFloEdelmann changed the titlefix: [one-component-per-file] do not check createApp function written by the developer #2201Don't report user-definedcreateApp function invue/one-component-per-fileJun 5, 2023
Copy link
Member

@FloEdelmannFloEdelmann left a comment

Choose a reason for hiding this comment

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

Looks good to me now, thanks :)

@@ -2536,6 +2537,31 @@ function getVueComponentDefinitionType(node) {
if (callee.name === 'createApp') {
// for Vue.js 3.x
// createApp({})

const variable = findVariable(context.getScope(), callee)
Copy link
Member

Choose a reason for hiding this comment

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

Sorry for the late reply. I am busy with office work.

I think it can be written more simply usingtracker.iterateEsmReferences.

https://eslint-community.github.io/eslint-utils/api/scope-utils.html#tracker-iterateesmreferences

e.g.

consttracker=newReferenceTracker(context.getSourceCode().scopeManager.globalScope)consttraceMap=utils.createCompositionApiTraceMap({[ReferenceTracker.ESM]:true,createApp:{[ReferenceTracker.CALL]:true}})if([...tracker.iterateEsmReferences(traceMap)].every(({ node})=>node!==callee)){returnnull;}

Copy link
Member

Choose a reason for hiding this comment

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

@candy-Tong Would you like to give this a try?

@ota-meshiota-meshi marked this pull request as draftJanuary 30, 2024 14:24
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@FloEdelmannFloEdelmannFloEdelmann approved these changes

@ota-meshiota-meshiota-meshi requested changes

Requested changes must be addressed to merge this pull request.

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

Successfully merging this pull request may close these issues.

[one-component-per-file] do not check createApp function written by the developer
3 participants
@candy-Tong@FloEdelmann@ota-meshi

[8]ページ先頭

©2009-2025 Movatter.jp