Repository: vuejs/eslint-plugin-vue (js)

Issue:
"Expected indentation" incorrectly for boolean operand on newline
**Tell us about your environment**	
* **ESLint version: 6.7.2**	
* **eslint-plugin-vue version: 6.0.1**	
* **Node version: 8.16.0**	

**Please show your full configuration:**
<!-- Paste content of your .eslintrc file -->
```javascript
module.exports = {
	'env': {
		'browser': true,
		'commonjs': true,
		'es6': true,
	},
	'extends': [
		// 'eslint:recommended',
		'plugin:vue/essential',
		// 'plugin:@typescript-eslint/eslint-recommended',
		// 'plugin:cypress/recommended',
	],
	'globals': {
		'Atomics': 'readonly',
		'SharedArrayBuffer': 'readonly',
	},
	'parserOptions': {
		'ecmaVersion': 2018,
		'parser': '@typescript-eslint/parser',
		'sourceType': 'module',
	},
	'plugins': [
		'vue',
		'@typescript-eslint/eslint-plugin',
		'vuetify',
		'cypress',
	],
	'rules': {
		// Unix linebreaks
		'linebreak-style': [
			'error',
			'unix',
		],
		// No bitwise
		'no-bitwise': 'error',
		// Always single quotes
		'quotes': [
			'error',
			'single',
			{
				'allowTemplateLiterals': true,
			}
		],
		// Always semi-colons
		'semi': [
			'error',
			'always',
		],
		// Allow unhandled callback error
		'handle-callback-err': 0,
		// Allow unused vars
		'no-unused-vars': 0,
		// Allow throw literal
		'no-throw-literal': 0,
		// Allow paren-less arrow functions
		'arrow-parens': 0,
		// Allow async-await
		'generator-star-spacing': 0,
		// Allow debugger during development
		'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
		// Allow dangling commas, but don't enforce it
		'comma-dangle': 0,
		// v-for with v-if rule
		'vue/no-use-v-if-with-v-for': [
			'error',
			{
				'allowUsingIterationVar': true,
			},
		],
		// Operator linebreaks
		'operator-linebreak': [
			'error',
			'after',
			{
				'overrides': {
					'?': 'before',
					':': 'before',
				},
			},
		],
		// Indent with tabs
		'indent': [
			'error',
			'tab',
			{
				'SwitchCase': 1,
				'MemberExpression': 1,
				'flatTernaryExpressions': false,
			},
		],
		// Indent with tabs in Vue script tags
		'vue/script-indent': [
			'error',
			'tab',
			{
				'baseIndent': 1,
				'switchCase': 1,
			},
		],
		// Indent with tabs HTML in Vue template tags
		'vue/html-indent': [
			'error',
			'tab',
			{
				'attribute': 1,
				'baseIndent': 1,
				'closeBracket': 0,
				'alignAttributesVertically': true,
				'ignores': [],
			},
		],
		// Vuetify rules
		'vuetify/no-deprecated-classes': 'error',
		'vuetify/grid-unknown-attributes': 'error',
		'vuetify/no-legacy-grid': 'error',
	},
	'overrides': [
		// turn off 'indent' rule for the script tag in Vue files since we have the 'vue/script-indent' rule
		{
			'files': ['*.vue'],
			'rules': {
				'indent': 0,
			},
		},
	],
};
```

**What did you do?**	
<!-- Please include the actual source code causing the issue. -->
```vue
<script>
	export default {
		methods: {
			shouldRefundTooltipShow (transaction) {
				return (
					(
						isPaymentPartiallyRefunded(transaction.refundPayments, transaction.amount) ||
						isPaymentFullyRefunded(transaction.refundPayments, transaction.amount) // TODO this line should pass the linter
					) &&
					(
						transaction.status === PAYMENT_STATUSES.SETTLED ||
						transaction.type === PAYMENT_TYPES.CREDIT_CARD // TODO this line should pass the linter
					)
				);
			},
		},
	};
</script>
```


**What did you expect to happen?**
The two lines with the `// TODO this line should pass the linter` should have passed.

**What actually happened?**
`error  Expected indentation of 5 tabs but found 6 tabs  vue/script-indent`

<img width="882" alt="Screen Shot 2019-12-20 at 11 37 31 AM" src="https://user-images.githubusercontent.com/11578445/71283348-229d9d80-231d-11ea-80fa-39412fd1f85f.png">


Pull request description:
Fixed wrong indentation
fixed #1007

