Skip to content

Dangling chained property #4094

@jasonkuhrt

Description

@jasonkuhrt

Prettier 1.11.1
Playground link

--print-width 75
--no-semi
--trailing-comma all
--use-tabs

Input:

    for (const edge of edges) {
      const adjacencyCount = edge.data.usersCount
      const otherBrandsWithThisAdjacencyCount = Object.values(edge.to.edges)
        .length
      edge.data.tdIdfScore = tfIdf(
        adjacencyCount,
        sumAdjacencyCounts,
        totalBrands,
        otherBrandsWithThisAdjacencyCount,
      )
    }

Output:

for (const edge of edges) {
	const adjacencyCount = edge.data.usersCount
	const otherBrandsWithThisAdjacencyCount = Object.values(edge.to.edges)
		.length
	edge.data.tdIdfScore = tfIdf(
		adjacencyCount,
		sumAdjacencyCounts,
		totalBrands,
		otherBrandsWithThisAdjacencyCount,
	)
}

Expected behavior:

Would have preferred:

for (const edge of edges) {
	const adjacencyCount = edge.data.usersCount
	const otherBrandsWithThisAdjacencyCount = 
          Object
              .values(edge.to.edges)
              .length
	edge.data.tdIdfScore = tfIdf(
		adjacencyCount,
		sumAdjacencyCounts,
		totalBrands,
		otherBrandsWithThisAdjacencyCount,
	)
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    area:member chainslang:javascriptIssues affecting JSlocked-due-to-inactivityPlease open a new issue and fill out the template instead of commenting.status:needs discussionIssues needing discussion and a decision to be made before action can be taken

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions