Line Length Issues - All the time
See original GitHub issueVersions:
prettier-eslint
version: 8.8.2node
version: 10.6.0npm
(oryarn
) version: 1.7.0
Have you followed the debugging tips?
Yes
Relevant code or config
function getHashDiffPromiseOf(type, model, nextHashData, blockNumber, transaction) {
return Promise.all(
Object.keys(nextHashData).map(value => applyHashDiffFor(
model,
{ [type]: value },
nextHashData[value],
blockNumber,
transaction,
)),
);
}
What I did:
Ran prettier-eslint
What happened:
It took a line that conforms to the eslint spec and breaks it:
function getHashDiffPromiseOf(type, model, nextHashData, blockNumber, transaction) {
return Promise.all(
Object.keys(nextHashData).map(value => applyHashDiffFor(model, { [type]: value }, nextHashData[value], blockNumber, transaction)),
);
}
I often find myself having to try to force prettier in these case but sometimes this isn’t really possible.
function getHashDiffPromiseOf(type, model, nextHashData, blockNumber, transaction) {
return Promise.all(
Object.keys(nextHashData).map(value => applyHashDiffFor(
// $ prettier dont break me! $ //
model,
{ [type]: value },
nextHashData[value],
blockNumber,
transaction,
)),
);
}
I strictly enforce 0 eslint errors on almost all of our projects so this is a constant problem for us 😦. Hoping its a straight forward fix!
Reproduction repository:
Not really needed, this type of things happens alll the time - I always find situations where its breaking this rule in some major way - often when it could easily get around it as well (like object call chains, etc).
"max-len": [
"error",
{
"code": 100,
"ignoreComments": true,
"ignoreStrings": true,
"ignoreTemplateLiterals": true
}
]
that is the max-len config i currently have.
Suggested solution:
When it is going to be a change that breaks eslint rules, it should not make any change
Issue Analytics
- State:
- Created 5 years ago
- Reactions:50
- Comments:9 (1 by maintainers)
Top GitHub Comments
What did end up working for me is adding `“implicit-arrow-linebreak”: “off”.
This appears to be an ESLint bug.
Stale issue