simplify UnnecessaryBlock xpath rule

This commit is contained in:
Oleksandr Shvets
2024-03-09 23:35:32 +02:00
parent 3b9dcc0f2f
commit 0ec6a4f770

View File

@ -224,13 +224,17 @@ be misleading. Considering removing this unnecessary Block.
<property name="xpath">
<value>
<![CDATA[
//Block[not(parent::FunctionNode or parent::IfStatement or parent::ForLoop or parent::ForInLoop or parent::ForOfLoop
or parent::WhileLoop or parent::DoLoop or parent::TryStatement or parent::CatchClause
or parent::VariableDeclarator or parent::ImportDeclaration)]
|
//Scope[not(parent::FunctionNode or parent::IfStatement or parent::ForLoop or parent::ForInLoop or parent::ForOfLoop
or parent::WhileLoop or parent::DoLoop or parent::TryStatement or parent::CatchClause
or parent::VariableDeclarator or parent::ImportDeclaration)]
//(Block|Scope)
[not(
parent::FunctionNode or
parent::IfStatement or
parent::ForLoop or
parent::ForInLoop or
parent::WhileLoop or
parent::DoLoop or
parent::TryStatement or
parent::CatchClause
)]
]]>
</value>
</property>