This fixes an issue that comments were added as leading comments to expressions, which are not immediately folowing the comment. This was also reported and fixed in espree, and is basically a port to babylon. eslint/espree#256 this also fixes an issue in babel-eslint with certain rules babel/babel-eslint#289
14 lines
297 B
JavaScript
Executable File
14 lines
297 B
JavaScript
Executable File
module.exports = function(context) {
|
|
|
|
function isConstant(node) {
|
|
switch (node.type) {
|
|
case "SequenceExpression":
|
|
return isConstant(node.expressions[node.expressions.length - 1]);
|
|
// no default
|
|
}
|
|
|
|
return false;
|
|
}
|
|
|
|
};
|