Add `maxNesting` option to `object-curly-newline`.
See original GitHub issueConfiguration:
{
"rules": {
"object-curly-newline": [2, {
"multiline": true
}]
}
}
Following code consider error:
// test.js
const defaultConfig = {
endpoints: {
http: null
}
};
Result:
❯ eslint test.js
test.js
4:14 error Unexpected a line break after this open brace object-curly-newline
6:3 error Unexpected a line break before this close brace object-curly-newline
✖ 2 problems (2 errors, 0 warnings)
I suggest add maxNesting
option, which allows using linebreaks if object riches maxNesting
.
{ foo: { bar: {} } }
- nesting = 2{ foo: { bar: { baz: {} } } }
- nesting = 3
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:8 (5 by maintainers)
Top Results From Across the Web
object-curly-newline - ESLint - Pluggable JavaScript Linter
A pluggable and configurable linter tool for identifying and reporting on patterns in JavaScript. Maintain your code quality with ease.
Read more >Object Curly Spacing - Unibeautify
Config Key: object_curly_spacing ; Description: Inserts a space before/after brackets for object literals, destructuring assignments, and import/export ...
Read more >node_modules/eslint-plugin-react/CHANGELOG.md · master ...
jsx-key : added checkKeyMustBeforeSpread option for new jsx transform (#2835 @morlay) ... Add jsx-curly-newline rule (#1493 @golopot); Add support for nested ...
Read more >Rationale - Prettier
See object lists, nested configs, stylesheets and keyed methods, for example. ... And if you'd like to go multiline again, add in a...
Read more >ESLint v2.13.0 released - ESLint中文文档
This release adds some new features and fixes several bugs found in the previous ... 4f73240 Fix: object-curly-newline multiline with comments (fixes #6381) ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Sorry for so long delay. I’ve updated first message @platinumazure @vitorbal
Ping @nkt, we need more information before we can determine what sort of issue this is. Can you please answer @vitorbal’s question as well as @eslintbot’s questions? Thanks!