Patch:
diff --git a/lib/utils/indent-common.js b/lib/utils/indent-common.js
index 227e85ad..826e1b8c 100644
--- a/lib/utils/indent-common.js
+++ b/lib/utils/indent-common.js
@@ -509,6 +509,11 @@ module.exports.defineVisitor = function create (context, tokenStore, defaultOpti
   function getChainHeadToken (node) {
     const type = node.type
     while (node.parent.type === type) {
+      const prevToken = tokenStore.getTokenBefore(node)
+      if (isLeftParen(prevToken)) {
+        // The chaining is broken by parentheses.
+        break
+      }
       node = node.parent
     }
     return tokenStore.getFirstToken(node)
@@ -537,7 +542,15 @@ module.exports.defineVisitor = function create (context, tokenStore, defaultOpti
         return parent.range[0] === token.range[0]
       }
       if (t === 'VExpressionContainer') {
-        return node.range[0] === token.range[0]
+        if (node.range[0] !== token.range[0]) {
+          return false
+        }
+        const prevToken = tokenStore.getTokenBefore(belongingNode)
+        if (isLeftParen(prevToken)) {
+          // It is not the first token because it is enclosed in parentheses.
+          return false
+        }
+        return true
       }
       if (t === 'CallExpression' || t === 'NewExpression') {
         const openParen = tokenStore.getTokenAfter(parent.callee, isNotRightParen)
diff --git a/package.json b/package.json
index 1474b777..0affa217 100644
--- a/package.json
+++ b/package.json
@@ -7,6 +7,7 @@
     "start": "npm run test:base -- --watch --growl",
     "test:base": "mocha \"tests/lib/**/*.js\" --reporter dot",
     "test": "nyc npm run test:base -- \"tests/integrations/*.js\" --timeout 60000",
+    "debug": "mocha --inspect-brk \"tests/lib/**/*.js\" --reporter dot --timeout 60000",
     "lint": "eslint . --rulesdir eslint-internal-rules",
     "pretest": "npm run lint",
     "preversion": "npm test && npm run update && git add .",


Test patch:
diff --git a/tests/fixtures/html-indent/logical-expression-01.vue b/tests/fixtures/html-indent/logical-expression-01.vue
new file mode 100644
index 00000000..a1f575d4
--- /dev/null
+++ b/tests/fixtures/html-indent/logical-expression-01.vue
@@ -0,0 +1,64 @@
+<!--{}-->
+<template>
+  <div>
+    <span
+      v-if="
+        a &&
+          b"
+    >
+    </span>
+    <span
+      v-if="
+        a
+          && b"
+    >
+    </span>
+    <span
+      v-if="
+        a
+          &&
+          b"
+    >
+    </span>
+    <!-- Enclosed in parentheses -->
+    <span
+      v-if="(
+        a &&
+        b
+      )"
+    >
+    </span>
+    <span
+      v-if="(
+        a
+        && b
+      )"
+    >
+    </span>
+    <span
+      v-if="(
+        a
+        &&
+        b
+      )"
+    >
+    </span>
+    <!-- The first line is the same line -->
+    <span
+      v-if="a &&
+        b"
+    >
+    </span>
+    <span
+      v-if="a
+        && b"
+    >
+    </span>
+    <span
+      v-if="a
+        &&
+        b"
+    >
+    </span>
+  </div>
+</template>
diff --git a/tests/fixtures/script-indent/logical-expression-01.vue b/tests/fixtures/script-indent/logical-expression-01.vue
new file mode 100644
index 00000000..087e0075
--- /dev/null
+++ b/tests/fixtures/script-indent/logical-expression-01.vue
@@ -0,0 +1,16 @@
+<!--{}-->
+<script>
+// https://github.com/vuejs/eslint-plugin-vue/issues/1007
+function fn () {
+  return (
+    (
+      a ||
+      b
+    ) &&
+    (
+      c ||
+      d
+    )
+  );
+}
+</script>
diff --git a/tests/fixtures/script-indent/logical-expression-02.vue b/tests/fixtures/script-indent/logical-expression-02.vue
new file mode 100644
index 00000000..ccba0b7c
--- /dev/null
+++ b/tests/fixtures/script-indent/logical-expression-02.vue
@@ -0,0 +1,12 @@
+<!--{}-->
+<script>
+var bb =
+  (
+    a ||
+    b
+  ) &&
+  (
+    c ||
+    d
+  )
+</script>
diff --git a/tests/fixtures/script-indent/logical-expression-03.vue b/tests/fixtures/script-indent/logical-expression-03.vue
new file mode 100644
index 00000000..9b5ccb8c
--- /dev/null
+++ b/tests/fixtures/script-indent/logical-expression-03.vue
@@ -0,0 +1,9 @@
+<!--{}-->
+<script>
+var bb =
+  a &&
+  b
+  ||
+  c &&
+  d
+</script>