diff --git a/.eslintrc.js b/.eslintrc.js index 4b2731d67..b8f76a4f4 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -21,7 +21,8 @@ module.exports = { rules: { 'eslint-plugin/report-message-format': ['error', '^[A-Z`\'{].*\\.$'], 'eslint-plugin/prefer-placeholders': 'error', - 'eslint-plugin/consistent-output': 'error' + 'eslint-plugin/consistent-output': 'error', + 'no-mixed-operators': 'error' }, overrides: [{ diff --git a/lib/rules/no-async-in-computed-properties.js b/lib/rules/no-async-in-computed-properties.js index 3c4499382..393277287 100644 --- a/lib/rules/no-async-in-computed-properties.js +++ b/lib/rules/no-async-in-computed-properties.js @@ -27,7 +27,7 @@ const TIMED_FUNCTIONS = [ ] function isTimedFunction (node) { - return ( + return (( node.type === 'CallExpression' && node.callee.type === 'Identifier' && TIMED_FUNCTIONS.indexOf(node.callee.name) !== -1 @@ -38,7 +38,7 @@ function isTimedFunction (node) { node.callee.object.name === 'window' && ( TIMED_FUNCTIONS.indexOf(node.callee.property.name) !== -1 ) - ) && node.arguments.length + )) && node.arguments.length } function isPromise (node) { diff --git a/lib/rules/prop-name-casing.js b/lib/rules/prop-name-casing.js index e70b24f0d..1a0ce185e 100644 --- a/lib/rules/prop-name-casing.js +++ b/lib/rules/prop-name-casing.js @@ -37,7 +37,7 @@ function create (context) { return utils.executeOnVue(context, (obj) => { const props = utils.getComponentProps(obj) - .filter(prop => prop.key && prop.key.type === 'Literal' || (prop.key.type === 'Identifier' && !prop.node.computed)) + .filter(prop => prop.key && (prop.key.type === 'Literal' || (prop.key.type === 'Identifier' && !prop.node.computed))) for (const item of props) { const propName = item.key.type === 'Literal' ? item.key.value : item.key.name diff --git a/lib/utils/indent-common.js b/lib/utils/indent-common.js index c8c867250..e705e26d7 100644 --- a/lib/utils/indent-common.js +++ b/lib/utils/indent-common.js @@ -563,7 +563,7 @@ module.exports.defineVisitor = function create (context, tokenStore, defaultOpti } else { const baseOffsetInfo = offsets.get(offsetInfo.baseToken) if (baseOffsetInfo != null && baseOffsetInfo.expectedIndent != null && (i === 0 || !baseOffsetInfo.baseline)) { - expectedIndents.push(baseOffsetInfo.expectedIndent + offsetInfo.offset * options.indentSize) + expectedIndents.push(baseOffsetInfo.expectedIndent + (offsetInfo.offset * options.indentSize)) if (baseOffsetInfo.baseline) { break }