Fix rules

This commit is contained in:
Clément Fournier
2020-03-19 02:52:33 +01:00
parent 0d65c2e6e6
commit 3d429019ee
10 changed files with 51 additions and 14 deletions

View File

@ -190,7 +190,7 @@ See also: <http://eslint.org/docs/rules/no-else-return>
<property name="xpath">
<value>
<![CDATA[
//IfStatement[@Else="true"][Scope[1]/ReturnStatement]
//IfStatement[@Else=true()][Scope[1]/ReturnStatement]
]]>
</value>
</property>

View File

@ -62,11 +62,10 @@ same type. The === operator avoids the casting.
<property name="xpath">
<value>
<![CDATA[
//InfixExpression[(@Image = "==" or @Image = "!=")
//InfixExpression[
(@Image = "==" or @Image = "!=")
and
(child::KeywordLiteral[@Image = true() or @Image = false()]
or
child::NumberLiteral)
(KeywordLiteral[@Image='true' or @Image = 'false'] or NumberLiteral)
]
]]>
</value>
@ -110,7 +109,7 @@ precision in a floating point number. This may result in numeric calculations b
<property name="xpath">
<value>
<![CDATA[
//NumberLiteral[@NormalizedImage != @Number]
//NumberLiteral[@NormalizedImage != string(@Number)]
]]>
</value>
</property>