I'm trying to apply this code: How to get X Y Z coordinates of tile by click on Leaflet map - which contains bitwise operator "<<". In the environment that I'm running it on (NodeJS, ExpressJS, AngularJS), codes are checked by ESLint upon compiling it but I need the solution given on the link. I get this error on compilation .
Unexpected use of '<<' no-bitwise
According to this link: http://eslint.org/docs/rules/no-bitwise - ESLint disallows bitwise operators. Is there any way to bypass this rule or if not, provide an alternate calculation that produces similar results to bitwise operation '<<'?
I hope my question is clear, thanks.
To turn off ESLint in the whole file, you can add /* eslint-disable */ in the first line of that file.
ESLint comes with a large number of built-in rules and you can add more rules through plugins. You can modify which rules your project uses either using configuration comments or configuration files. To change a rule setting, you must set the rule ID equal to one of these values: "off" or 0 - turn the rule off.
If you want to disable an ESLint rule in a file or on a specific line, you can add a comment. On a single line: const message = 'foo'; console. log(message); // eslint-disable-line no-console // eslint-disable-next-line no-console console.
Keep in mind that we have over 200 rules, and that is daunting both for end users and the ESLint team (who has to maintain them). As such, any new rules must be deemed of high importance to be considered for inclusion in ESLint.
You need to add the comment //eslint-disable-line no-bitwise
on the line you'd like for es-lint to ignore
e.g.
var x = 5 << 5; //eslint-disable-line no-bitwise
For power of two you can use Math.pow
const scale = Math.pow( 2, zoom );
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With