Replace bitwise operation in ESLint

I am trying to apply this code: How to get the XYZ coordinates of a fragment by clicking on a sheet map that contains the bitwise operator "<<". In the environment in which I run it (NodeJS, ExpressJS, AngularJS), the codes are checked by ESLint at compilation, but I need the solution indicated in the link. I get this error while compiling.

Unexpected use '<<no-bitwise

From this link: http://eslint.org/docs/rules/no-bitwise - ESLint prohibits bitwise operators. Is there a way around this rule or, if not, provide an alternative calculation that gives similar results for the bitwise operation '<<'?

Hope my question is clear, thanks.

+7
javascript dictionary eslint
source share
1 answer

You need to add a comment //eslint-disable-line no-bitwise to the line you want to use for es-lint to ignore

eg.

 var x = 5 << 5; //eslint-disable-line no-bitwise 
+9
source share

All Articles