-
-
Notifications
You must be signed in to change notification settings - Fork 681
/
Copy patheqeqeq.js
40 lines (37 loc) · 848 Bytes
/
eqeqeq.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
/**
* @author Toru Nagashima
*/
'use strict'
const RuleTester = require('../../eslint-compat').RuleTester
const rule = require('../../../lib/rules/eqeqeq')
const tester = new RuleTester({
languageOptions: { parser: require('vue-eslint-parser'), ecmaVersion: 2015 }
})
tester.run('eqeqeq', rule, {
valid: [
'<template><div :attr="a === 1" /></template>',
// CSS vars injection
`
<style>
.text {
color: v-bind(a === 1 ? 'red' : 'blue')
}
</style>`
],
invalid: [
{
code: '<template><div :attr="a == 1" /></template>',
errors: ["Expected '===' and instead saw '=='."]
},
// CSS vars injection
{
code: `
<style>
.text {
color: v-bind(a == 1 ? 'red' : 'blue')
}
</style>`,
errors: ["Expected '===' and instead saw '=='."]
}
]
})