Skip to content

Commit 3dd2e42

Browse files
armano2michalsnik
authored andcommitted
chore: enable no-mixed-operators to catch potentially harmful expressions (#672)
1 parent c15f05e commit 3dd2e42

File tree

4 files changed

+6
-5
lines changed

4 files changed

+6
-5
lines changed

.eslintrc.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ module.exports = {
2121
rules: {
2222
'eslint-plugin/report-message-format': ['error', '^[A-Z`\'{].*\\.$'],
2323
'eslint-plugin/prefer-placeholders': 'error',
24-
'eslint-plugin/consistent-output': 'error'
24+
'eslint-plugin/consistent-output': 'error',
25+
'no-mixed-operators': 'error'
2526
},
2627

2728
overrides: [{

lib/rules/no-async-in-computed-properties.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ const TIMED_FUNCTIONS = [
2727
]
2828

2929
function isTimedFunction (node) {
30-
return (
30+
return ((
3131
node.type === 'CallExpression' &&
3232
node.callee.type === 'Identifier' &&
3333
TIMED_FUNCTIONS.indexOf(node.callee.name) !== -1
@@ -38,7 +38,7 @@ function isTimedFunction (node) {
3838
node.callee.object.name === 'window' && (
3939
TIMED_FUNCTIONS.indexOf(node.callee.property.name) !== -1
4040
)
41-
) && node.arguments.length
41+
)) && node.arguments.length
4242
}
4343

4444
function isPromise (node) {

lib/rules/prop-name-casing.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ function create (context) {
3737

3838
return utils.executeOnVue(context, (obj) => {
3939
const props = utils.getComponentProps(obj)
40-
.filter(prop => prop.key && prop.key.type === 'Literal' || (prop.key.type === 'Identifier' && !prop.node.computed))
40+
.filter(prop => prop.key && (prop.key.type === 'Literal' || (prop.key.type === 'Identifier' && !prop.node.computed)))
4141

4242
for (const item of props) {
4343
const propName = item.key.type === 'Literal' ? item.key.value : item.key.name

lib/utils/indent-common.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -563,7 +563,7 @@ module.exports.defineVisitor = function create (context, tokenStore, defaultOpti
563563
} else {
564564
const baseOffsetInfo = offsets.get(offsetInfo.baseToken)
565565
if (baseOffsetInfo != null && baseOffsetInfo.expectedIndent != null && (i === 0 || !baseOffsetInfo.baseline)) {
566-
expectedIndents.push(baseOffsetInfo.expectedIndent + offsetInfo.offset * options.indentSize)
566+
expectedIndents.push(baseOffsetInfo.expectedIndent + (offsetInfo.offset * options.indentSize))
567567
if (baseOffsetInfo.baseline) {
568568
break
569569
}

0 commit comments

Comments
 (0)