Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export default util.createRule({
}

return {
'BinaryExpression[operator=/=|<|>/]'(
'BinaryExpression[operator=/^[<>!=]?={0,2}$/]'(
node: TSESTree.BinaryExpression,
): void {
const left = getTypeFromNode(node.left);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,6 +292,20 @@ ruleTester.run('strict-enums-comparison', rule, {
num === someFunction;
mixed === someFunction;
`,
`
enum Fruit {
Apple,
}

const bitShift = 1 << Fruit.Apple;
`,
`
enum Fruit {
Apple,
}

const bitShift = 1 >> Fruit.Apple;
`,
],
invalid: [
{
Expand Down