Skip to content
This repository has been archived by the owner on Mar 25, 2021. It is now read-only.

no-magic-numbers: false positive with bitshift #2059

Closed
RomkeVdMeulen opened this issue Jan 17, 2017 · 3 comments
Closed

no-magic-numbers: false positive with bitshift #2059

RomkeVdMeulen opened this issue Jan 17, 2017 · 3 comments

Comments

@RomkeVdMeulen
Copy link
Contributor

Bug Report

  • TSLint version: 4.3.1
  • TypeScript version: 2.1.5
  • Running TSLint via: gulp-tslint

TypeScript code being linted

export class MyClass {

	private static readonly MINIMAL_SPACE_BYTES = 2 << 20;

}

with tslint.json configuration:

"no-magic-numbers": [true, -1, 0, 1, 2, 3, 4, 10, 100]

Actual behavior

(no-magic-numbers) my-class.ts[3, 53]: 'magic numbers' are not allowed

Expected behavior

No error

@andy-hanson
Copy link
Contributor

andy-hanson commented Jan 18, 2017

This seems related to #1883. Although treating 2 << x as not-magic makes more sense than allowing 60 * x as not-magic.

@JoshuaKGoldberg
Copy link
Contributor

💀 It's time! 💀

TSLint is deprecated and no longer accepting pull requests other than security fixes. See #4534. ☠️
We recommend you instead use typescript-eslint to lint your TypeScript code with ESLint. ✅

👋 It was a pleasure open sourcing with you!

@JoshuaKGoldberg
Copy link
Contributor

🤖 Beep boop! 👉 TSLint is deprecated 👈 (#4534) and you should switch to typescript-eslint! 🤖

🔒 This issue is being locked to prevent further unnecessary discussions. Thank you! 👋

@palantir palantir locked and limited conversation to collaborators Mar 20, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants