mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-20 02:08:47 +00:00
Bumping eslint versions (#141121)
* hBumping eslint versions - Bump eslint and typescript/eslint versions to latest - Fixing `code-no-unused-expression` for `x?.(b);` type statements - Fixed a few new semicolon errors from upgrade * Bump eslint parser in build * Fix eslint errors in d.ts
This commit is contained in:
@@ -108,13 +108,16 @@ module.exports = {
|
||||
if (allowTaggedTemplates && node.type === 'TaggedTemplateExpression') {
|
||||
return true;
|
||||
}
|
||||
return /^(?:Assignment|OptionalCall|Call|New|Update|Yield|Await)Expression$/u.test(node.type) ||
|
||||
if (node.type === 'ExpressionStatement') {
|
||||
return isValidExpression(node.expression);
|
||||
}
|
||||
return /^(?:Assignment|OptionalCall|Call|New|Update|Yield|Await|Chain)Expression$/u.test(node.type) ||
|
||||
(node.type === 'UnaryExpression' && ['delete', 'void'].indexOf(node.operator) >= 0);
|
||||
}
|
||||
return {
|
||||
ExpressionStatement(node) {
|
||||
if (!isValidExpression(node.expression) && !isDirective(node, context.getAncestors())) {
|
||||
context.report({ node: node, message: 'Expected an assignment or function call and instead saw an expression.' });
|
||||
context.report({ node: node, message: `Expected an assignment or function call and instead saw an expression. ${node.expression}` });
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user