Prefer breaking before dot instead of inside []
Open
Nobody has claimed this yet.
area:function calls
lang:javascript
- Dominant language
- JavaScript
- Stars
- 52.3k
- Forks
- 5k
- Avg merge
- 19h 2m
- Merged PRs (30d)
- 117
Description
Input:
myListHasALongName[someLongVariableName[sessionsIdx]]["specifier"].push({ content });
Output:
myListHasALongName[someLongVariableName[sessionsIdx]][
"specifier"
].push({
content
});
Expected behavior: Do not break code
Result:
error: Expected "[" and "]" to be on the same line (standard/computed-property-even-spacing) at
Any ideas how to disable this behavior?
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start from the issue's JavaScript/JSX input and compare the reported output with the requested break before the dot. Locate the formatter entry point and related line-breaking tests, then verify that the computed-property brackets stay together while the chain breaks at the preferred boundary.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100