Question: do you enforce multiline new lines for destructuring?
- Dominant language
- JavaScript
- Stars
- 148k
- Forks
- 26.6k
- PR merge metrics
- No merged PRs in 30d
Description
We are having a debate around whether the AirBnB guidelines for object-curly-newline (10.8) should affect destructuring or not, particularly for props.
Example:
```javascript
// Good
export default function myComponent({ prop1, prop2, prop3 }) { ... }
export default function myComponent({
prop1, prop2, prop3,
}) { ... }
export default function myComponent({
prop1,
prop2,
prop3,
}) { ... }
// Is this bad?
export default function myComponent({
prop1, prop2,
prop3,
}) { ... }
// Good
const { env1, env2, env3 } = process.env;
// Is this bad?
const {
env1, env2,
env3,
} = process.env;
```
We know eslint does not support this at all (and have chosen not to), so if we want to do it we have to use prettier or [eslint-plugin-putout](https://github.com/coderaiser/putout/tree/master/packages/eslint-plugin-putout). We are curious if AirBnB standards have been defined for this circumstance? There has been many discussions around whether rules 7.15 and 10.8 were intended to affect this.
Many thanks for your time. I apologize if this was answered elsewhere, couldn't seem to find it.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by reviewing the AirBnB style-guide guidance referenced as rules 7.15 and 10.8, along with the issue's examples for object destructuring and props. Compare the stated behavior with ESLint, Prettier, and eslint-plugin-putout; done would be a decided, documented standard for these cases.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- eslint, javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100