@croct/eslint-plugin 0.2.0 → 0.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@croct/eslint-plugin",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "ESLint rules and presets applied to all Croct JavaScript projects.",
5
5
  "license": "MIT",
6
6
  "author": {
@@ -80,8 +80,14 @@ exports.newlinePerChainedCall = (0, createRule_1.createRule)({
80
80
  if (memberExpressions.length > ignoreChainWithDepth
81
81
  && hasCallExpression
82
82
  && memberExpressions.some(hasObjectAndPropertyOnSameLine)) {
83
- memberExpressions
84
- .filter(hasObjectAndPropertyOnSameLine)
83
+ const expressionsOnSameLine = memberExpressions
84
+ .filter(hasObjectAndPropertyOnSameLine);
85
+ const rootNode = expressionsOnSameLine[expressionsOnSameLine.length - 1];
86
+ if (rootNode.type === 'MemberExpression'
87
+ && rootNode.object.type === 'ThisExpression') {
88
+ expressionsOnSameLine.pop();
89
+ }
90
+ expressionsOnSameLine
85
91
  .forEach(memberExpression => {
86
92
  context.report({
87
93
  node: memberExpression.property,