Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deactivated new line per chained call rule #82

Merged
merged 1 commit into from
Jan 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 6 additions & 13 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion rules/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ module.exports = {
// Note: disable because we are using `padding-line-between-statements`
'newline-before-return': 0,
// Require a newline after each call in a method chain
'newline-per-chained-call': [2, { 'ignoreChainWithDepth': 2 }],
'newline-per-chained-call': 0,
// Disallow Array constructors
'no-array-constructor': 2,
// Disallow bitwise operators
Expand Down
70 changes: 32 additions & 38 deletions test/__snapshots__/index.spec.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -1471,201 +1471,195 @@ Array [
"rule": "padding-line-between-statements",
"severity": 2,
},
Object {
"column": 53,
"line": 759,
"rule": "newline-per-chained-call",
"severity": 2,
},
Object {
"column": 15,
"line": 768,
"line": 765,
"rule": "no-array-constructor",
"severity": 2,
},
Object {
"column": 15,
"line": 781,
"line": 778,
"rule": "no-bitwise",
"severity": 2,
},
Object {
"column": 5,
"line": 814,
"line": 811,
"rule": "no-lonely-if",
"severity": 2,
},
Object {
"column": 19,
"line": 829,
"line": 826,
"rule": "no-mixed-operators",
"severity": 2,
},
Object {
"column": 23,
"line": 829,
"line": 826,
"rule": "no-mixed-operators",
"severity": 2,
},
Object {
"column": 1,
"line": 852,
"line": 849,
"rule": "no-multiple-empty-lines",
"severity": 2,
},
Object {
"column": 15,
"line": 874,
"line": 871,
"rule": "no-nested-ternary",
"severity": 2,
},
Object {
"column": 44,
"line": 874,
"line": 871,
"rule": "no-nested-ternary",
"severity": 2,
},
Object {
"column": 15,
"line": 897,
"line": 894,
"rule": "no-new-object",
"severity": 2,
},
Object {
"column": 5,
"line": 913,
"line": 910,
"rule": "no-plusplus",
"severity": 2,
},
Object {
"column": 19,
"line": 958,
"line": 955,
"rule": "no-unneeded-ternary",
"severity": 2,
},
Object {
"column": 19,
"line": 972,
"line": 969,
"rule": "no-whitespace-before-property",
"severity": 2,
},
Object {
"column": 15,
"line": 1012,
"line": 1009,
"rule": "object-curly-spacing",
"severity": 2,
},
Object {
"column": 20,
"line": 1012,
"line": 1009,
"rule": "object-curly-spacing",
"severity": 2,
},
Object {
"column": 15,
"line": 1024,
"line": 1021,
"rule": "object-property-newline",
"severity": 2,
},
Object {
"column": 9,
"line": 1048,
"line": 1045,
"rule": "one-var",
"severity": 2,
},
Object {
"column": 14,
"line": 1081,
"line": 1078,
"rule": "operator-linebreak",
"severity": 2,
},
Object {
"column": 30,
"line": 1093,
"line": 1090,
"rule": "padded-blocks",
"severity": 2,
},
Object {
"column": 5,
"line": 1097,
"line": 1094,
"rule": "padded-blocks",
"severity": 2,
},
Object {
"column": 9,
"line": 1112,
"line": 1109,
"rule": "quote-props",
"severity": 2,
},
Object {
"column": 15,
"line": 1128,
"line": 1125,
"rule": "quotes",
"severity": 2,
},
Object {
"column": 23,
"line": 1144,
"line": 1141,
"rule": "semi",
"severity": 2,
},
Object {
"column": 17,
"line": 1155,
"line": 1152,
"rule": "semi-spacing",
"severity": 2,
},
Object {
"column": 17,
"line": 1184,
"line": 1181,
"rule": "space-before-blocks",
"severity": 2,
},
Object {
"column": 15,
"line": 1199,
"line": 1196,
"rule": "space-before-function-paren",
"severity": 2,
},
Object {
"column": 16,
"line": 1214,
"line": 1211,
"rule": "space-in-parens",
"severity": 2,
},
Object {
"column": 16,
"line": 1214,
"line": 1211,
"rule": "space-in-parens",
"severity": 2,
},
Object {
"column": 16,
"line": 1229,
"line": 1226,
"rule": "space-infix-ops",
"severity": 2,
},
Object {
"column": 13,
"line": 1239,
"line": 1236,
"rule": "space-unary-ops",
"severity": 2,
},
Object {
"column": 1,
"line": 1246,
"line": 1243,
"rule": "spaced-comment",
"severity": 2,
},
Object {
"column": 1,
"line": 1247,
"line": 1244,
"rule": "spaced-comment",
"severity": 2,
},
Object {
"column": 19,
"line": 1258,
"line": 1255,
"rule": "template-tag-spacing",
"severity": 2,
},
Expand Down
5 changes: 1 addition & 4 deletions test/fixtures/rules/style/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -755,11 +755,8 @@ Here's another paragraph!
// `newline-per-chained-call` - require a newline after each call in a method chain
// ---------------------------------------------------------------------
// This must be with arrow functions otherwise it has a conflict with the max statements per line rule
// Bad
// Not active
[1, 2, 3].filter((x) => x > 0).find((x) => x === 1).toString();
// Good
[1, 2, 3].filter((x) => x > 0).find((x) => x === 1)
.toString();

// `no-array-constructor` - disallow Array constructors
// ---------------------------------------------------------------------
Expand Down